49

I am using Android Studio to develop my apps.

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:

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:

Project's settings

This technique used to work perfectly before upgrading and I have not change anything since that time.

Florent06
  • 1,008
  • 2
  • 10
  • 29
  • Does your device still have debugging via USB enabled, and all that? – stkent Feb 07 '15 at 19:46
  • Yes it does have all that – Florent06 Feb 07 '15 at 19:49
  • Do you have any third-party launcher on device? – Timur Gilfanov Feb 08 '15 at 14:09
  • I submitted a bug here: http://code.google.com/p/android/issues/detail?id=158248. I'm going to try and respond to the questions asked before too long, but anyone else chiming in couldn't hurt. Thanks in advance! – codebaum Mar 04 '15 at 15:23
  • I have the same problem with my HTC One M8, but it appears to be totally random. Sometimes an app will run first try without any problems, other times I have to do a bunch of hocus pocus (shut down Android Studio, unplug / replug phone, uninstall existing app installation...). I've had this issue on both Windows and Mac. – Charles Madere Mar 20 '15 at 17:09
  • I'm experiencing this with the One M8 on OS X. It's very frustrating because when I use Genymotion I have no issues. This wasn't happening on 4.4.4. I only noticed it after upgrading to Lollipop. Still haven't found a proper fix as of yet. – Osborne Cox May 19 '15 at 04:03
  • 1
    I just want to confirm that this bug is apparently gone after update to Android 6 on my HTC One M8 (software number 6.12.709.4). – Speedy Jan 05 '16 at 16:58
  • The HTC software update to `v7.19.61.51` (HTC SDK 6.55, Android 5.0.2) was recently rolled out to my **HTC One** and this seems to have also resolved the issue. Since the update, I have had no further occurrences of the issue. – aoemerson Jan 06 '16 at 03:01

11 Answers11

43

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

Diceyus
  • 769
  • 9
  • 13
34

Workaround: disable ADB integration in Android Studio.

Tools > Android > uncheck Enable ADB integration

Jozka Jozin
  • 2,350
  • 1
  • 16
  • 12
  • Wow. Helped with my Asus Zenfone 2 550. Thanks. – moonsweel Aug 16 '15 at 17:11
  • 2
    This will completely disable in-IDE debugging. – Ionoclast Brigham Sep 05 '15 at 01:56
  • 2
    solved but there is a new problem which is i can't debug my app. – Mr.Ghamkhar Oct 05 '15 at 08:18
  • Worked for Asus Zenfone 5 T00F. – Anggrayudi H Oct 09 '15 at 14:30
  • 2
    in-IDE debug, i founded 'Attach debugger to Android process' under Run menu work for me. In summary, when you need to run then uncheck Enable ADB integration as described above. When you need to debug the app then (during the app running by disable ADB), then Run/Attach debugger ..., (it will warn to run the ADB so please make it run) select the process of your app then set breakpoints in your IDE. The debug will work as usual. – Supawat Pusavanno Nov 27 '15 at 08:24
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.

Jason Goff
  • 121
  • 2
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.

Timur Gilfanov
  • 686
  • 4
  • 12
  • I'm using Google Now as my launcher and get the same issue. I think when I'm on the home it lets me launch fine but not in other apps? – kassim Feb 22 '15 at 21:42
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.

kb10uy
  • 21
  • 4
1

I discovered a "workaround" to solve this problem

Find the HTC Blink Home Launcher and uninstall the update

(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)

benleung
  • 871
  • 4
  • 12
  • 25
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.

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

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.

I used Clean Master cause is stock with Zenfone 2, but i suspect every memory manager can do that. Give it a try

Andrea
  • 11
  • 1
1

On my HTC M8, I resolved the issue by disabling "Settings -> Developer options -> Use 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.

Hope this helps....

Ripal Barot
  • 687
  • 8
  • 16
1

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.

Spazmodiar
  • 31
  • 3
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:

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

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.

aoemerson
  • 147
  • 9
-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!

About how to set the path and environment variables in Windows >> here