问题
I was running Android Studio 2.3 2 days ago and everything with my project was working perfectly. Installs were fine and there no warnings let alone errors.
When I did the upgrade from 2.3 to 2.3.3 Android Studio recommended the gradle, platform tools and build tools upgrade also. I did all of them and now when trying to deploy my app on the same device, it fails.
** observations ** I have 3 machines in my lab. Two of them are running 2.2.2 and have no issues still installing the app on the devices.
The machine that has problems was okay on version 2.3 of Android Studio. 2.3.3 plus the gradle and plugin updates seem to be the/part of the problem.
On the 2.2.2 machines, the apk is installed individually (WORKING)
$ adb shell pm install -r "/data/local/tmp/com.domain.sub" pkg: /data/local/tmp/com.domain.sub
on the 2.3.3 machine (NOT WORKING)
$ adb install-multiple -r "...dependencies.apk, ...slice_0.apk, ...slice_1.apk, ... slice_9.apk, ...app-debug.apk
The exception that is thrown when the install is attempted (2.3.3):
Error while uploading slice_2.apk : java.lang.UnsatisfiedLinkError: No implementation found for java.lang.String android.os.SystemProperties.native_get(java.lang.String) (tried Java_android_os_SystemProperties_native_1get and Java_android_os_SystemProperties_native_1get__Ljava_lang_String_2)
at android.os.SystemProperties.native_get(Native Method)
at android.os.SystemProperties.get(SystemProperties.java:52)
at android.os.Environment.getCanonicalPathOrNull(Environment.java:834)
at android.os.Environment.<clinit>(Environment.java:83)
at android.os.Environment.getLegacyExternalStorageDirectory(Environment.java:421)
at android.os.Debug.<clinit>(Debug.java:101)
at android.ddm.DdmHandleHello.handleHELO(DdmHandleHello.java:164)
at android.ddm.DdmHandleHello.handleChunk(DdmHandleHello.java:91)
at org.apache.harmony.dalvik.ddmc.DdmServer.dispatch(DdmServer.java:171)
java.lang.UnsatisfiedLinkError: android.os.Debug
at android.ddm.DdmHandleHello.handleFEAT(DdmHandleHello.java:176)
at android.ddm.... (show balloon)
回答1:
After a lot of attempts at different suggestions the working solution for me was to disable "Instant Run" in Android Studio.
- Open the Settings In Android Studio.
- Navigate to Build, Execution, Deployment > Instant Run.
- Uncheck the box next to Restart activity on code changes.
Then I cleaned and rebuilt the application and the apk installed successfully.
回答2:
For Android Studio 3.5+, there is no more "Instant Run" option, you should disable the "Apply changes" options instead:
来源:https://stackoverflow.com/questions/42585053/unknown-failure-unsatisfiedlinkerror-installing-apk-via-android-studio-2-3-3-a