I am using Android Studio to develop my apps.
我正在使用Android Studio开发我的应用程序。
Since I upgraded my HTC One M8 to Lollipop, I can not use it to test my apps by "Run app" in Android Studio. I get this error and nothing happens on my phone:
因为我把HTC One M8升级到棒棒糖,所以我无法在Android Studio中使用“Run app”来测试我的应用。我得到这个错误,我的手机什么也没发生:
Launching application: com.project.GalleryActivity.
DEVICE SHELL COMMAND: am start -n "com.project.GalleryActivity" -a android.intent.action.MAIN -c android.intent.category.LAUNCHER
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)
at com.htc.customization.HtcCustomizationManager.<init>(HtcCustomizationManager.java)
at com.htc.customization.HtcCustomizationManager.<clinit>(HtcCustomizationManager.java)
at android.os.Environment$UserEnvironment.getCustomizationReader(Environment.java)
at android.os.Environment$UserEnvironment.isDynamicSwitchSupported(Environment.java)
at android.os.Environment$UserEnvironment.<init>(Environment.java)
at android.os.Environment.initForCurrentUser(Environment.java)
at android.os.Environment.<clinit>(Environment.java)
at android.os.Environment.getLegacyExternalStorageDirectory(Environment.java)
at android.os.Debug.<clinit>(Debug.java)
at android.ddm.DdmHandleHello.handleHELO(DdmHandleHello.java)
at android.ddm.DdmHandleHello.handleChunk(DdmHandleHello.java)
at org.apache.harmony.dalvik.ddmc.DdmServer.dispatch(DdmServer.java)
java.lang.UnsatisfiedLinkError: android.os.Debug
at android.ddm.DdmHandleHello.handleFEAT(DdmHandleHello.java)
at android.ddm.DdmHandleHello.handleChunk(DdmHandleHello.java)
at org.apache.harmony.dalvik.ddmc.DdmServer.dispatch(DdmServer.java)
java.lang.UnsatisfiedLinkError: android.os.Debug
at android.ddm.DdmHandleProfiling.handleMPRQ(DdmHandleProfiling.java)
at android.ddm.DdmHandleProfiling.handleChunk(DdmHandleProfiling.java)
at org.apache.harmony.dalvik.ddmc.DdmServer.dispatch(DdmServer.java)
Aborted
My project's settings are these:
我的项目设置如下:
This technique used to work perfectly before upgrading and I have not change anything since that time.
这种技术在升级之前就能完美地工作,从那时起我就没有改变过任何东西。
11 个解决方案
#1
40
I was facing the same error on Asus Zenfone 5 (ASUS_T00J) with Android 5.0. For me the solution was to switch off the "Verify Apps over USB" in the "Developer Options". Launcher may not be the issue since I tried with Google Now Launcher as well without success. It was working fine on my Nexus 5 with Android 5.1
我在Asus Zenfone 5 (ASUS_T00J)上遇到了与Android 5.0相同的错误。对我来说,解决方案是在“开发者选项”中关掉“通过USB验证应用程序”。启动器可能不是问题,因为我尝试了谷歌现在启动器也没有成功。它在我的Nexus 5和Android 5.1上运行良好
#2
34
Workaround: disable ADB integration in Android Studio.
解决方案:在Android Studio中禁用ADB集成。
Tools > Android > uncheck Enable ADB integration
工具> Android > uncheck支持ADB集成
#3
9
I'm not sure what the underlying cause is, but I found I could successfully avoid this issue by closing down all running apps on the phone before trying to Run my code on my M8.
我不确定潜在的原因是什么,但我发现,在尝试在M8上运行代码之前,我可以关闭手机上所有正在运行的应用程序,从而成功地避免这个问题。
#4
5
Do you use any third-party launcher on device? I have same issue when use Aviate launcher. I switch back to BlinkFeed in Personalize->Main Screen settings and my deploy to device is stable now. Classpath com.htc.customization.HtcCustomizationManager
make me thing than this issue related to launcher.
你在设备上使用任何第三方启动程序吗?我在使用航空发射装置时也有同样的问题。我切换回BlinkFeed在Personalize->主屏幕设置和我的部署到设备是稳定的现在。类路径com.htc.customization。HtcCustomizationManager让我想起与启动程序相关的问题。
#5
2
I met the same problem on ASUS ME176C(Lollipop 5.0),
but I resolved it by setting "Select debug app" to "No". Then push apk as usual. After that, you can reselect "debug app" to target app.
我在ASUS ME176C(Lollipop 5.0)上遇到了同样的问题,但是我将“Select debug app”设置为“No”,从而解决了这个问题。然后像往常一样推apk。之后,你可以重新选择“debug app”来定位app。
#6
1
I discovered a "workaround" to solve this problem
我发现了一个解决这个问题的“变通办法”
Find the HTC Blink Home Launcher and uninstall the update
找到HTC Blink Home启动程序,卸载更新
(CAUTION:uninstall the launcher update will remove all icons and widgets placed on the launcher)
(注意:卸载启动程序更新将删除放置在启动程序上的所有图标和小部件)
This works for me and it can be used debugging now without removing the apps in multitask. This should be a bug caused by HTC? (I am using HTC Butterfly 2 & Android 5.0.2)
这对我来说是可行的,现在可以在不删除multitask中的应用程序的情况下使用它进行调试。这应该是由HTC引起的bug吗?(我使用的是HTC Butterfly 2 & Android 5.0.2)
#7
1
I don't have the rep for commenting but i was in the same situation of @user47625 but my "Verify Apps over USB" was already off. I've tried to enlarge a bit this answer with some reasoning.
我没有评论的权限,但是我和@user47625一样,但是我的“USB验证应用”已经关闭了。
At first I've tried to change the launcher and I got some luck but was hit and miss, not a proper solution. Rebooting the phone granted a couple of hours of calm work.
一开始我试着改变发射装置,我运气不错,但是被击中了又错过了,这不是一个合适的解决方案。重启手机可以让你平静地工作几个小时。
Then i've found someone on google that stated:
然后我发现谷歌上有人说:
If it is that bug: The DDMS client connects with a "Hello" when the PM process first starts and registers itself, but before it has fully initialized all the native code. It is a race in stock Android and occurs there too
如果是那个bug:当PM进程第一次启动并注册时,DDMS客户端会与一个“Hello”连接,但是在它完全初始化所有本机代码之前。这是一场Android股票竞赛,也在那里举行
So if this race occurs it doesn't occurs everytime, but every now and then, I suspect something regarding interaction of item on Android. I don't know if it's CPU, RAM or App related, but on my Zenfone 2 closing all background apps (1) and releasing the memory (2) does the trick, letting me able to debug the app properly.
所以如果这个竞赛发生了,它不会每次都发生,但是我时不时地怀疑Android上项目的互动。我不知道它是否与CPU、RAM或应用程序有关,但在我的Zenfone 2上,关闭所有后台应用程序(1)并释放内存(2)就可以了,让我能够正确地调试应用程序。
I used Clean Master cause is stock with Zenfone 2, but i suspect every memory manager can do that. Give it a try
我使用了清理大师,因为它是使用Zenfone 2的库存,但是我怀疑每个内存管理器都能做到。试一试
#8
1
On my HTC M8, I resolved the issue by disabling "Settings -> Developer options -> Use NuPlayer(experimental)"
在我的HTC M8上,我通过禁用“设置—>开发人员选项—>使用NuPlayer(experimental)”解决了这个问题。
What I have noticed is, when I try to run the application I created long back (few years ago), I have to disable the NuPlayer. However, with new applications, I must keep the option checked.
我注意到的是,当我试图运行我多年前创建的应用程序时(几年前),我必须禁用NuPlayer。但是,对于新的应用程序,我必须检查选项。
Hope this helps....
希望这有助于....
#9
0
I've had a reasonable amount of success with the workaround below.
我在下面的工作中取得了相当大的成功。
After each debugging session with your app, go to the Android Studio terminal:
每次调试完app后,进入Android Studio终端:
> adb shell am force-stop com.your.app.package
I still occasionally get the java.lang.UnsatisfiedLinkError
but only following the above command rather than in between the build/push apk/install process and attempting a debugging session.
我仍然偶尔会得到java.lang。UnsatisfiedLinkError,但只遵循上述命令,而不是在构建/push apk/安装过程和尝试调试会话之间。
To me, this saves a lot of wasted time building only to get the error. If the command above doesn't work, just up-arrow
and re-run the command until it works without an error.
对我来说,这节省了大量的时间,只是为了得到错误。如果上面的命令不起作用,只需向上箭头并重新运行该命令,直到它没有出错为止。
#10
0
On an Asus ZenPad, 5.0.2 I was able to solve the issue by going into Asus' Auto-start Manager (Settings -> Power management -> Auto-start Manager) and allowing my app to auto-start.
在Asus ZenPad上,5.0.2我可以通过Asus的自动启动管理器(设置->电源管理->自动启动管理器)来解决这个问题,并允许我的应用程序自动启动。
#11
-1
This solution worked for me, you may give it a try.
这个办法对我管用,你可以试试。
Add adb path to System Environment Variables (I'm using windows 8)
Ex: my path is "C:\Users\xxx\AppData\Local\Android\sdk\platform-tools"
Dont forget to reboot your system to take the effect!
添加adb路径到系统环境变量(我正在使用windows 8) Ex:我的路径是“C:\用户xxx\AppData\本地\Android sdk\本地\sdk\platform tools”不要忘记重新启动您的系统以发挥作用!
About how to set the path and environment variables in Windows >> here
关于如何在这里设置Windows >>中的路径和环境变量
#1
40
I was facing the same error on Asus Zenfone 5 (ASUS_T00J) with Android 5.0. For me the solution was to switch off the "Verify Apps over USB" in the "Developer Options". Launcher may not be the issue since I tried with Google Now Launcher as well without success. It was working fine on my Nexus 5 with Android 5.1
我在Asus Zenfone 5 (ASUS_T00J)上遇到了与Android 5.0相同的错误。对我来说,解决方案是在“开发者选项”中关掉“通过USB验证应用程序”。启动器可能不是问题,因为我尝试了谷歌现在启动器也没有成功。它在我的Nexus 5和Android 5.1上运行良好
#2
34
Workaround: disable ADB integration in Android Studio.
解决方案:在Android Studio中禁用ADB集成。
Tools > Android > uncheck Enable ADB integration
工具> Android > uncheck支持ADB集成
#3
9
I'm not sure what the underlying cause is, but I found I could successfully avoid this issue by closing down all running apps on the phone before trying to Run my code on my M8.
我不确定潜在的原因是什么,但我发现,在尝试在M8上运行代码之前,我可以关闭手机上所有正在运行的应用程序,从而成功地避免这个问题。
#4
5
Do you use any third-party launcher on device? I have same issue when use Aviate launcher. I switch back to BlinkFeed in Personalize->Main Screen settings and my deploy to device is stable now. Classpath com.htc.customization.HtcCustomizationManager
make me thing than this issue related to launcher.
你在设备上使用任何第三方启动程序吗?我在使用航空发射装置时也有同样的问题。我切换回BlinkFeed在Personalize->主屏幕设置和我的部署到设备是稳定的现在。类路径com.htc.customization。HtcCustomizationManager让我想起与启动程序相关的问题。
#5
2
I met the same problem on ASUS ME176C(Lollipop 5.0),
but I resolved it by setting "Select debug app" to "No". Then push apk as usual. After that, you can reselect "debug app" to target app.
我在ASUS ME176C(Lollipop 5.0)上遇到了同样的问题,但是我将“Select debug app”设置为“No”,从而解决了这个问题。然后像往常一样推apk。之后,你可以重新选择“debug app”来定位app。
#6
1
I discovered a "workaround" to solve this problem
我发现了一个解决这个问题的“变通办法”
Find the HTC Blink Home Launcher and uninstall the update
找到HTC Blink Home启动程序,卸载更新
(CAUTION:uninstall the launcher update will remove all icons and widgets placed on the launcher)
(注意:卸载启动程序更新将删除放置在启动程序上的所有图标和小部件)
This works for me and it can be used debugging now without removing the apps in multitask. This should be a bug caused by HTC? (I am using HTC Butterfly 2 & Android 5.0.2)
这对我来说是可行的,现在可以在不删除multitask中的应用程序的情况下使用它进行调试。这应该是由HTC引起的bug吗?(我使用的是HTC Butterfly 2 & Android 5.0.2)
#7
1
I don't have the rep for commenting but i was in the same situation of @user47625 but my "Verify Apps over USB" was already off. I've tried to enlarge a bit this answer with some reasoning.
我没有评论的权限,但是我和@user47625一样,但是我的“USB验证应用”已经关闭了。
At first I've tried to change the launcher and I got some luck but was hit and miss, not a proper solution. Rebooting the phone granted a couple of hours of calm work.
一开始我试着改变发射装置,我运气不错,但是被击中了又错过了,这不是一个合适的解决方案。重启手机可以让你平静地工作几个小时。
Then i've found someone on google that stated:
然后我发现谷歌上有人说:
If it is that bug: The DDMS client connects with a "Hello" when the PM process first starts and registers itself, but before it has fully initialized all the native code. It is a race in stock Android and occurs there too
如果是那个bug:当PM进程第一次启动并注册时,DDMS客户端会与一个“Hello”连接,但是在它完全初始化所有本机代码之前。这是一场Android股票竞赛,也在那里举行
So if this race occurs it doesn't occurs everytime, but every now and then, I suspect something regarding interaction of item on Android. I don't know if it's CPU, RAM or App related, but on my Zenfone 2 closing all background apps (1) and releasing the memory (2) does the trick, letting me able to debug the app properly.
所以如果这个竞赛发生了,它不会每次都发生,但是我时不时地怀疑Android上项目的互动。我不知道它是否与CPU、RAM或应用程序有关,但在我的Zenfone 2上,关闭所有后台应用程序(1)并释放内存(2)就可以了,让我能够正确地调试应用程序。
I used Clean Master cause is stock with Zenfone 2, but i suspect every memory manager can do that. Give it a try
我使用了清理大师,因为它是使用Zenfone 2的库存,但是我怀疑每个内存管理器都能做到。试一试
#8
1
On my HTC M8, I resolved the issue by disabling "Settings -> Developer options -> Use NuPlayer(experimental)"
在我的HTC M8上,我通过禁用“设置—>开发人员选项—>使用NuPlayer(experimental)”解决了这个问题。
What I have noticed is, when I try to run the application I created long back (few years ago), I have to disable the NuPlayer. However, with new applications, I must keep the option checked.
我注意到的是,当我试图运行我多年前创建的应用程序时(几年前),我必须禁用NuPlayer。但是,对于新的应用程序,我必须检查选项。
Hope this helps....
希望这有助于....
#9
0
I've had a reasonable amount of success with the workaround below.
我在下面的工作中取得了相当大的成功。
After each debugging session with your app, go to the Android Studio terminal:
每次调试完app后,进入Android Studio终端:
> adb shell am force-stop com.your.app.package
I still occasionally get the java.lang.UnsatisfiedLinkError
but only following the above command rather than in between the build/push apk/install process and attempting a debugging session.
我仍然偶尔会得到java.lang。UnsatisfiedLinkError,但只遵循上述命令,而不是在构建/push apk/安装过程和尝试调试会话之间。
To me, this saves a lot of wasted time building only to get the error. If the command above doesn't work, just up-arrow
and re-run the command until it works without an error.
对我来说,这节省了大量的时间,只是为了得到错误。如果上面的命令不起作用,只需向上箭头并重新运行该命令,直到它没有出错为止。
#10
0
On an Asus ZenPad, 5.0.2 I was able to solve the issue by going into Asus' Auto-start Manager (Settings -> Power management -> Auto-start Manager) and allowing my app to auto-start.
在Asus ZenPad上,5.0.2我可以通过Asus的自动启动管理器(设置->电源管理->自动启动管理器)来解决这个问题,并允许我的应用程序自动启动。
#11
-1
This solution worked for me, you may give it a try.
这个办法对我管用,你可以试试。
Add adb path to System Environment Variables (I'm using windows 8)
Ex: my path is "C:\Users\xxx\AppData\Local\Android\sdk\platform-tools"
Dont forget to reboot your system to take the effect!
添加adb路径到系统环境变量(我正在使用windows 8) Ex:我的路径是“C:\用户xxx\AppData\本地\Android sdk\本地\sdk\platform tools”不要忘记重新启动您的系统以发挥作用!
About how to set the path and environment variables in Windows >> here
关于如何在这里设置Windows >>中的路径和环境变量