模拟器上正常运行 真机闪退 通过抓日志
代码语言:javascript复制java.lang.UnsatisfiedLinkError: No implementation found for void com.unity3d.player.UnityPlayer.nativeRestartActivityIndicator() (tried Java_com_unity3d_player_UnityPlayer_nativeRestartActivityIndicator and Java_com_unity3d_player_UnityPlayer_nativeRestartActivityIndicator__)
at com.unity3d.player.UnityPlayer.nativeRestartActivityIndicator(Native Method)
at com.unity3d.player.UnityPlayer.resume(Unknown Source:27)
at com.unity3d.player.UnityPlayerActivity.onResume(Unknown Source:5)
at com.mygame.game.GameActivity.onResume(GameActivity.java:298)
GameActivity继承于UnityPlayerActivity,不会存在找不到com.unity3d.player.UnityPlayerActivity.onResume的情况
通过rar,打开apk文件,进入lib目录
x86是模拟器使用目录,里面有libunity.so
arm64-v8a是真机使用目录,打开缺少libunity.so 解决办法: 删除无用的构架目录,例如如果armv7,x86是包含最全的.so,在unity工程里只保留这两个目录