Unity3d+Android:模拟器正常运行,真机闪退

模拟器上正常运行
真机闪退
通过抓日志

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目录
Unity3d+Android:模拟器正常运行,真机闪退_第1张图片

x86是模拟器使用目录,里面有libunity.so
Unity3d+Android:模拟器正常运行,真机闪退_第2张图片

arm64-v8a是真机使用目录,打开缺少libunity.so
解决办法:
删除无用的构架目录,例如如果armv7,x86是包含最全的.so,在unity工程里只保留这两个目录

你可能感兴趣的:(Unity3d+Android,android,Unity3d,真机闪退,模拟器正常)