Skip to content

AndroidJavaException: java.lang.NoSuchMethodError: no static method with name='SetNotification'  #128

Description

@swats1010
E/Unity: AndroidJavaException: java.lang.NoSuchMethodError: no static method with name='SetNotification' signature='(IJLjava/lang/String;Ljava/lang/String;Ljava/lang/String;ILjava/lang/String;IILjava/lang/String;Ljava/lang/String;ILjava/lang/String;Ljava/lang/String;Ljava/lang/String;)V' in class Lnet.agasper.unitynotification.UnityNotificationManager;
    java.lang.NoSuchMethodError: no static method with name='SetNotification' signature='(IJLjava/lang/String;Ljava/lang/String;Ljava/lang/String;ILjava/lang/String;IILjava/lang/String;Ljava/lang/String;ILjava/lang/String;Ljava/lang/String;Ljava/lang/String;)V' in class Lnet.agasper.unitynotification.UnityNotificationManager;
        at com.unity3d.player.ReflectionHelper.getMethodID(Unknown Source)
        at com.unity3d.player.UnityPlayer.nativeRender(Native Method)
        at com.unity3d.player.UnityPlayer.c(Unknown Source)
        at com.unity3d.player.UnityPlayer$e$2.queueIdle(Unknown Source)
        at android.os.MessageQueue.next(MessageQueue.java:216)
        at android.os.Looper.loop(Looper.java:151)

The call from my app

LocalNotification.SendNotification(1, miliSeconds, StaticStrings.notificationTitle, StaticStrings.notificationMessage,"soundName", new Color32(0xff, 0x44, 0x44, 255), true, true, true, "app_icon");

and the call from the LocalNotification class

public static int SendNotification(int id, long delayMs, string title, string message,String soundName, Color32 bgColor, bool sound = true, bool vibrate = true, bool lights = true, string bigIcon = "")
    {
		
#if UNITY_ANDROID //&& !UNITY_EDITOR
        AndroidJavaClass pluginClass = new AndroidJavaClass(fullClassName);
        if (pluginClass != null)
        {
		Debug.Log(" pluginclass not nulll");
            pluginClass.CallStatic("SetNotification", id, delayMs, title, message, message, 
		sound ? 1 : 0,soundName, vibrate ? 1 : 0, lights ? 1 : 0, bigIcon, "notify_icon_small", 
        bgColor.r * 65536 + bgColor.g * 256 + bgColor.b, "bundle", "channel", Application.identifier);
        }
		Debug.Log(" pluginclass  nulll : id : " + id);
        return id;

How do i fix this and what wrong am i doing ?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions