3升级后通过Android

3升级后通过Android

本文介绍了从2.3升级后通过Android Studio 2.3.3安装apk的未知失败(UnsatisfiedLinkError)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

2天前我正在运行Android Studio 2.3,并且我的项目中的所有内容都运行良好.安装很好,没有警告,更不用说错误了.

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.

当我从2.3升级到2.3.3时,Android Studio建议使用gradle,平台工具和构建工具也要升级.我做了所有这些操作,现在尝试在同一设备上部署我的应用程序时,它失败了.

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.

**观察**我的实验室中有3台机器.其中两个正在运行2.2.2,并且在设备上安装该应用程序没有任何问题.

** 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.

有问题的机器在Android Studio 2.3版上还可以. 2.3.3加上gradle和插件更新似乎是问题的一部分.

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.

在2.2.2机器上,apk是单独安装的(工作中)

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

$ adb shell pm install -r "/data/local/tmp/com.domain.sub" pkg: /data/local/tmp/com.domain.sub

在2.3.3机器上(不工作)

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

$ adb install-multiple -r "...dependencies.apk, ...slice_0.apk, ...slice_1.apk, ... slice_9.apk, ...app-debug.apk

尝试安装(2.3.3)时引发的异常:

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)

推荐答案

在尝试了不同的建议之后,对我来说可行的解决方案是在Android Studio中禁用即时运行".

After a lot of attempts at different suggestions the working solution for me was to disable "Instant Run" in Android Studio.

  • 在Android Studio中打开设置.
  • 导航到构建,执行,部署>即时运行.
  • 取消选中代码更改后重新启动活动旁边的框.

然后我清理并重建了应用程序,并成功安装了apk.

Then I cleaned and rebuilt the application and the apk installed successfully.

这篇关于从2.3升级后通过Android Studio 2.3.3安装apk的未知失败(UnsatisfiedLinkError)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-03 11:54