Closed dlunhor closed 3 years ago
Does this issue occur when you call NativeShare.Share? Because I can't see NativeShare in the stacktrace. If it does, then can you build with Development Build and see if NativeShare appears in the stacktrace?
Code of EtceteraMailWriter:SendMail
where we call new NativeShare().AddFile(pathToAttachment).Share();
public static void SendEmail(string to, string subject, string body, string pathToAttachment = "", string mimeType = "", string cc = "", string bcc = "")
{
#if UNITY_IOS
if (string.IsNullOrEmpty(to))
{
new NativeShare().AddFile( pathToAttachment ).Share();
}
else
{
if (Application.platform == RuntimePlatform.IPhonePlayer)
sendEmail(to, cc, bcc, subject, body, pathToAttachment, mimeType);
}
#elif UNITY_ANDROID
if (string.IsNullOrEmpty(to))
{
new NativeShare().AddFile(pathToAttachment).Share();
}
else
{
if (Application.platform == RuntimePlatform.Android)
Obj.CallStatic("sendEmail", new object[] { to, cc, bcc, subject, body, pathToAttachment });
}
#endif
}
2021.04.22 15:11:12.211 27192 27249 Info Unity 684901a8-5c93-4b7d-97b5-1e268531084f.package
2021.04.22 15:11:12.211 27192 27249 Info Unity EtceteraMailWriter:SendMail(String, String, String, String)
2021.04.22 15:11:12.211 27192 27249 Info Unity AppLog:SendToEmail(Boolean)
2021.04.22 15:11:12.211 27192 27249 Info Unity UnityEngine.Events.UnityAction:Invoke()
2021.04.22 15:11:12.211 27192 27249 Info Unity UnityEngine.Events.UnityEvent:Invoke()
2021.04.22 15:11:12.211 27192 27249 Info Unity UnityEngine.EventSystems.EventFunction1:Invoke(T1, BaseEventData) 2021.04.22 15:11:12.211 27192 27249 Info Unity UnityEngine.EventSystems.ExecuteEvents:Execute(GameObject, BaseEventData, EventFunction
1)
2021.04.22 15:11:12.211 27192 27249 Info Unity UnityEngine.EventSystems.StandaloneInputModule:ProcessTouchPress(PointerEventData, Boolean, Boolean)
2021.04.22 15:11:12.211 27192 27249 Info Unity UnityEngine.EventSystems.StandaloneInputModule:ProcessTouchEvents()
2021.04.22 15:11:12.211 27192 27249 Info Unity UnityEngine.EventSystems.StandaloneInputModule:Process()
2021.04.22 15:11:12.211 27192 27249 Info Unity
2021.04.22 15:11:12.220 27192 27249 Error Unity UNCAUGHT EXCEPTION: AndroidJavaException: java.lang.NoClassDefFoundError: Failed resolution of: Lcom/unity3d/player/UnityPlayerNativeActivity;
2021.04.22 15:11:12.220 27192 27249 Error Unity STACK_TRACE: java.lang.NoClassDefFoundError: Failed resolution of: Lcom/unity3d/player/UnityPlayerNativeActivity;
2021.04.22 15:11:12.220 27192 27249 Error Unity com.unity3d.player.UnityPlayer.nativeRender(Native Method)
2021.04.22 15:11:12.220 27192 27249 Error Unity com.unity3d.player.UnityPlayer.access$300(Unknown Source:0)
2021.04.22 15:11:12.220 27192 27249 Error Unity com.unity3d.player.UnityPlayer$e$1.handleMessage(Unknown Source:95)
2021.04.22 15:11:12.220 27192 27249 Error Unity android.os.Handler.dispatchMessage(Handler.java:102)
2021.04.22 15:11:12.220 27192 27249 Error Unity android.os.Looper.loop(Looper.java:236)
2021.04.22 15:11:12.220 27192 27249 Error Unity com.unity3d.player.UnityPlayer$e.run(Unknown Source:20)
2021.04.22 15:11:12.220 27192 27249 Error Unity Caused by: java.lang.ClassNotFoundException: Didn't find class "com.unity3d.player.UnityPlayerNativeActivity" on path: DexPathList[[zip file "/data/app/KygqrNh-A0x0I6xRByCSuw==/com.SkyTrak.SkyTrak-kPex8CiJmpxQXc0a7xEJog==/base.apk"],nativeLibraryDirectories=[/data/app/KygqrNh-A0x0I6xRByCSuw==/com.SkyTrak.SkyTrak-kPex8CiJmpxQXc0a7xEJog==/lib/arm64, /data/app/~~KygqrNh-A0x0I6xRByCSuw==/com.SkyTrak.SkyTrak-kPex8CiJmpxQXc0a7xE
2021.04.22 15:11:12.220 27192 27249 Error Unity AndroidJavaException: java.lang.NoClassDefFoundError: Failed resolution of: Lcom/unity3d/player/UnityPlayerNativeActivity;
2021.04.22 15:11:12.220 27192 27249 Error Unity java.lang.NoClassDefFoundError: Failed resolution of: Lcom/unity3d/player/UnityPlayerNativeActivity;
2021.04.22 15:11:12.220 27192 27249 Error Unity at com.unity3d.player.UnityPlayer.nativeRender(Native Method)
2021.04.22 15:11:12.220 27192 27249 Error Unity at com.unity3d.player.UnityPlayer.access$300(Unknown Source:0)
2021.04.22 15:11:12.220 27192 27249 Error Unity at com.unity3d.player.UnityPlayer$e$1.handleMessage(Unknown Source:95)
2021.04.22 15:11:12.220 27192 27249 Error Unity at android.os.Handler.dispatchMessage(Handler.java:102)
2021.04.22 15:11:12.220 27192 27249 Error Unity at android.os.Looper.loop(Looper.java:236)
2021.04.22 15:11:12.220 27192 27249 Error Unity at com.unity3d.player.UnityPlayer$e.run(Unknown Source:20)
2021.04.22 15:11:12.220 27192 27249 Error Unity Caused by: java.lang.ClassNotFoundException: Didn't find class "com.unity3d.player.UnityPlayerNativeActivity" on path: DexPathList[[zip file "/data/app/KygqrNh-A0x0I6xRByCSuw==/com.SkyTrak.SkyTrak-kPex8CiJmpxQXc0a7xEJog==/base.apk"],nativeLibraryDirectories=[/data/app/KygqrNh-A0x0I6xRByCSuw==/com.SkyTrak.SkyTrak-kPex8CiJmpxQXc0a7xEJog==/lib/arm64, /data/app/~~KygqrNh-A0x0I6xRByCSuw==/com.SkyTrak.SkyTrak-kPex8CiJmpxQXc0a7xEJog==/bas
We always have to
. So yes, I call NativeShare.
And if you make the following change, you can see "Before NativeShare" line and the app crashes? I'm skeptical because I still can't see NativeShare anywhere in the stacktrace 🤷♂️
#elif UNITY_ANDROID
Debug.Log("Before NativeShare");
new NativeShare().AddFile(pathToAttachment).Share();
Debug.Log("After NativeShare");
#endif
Ok. My problem. Good. Thank you ;)
Description of the bug
Just cannot share the file. Use it like this.
new NativeShare().AddFile(pathToAttachment).Share();
Works on every android version except 11.
Reproduction steps
Platform specs
Additional info
2021.04.22 12:36:12.711 20400 20427 Error Unity AndroidJavaException: java.lang.NoClassDefFoundError: Failed resolution of: Lcom/unity3d/player/UnityPlayerNativeActivity; 2021.04.22 12:36:12.711 20400 20427 Error Unity java.lang.NoClassDefFoundError: Failed resolution of: Lcom/unity3d/player/UnityPlayerNativeActivity; 2021.04.22 12:36:12.711 20400 20427 Error Unity at com.unity3d.player.UnityPlayer.nativeRender(Native Method) 2021.04.22 12:36:12.711 20400 20427 Error Unity at com.unity3d.player.UnityPlayer.access$300(Unknown Source:0) 2021.04.22 12:36:12.711 20400 20427 Error Unity at com.unity3d.player.UnityPlayer$e$1.handleMessage(Unknown Source:95) 2021.04.22 12:36:12.711 20400 20427 Error Unity at android.os.Handler.dispatchMessage(Handler.java:102) 2021.04.22 12:36:12.711 20400 20427 Error Unity at android.os.Looper.loop(Looper.java:236) 2021.04.22 12:36:12.711 20400 20427 Error Unity at com.unity3d.player.UnityPlayer$e.run(Unknown Source:20) 2021.04.22 12:36:12.711 20400 20427 Error Unity Caused by: java.lang.ClassNotFoundException: com.unity3d.player.UnityPlayerNativeActivity 2021.04.22 12:36:12.711 20400 20427 Error Unity ... 6 more 2021.04.22 12:36:12.711 20400 20427 Error Unity at UnityEngine.AndroidJNISafe.CheckException () [0x00000] in <00000000000000000000000000000000>:0 2021.04.22 12:36:12.711 20400 20427 Error Unity at UnityEngine.AndroidJNISafe.FindClass (System.String name) [0x00000] in <00000000000000000000000000000000>:0 2021.04.22 12:36:12.711 20400 20427 Error Unity at UnityEngine.AndroidJavaClass._AndroidJavaClass (System.String className) [0x00000] in <000000000000000000000000000000
Android manifest:
Custom Proguard option is enabled and line added in the file