Giter Club home page Giter Club logo

Comments (8)

soh2131 avatar soh2131 commented on September 26, 2024 13

Here's how to fix this:

find the line in function SendNotification of AndroidNotificationCenter.cs
replace

int smallIconId = notificationManager.CallStatic<int>("findResourceidInContextByName",
    notification.smallIcon, androidContext, activity);

with

int smallIconId = managerClass.CallStatic<int>("findResourceidInContextByName",
    notification.smallIcon, androidContext, activity);

Also do this for others in the same function that calls "findResourceidInContextByName"

Problem solved.

from com.unity.mobile.notifications.

oniskanen avatar oniskanen commented on September 26, 2024 3

Thanks for the workaround! Would it be possible to push a 1.0.5 update with this change into the Unity Package Manager? We're currently manually patching the package, but it needs to be done on each dev machine and repository separately.

from com.unity.mobile.notifications.

MaelHaquin avatar MaelHaquin commented on September 26, 2024 2

Hi, I made a quick script who replace the file with the error with a fixed copy of the script when you build.
All you have to do is set the path of the both files in the FileUtil.ReplaceFile() function.
FixAndroidNotificationPackage.zip

from com.unity.mobile.notifications.

soh2131 avatar soh2131 commented on September 26, 2024

11-19 13:45:43.687 7442 7471 E Unity : AndroidJavaException: java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.String java.lang.Class.getName()' on a null object reference
11-19 13:45:43.687 7442 7471 E Unity : java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.String java.lang.Class.getName()' on a null object reference
11-19 13:45:43.687 7442 7471 E Unity : at com.unity3d.player.ReflectionHelper.getMethodID(Unknown Source:224)
11-19 13:45:43.687 7442 7471 E Unity : at com.unity3d.player.UnityPlayer.nativeFocusChanged(Native Method)
11-19 13:45:43.687 7442 7471 E Unity : at com.unity3d.player.UnityPlayer.a(Unknown Source:0)
11-19 13:45:43.687 7442 7471 E Unity : at com.unity3d.player.UnityPlayer$e$1.handleMessage(Unknown Source:177)
11-19 13:45:43.687 7442 7471 E Unity : at android.os.Handler.dispatchMessage(Handler.java:103)
11-19 13:45:43.687 7442 7471 E Unity : at android.os.Looper.loop(Looper.java:214)
11-19 13:45:43.687 7442 7471 E Unity : at com.unity3d.player.UnityPlayer$e.run(Unknown Source:20)
11-19 13:45:43.687 7442 7471 E Unity : at UnityEngine._AndroidJNIHelper.GetMethodID (System.IntPtr jclass, System.String methodName, System.String signature, System.Boolean isStatic) [0x00041] in /Users/builduser/buildslave/unity/build/Modules/AndroidJNI/AndroidJava.cs:1396
11-19 13:45:43.687 7442 7471 E Unity : at UnityEngine.AndroidJNIHelper.GetMethodID (System.IntP

This happens in the SampleProject as well as our projects using Pixel 2 Android 10 with Unity 2019.2.12f1

from com.unity.mobile.notifications.

jackatfp avatar jackatfp commented on September 26, 2024

it also happens in 2019.2.11f1

from com.unity.mobile.notifications.

jackatfp avatar jackatfp commented on September 26, 2024

Thanks!

from com.unity.mobile.notifications.

KaloaGames avatar KaloaGames commented on September 26, 2024

Thanks! solved my Problem too

from com.unity.mobile.notifications.

vincent-unity avatar vincent-unity commented on September 26, 2024

Is this still a problem? I didn't check the previous version, but it should have been fixed in the latest 1.1.0-preview.

from com.unity.mobile.notifications.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.