Unable to test app after upgrading to Lollipop

前端 未结 11 712
执笔经年
执笔经年 2020-12-13 12:11

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

相关标签:
11条回答
  • 2020-12-13 13:14

    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

    0 讨论(0)
  • 2020-12-13 13:15

    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.

    0 讨论(0)
  • 2020-12-13 13:17

    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

    0 讨论(0)
  • 2020-12-13 13:17

    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)

    0 讨论(0)
  • 2020-12-13 13:17

    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.

    0 讨论(0)
提交回复
热议问题