Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AndroidJavaException: java.lang.NoSuchMethodError: no static method with name='setIsUnityInit' #707

Open
Burak-Yavas opened this issue Dec 25, 2023 · 0 comments
Labels

Comments

@Burak-Yavas
Copy link

Hi,

This error appears on our analytics console when we try our android builds.

AndroidJavaException: java.lang.NoSuchMethodError: no static method with name='setIsUnityInit' signature='(Z)V' in class Ljava.lang.Object; java.lang.NoSuchMethodError: no static method with name='setIsUnityInit' signature='(Z)V' in class Ljava.lang.Object; com.unity3d.player.ReflectionHelper.getMethodID(Unknown Source:165) com.unity3d.player.UnityPlayer.nativeRender(Native Method) com.unity3d.player.UnityPlayer.-$$Nest$mnativeRender(Unknown Source:0) com.unity3d.player.UnityPlayer$F$a.handleMessage(Unknown Source:122) android.os.Handler.dispatchMessage(Handler.java:102) android.os.Looper.loopOnce(Looper.java:226) android.os.Looper.loop(Looper.java:313) com.unity3d.player.UnityPlayer$F.run(Unknown Source:24) UnityEngine._AndroidJNIHelper.GetMethodID (System.IntPtr jclass, System.String methodName, System.String signature, System.Boolean isStatic) (at <00000000000000000000000000000000>:0) UnityEngine.AndroidJavaObject._CallStatic (System.String methodName, System.Object[] args) (at <00000000000000000000000000000000>:0) Facebook.Unity.CodelessUIInteractEvent.SetLoggerInitAndroid () (at <00000000000000000000000000000000>:0) UnityEngine.GameObject.AddComponent[T] () (at <00000000000000000000000000000000>:0) Facebook.Unity.FB.Init (Facebook.Unity.InitDelegate onInitComplete, Facebook.Unity.HideUnityDelegate onHideUnity, System.String authResponse) (at <00000000000000000000000000000000>:0) UnityEngine.GameObject:AddComponent() Facebook.Unity.FB:Init(InitDelegate, HideUnityDelegate, String)

We had fixed another error: AndroidJavaException: java.lang.NoSuchMethodError: no static method with name='SetUserAgentSuffix'
by adding -keep class com.facebook.unity.* {*;} to our proguard file. However java.lang.NoSuchMethodError: no static method with name='setIsUnityInit' error still coming.

our proguard file:

-keep class com.google.unity.** {
*;
}
-keep public class com.google.android.gms.ads.{
public *;
}
-keep public class com.google.ads.
{
public ;
}
-keepattributes Annotation
-dontobfuscate
-keep class com.gameanalytics.sdk { ; }
-keep class com.gameanalytics.sdk.
{ *; }

-keep class com.gameanalytics.sdk.GAPlatform { ; }
-keep class com.gameanalytics.sdk.GAPlatform.
* { ; }
-keep class android.net.ConnectivityManager.
* { ; }
-keep class com.google.android.instantapps.InstantApps { ; }
-keepclassmembers class com.google.android.instantapps.InstantApps{
; }
-keep class com.facebook.unity.
{*;}

unity version: 2022.3.15
sdk version: 16.0.2

any tip or advice, thank you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant