50

I'm getting the following error immediately on launch, but only for devices running API <20.

**edit: I initially reported this in Android Studio 2.4, and it's still an issue in Android Studio 3.0 stable

D/dalvikvm: Trying to load lib /mnt/asec/[[packagename]]-1/lib/libsupportjni.so 0x41b13f30
E/dalvikvm: dlopen("/mnt/asec/[[packagename]]-1/lib/libsupportjni.so") failed: dlopen failed: cannot locate symbol "strtof" referenced by "libsupportjni.so"...
W/dalvikvm: Exception Ljava/lang/UnsatisfiedLinkError; thrown while initializing Lcom/android/tools/profiler/support/ProfilerService;
D/AndroidRuntime: Shutting down VM
W/dalvikvm: threadid=1: thread exiting with uncaught exception (group=0x41659ce0)
E/AndroidRuntime: FATAL EXCEPTION: main
              Process: [[packagename]], PID: 7500
              java.lang.UnsatisfiedLinkError: dlopen failed: cannot locate symbol "strtof" referenced by "libsupportjni.so"...
                  at java.lang.Runtime.loadLibrary(Runtime.java:364)
                  at java.lang.System.loadLibrary(System.java:526)
                  at com.android.tools.profiler.support.ProfilerService.<clinit>(ProfilerService.java:44)
                  at [[packagename]].App.<init>(App.kt:25)
                  at java.lang.Class.newInstanceImpl(Native Method)
                  at java.lang.Class.newInstance(Class.java:1208)
                  at android.app.Instrumentation.newApplication(Instrumentation.java:990)
                  at android.app.Instrumentation.newApplication(Instrumentation.java:975)
                  at android.app.LoadedApk.makeApplication(LoadedApk.java:509)
                  at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4446)
                  at android.app.ActivityThread.access$1500(ActivityThread.java:144)
                  at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1265)
                  at android.os.Handler.dispatchMessage(Handler.java:102)
                  at android.os.Looper.loop(Looper.java:136)
                  at android.app.ActivityThread.main(ActivityThread.java:5146)
                  at java.lang.reflect.Method.invokeNative(Native Method)
                  at java.lang.reflect.Method.invoke(Method.java:515)
                  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:732)
                  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:566)
                  at dalvik.system.NativeStart.main(Native Method)
Jim Pekarek
  • 7,270
  • 6
  • 33
  • 34

1 Answers1

168

Go to Run -> Edit Configurations -> Profiling, and disable "Enable advanced profiling". This feature is not currently compatible with API <20, and will cause this or similar crashes. This may be fixed in the future, but as of Android Studio 2.4 preview 7, it's an open issue. Related issue

Jim Pekarek
  • 7,270
  • 6
  • 33
  • 34
  • 5
    This also works for dlopen failed: cannot locate symbol "__aeabi_memclr4" referenced by "/data/app/**/libsupportjni.so" which i got on API 23 with Android Studio 3.0 canary 6 – Someone Jul 13 '17 at 11:30
  • 2
    @Alex I had the same issue and have reported this issue to the Android Studio team: https://issuetracker.google.com/issues/63756889 – Peter Keefe Jul 17 '17 at 16:05
  • 2
    Also in Android Studio 3.0 canary 7: UnsatisfiedLinkError ... __aeabi_memclr4 ... libsupportjni.so on Nexus5 (android version 6.0.1) – Sviatoslav Jul 24 '17 at 15:02
  • 5
    It's still happening in AS 3.0 beta 2 – cesards Aug 18 '17 at 11:24
  • 2
    I'm very frustrated at Google right now. I've been chasing this all day thinking it was a JNI issue (which I don't use). Why not put a damn warning on the option? – Oded Sep 05 '17 at 21:55
  • 9
    why they don't automatically bypass it for older versions devices, such behavior of studio is so annoying – user924 Sep 16 '17 at 17:55
  • 10
    This is happening in AS 3.0 stable, brrrrrr. Google, as usual ( – Goltsev Eugene Oct 30 '17 at 14:13
  • @GoltsevEugene It's disabled for me on AS 3 as default, but I still get that error. – Dr.jacky Nov 19 '17 at 09:41
  • Nice one! This is replicating in AS 3.0 stable as well – Vishal Sharma Nov 23 '17 at 04:16
  • I had a similar problem, but the app compiled and built an APK, but crashed when you tried running it. Turning off the advanced profiling fixed it immediately. The problem was it was putting in a copy of libsupportjni.so in the apk for abis that my project didn't support, so on a device that preferred an unsupported abi it would be unable to find any of the other so files it needed. This was in Android Studio 3.1.2, so it still isn't fixed. My error message was java.lang.UnsatisfiedLinkError: dalvik.system.PathClassLoader – Andy Krouwel May 09 '18 at 16:16