编程语言
首页 > 编程语言> > Android MultiDex应用程序在Android Studio 3.0上的低API上崩溃

Android MultiDex应用程序在Android Studio 3.0上的低API上崩溃

作者:互联网

我试图在API 16设备上运行需要使用Android Studio 3.0的MultiDex的应用程序,当应用程序最终尝试启动时,它会崩溃.
其他低API也是如此(例如:17,18,19)

但是,当我尝试使用Android Studio 3.1(测试版)运行应用程序时,不会发生崩溃.

这种崩溃有什么办法可以修复吗?

   FATAL EXCEPTION: main
  java.lang.ExceptionInInitializerError
      at android.support.multidex.MultiDexApplication.<init>(MultiDexApplication.java:35)
      at MY_APP_PATH.MY_CUSTOM_APPLICATION_CLASS.<init>(MY_CUSTOM_APP_CLASS.java:23)
      at java.lang.Class.newInstanceImpl(Native Method)
      at java.lang.Class.newInstance(Class.java:1319)
      at android.app.Instrumentation.newApplication(Instrumentation.java:997)
      at android.app.Instrumentation.newApplication(Instrumentation.java:982)
      at android.app.LoadedApk.makeApplication(LoadedApk.java:496)
      at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4170)
      at android.app.ActivityThread.access$1400(ActivityThread.java:134)
      at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1278)
      at android.os.Handler.dispatchMessage(Handler.java:99)
      at android.os.Looper.loop(Looper.java:137)
      at android.app.ActivityThread.main(ActivityThread.java:4867)
      at java.lang.reflect.Method.invokeNative(Native Method)
      at java.lang.reflect.Method.invoke(Method.java:511)
      at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1007)
      at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:774)
      at dalvik.system.NativeStart.main(Native Method)
   Caused by: java.lang.UnsatisfiedLinkError: Cannot load library: reloc_library[1306]:  1674 cannot locate '__isnanf'...

      at java.lang.Runtime.loadLibrary(Runtime.java:370)
      at java.lang.System.loadLibrary(System.java:535)
      at com.android.tools.profiler.support.ProfilerService.<clinit>(ProfilerService.java:41)
      at android.support.multidex.MultiDexApplication.<init>(MultiDexApplication.java:35) 
      at MY_APP_PATH.MY_CUSTOM_APPLICATION_CLASS.<init>(MY_CUSTOM_APPLICATION_CLASS.java:23) 
      at java.lang.Class.newInstanceImpl(Native Method) 
      at java.lang.Class.newInstance(Class.java:1319) 
      at android.app.Instrumentation.newApplication(Instrumentation.java:997) 
      at android.app.Instrumentation.newApplication(Instrumentation.java:982) 
      at android.app.LoadedApk.makeApplication(LoadedApk.java:496) 
      at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4170) 
      at android.app.ActivityThread.access$1400(ActivityThread.java:134) 
      at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1278) 
      at android.os.Handler.dispatchMessage(Handler.java:99) 
      at android.os.Looper.loop(Looper.java:137) 
      at android.app.ActivityThread.main(ActivityThread.java:4867) 
      at java.lang.reflect.Method.invokeNative(Native Method) 
      at java.lang.reflect.Method.invoke(Method.java:511) 
      at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1007) 
      at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:774) 
      at dalvik.system.NativeStart.main(Native Method) 

解决方法:

问题应该是关于在AS 3.0中启用“高级分析”功能,如果你这样做只是禁用它:

>转到“编辑配置…”,
>在“Android App”下选择您的应用配置,
>然后转到“分析”选项卡
>取消选中“启用高级分析”

问题应该消失了.

标签:android-studio-3-0,android,crash,android-multidex,multidex
来源: https://codeday.me/bug/20190828/1749649.html