I’ve recently upgraded one of my Android devices to Android Lollipop (5.0) and now I can’t debug my application and even install apk on the device using adb. I receive the following error
java.lang.UnsatisfiedLinkError: No implementation found for java.lang.String android.os.SystemProperties.native_get(java.lang.St
ring, java.lang.String) (tried Java_android_os_SystemProperties_native_1get and Java_android_os_SystemProperties_native_1get__Lj
ava_lang_String_2Ljava_lang_String_2)
at android.os.SystemProperties.native_get(Native Method)
at android.os.SystemProperties.get(SystemProperties.java:64)
at android.os.Environment.<clinit>(Environment.java:354)
at android.os.Environment.getLegacyExternalStorageDirectory(Environment.java:488)
at android.os.Debug.<clinit>(Debug.java:96)
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.DdmHandleHello.handleChunk(DdmHandleHello.java:93)
at org.apache.harmony.dalvik.ddmc.DdmServer.dispatch(DdmServer.java:171)
java.lang.UnsatisfiedLinkError: android.os.Debug
at android.ddm.DdmHandleProfiling.handleMPRQ(DdmHandleProfiling.java:187)
at android.ddm.DdmHandleProfiling.handleChunk(DdmHandleProfiling.java:88)
at org.apache.harmony.dalvik.ddmc.DdmServer.dispatch(DdmServer.java:171)
My device is Asus FonePad 7 ME175CG or K00Z
Kernel version
3.10.20-i386_cpt
android#mec9#1
Mon Apr 20 13:30:08 CST 2015
Is there any solution for this problem?
UPDATED
first of all thanks to those guys who pay attention to this very specific question, really thanks
for further clarification,
When I received this error, I googled the entire universe for the phrase java.lang.UnsatisfiedLinkError and gave a try to any solutions that seemed to be applicable, as well as, the solution that suggested by #Kushal and others. Most of the questions were (and still are) for HTC M8 and devices other than ASUS. If you visit this post, you may see an answer by me which is deleted by SO guards and I admit it that it was not really an answer and I post the answer while I was really disappointed of resolving the issue.
Anyway, what I've done up to now which may be helpful for others are,
First, I upgraded my Android SDK tools to the latest version 24.2. After that when I tried adb install demo.apk, in some cases it was successful and sometimes not. I killed all running apps on the device (as suggested by some guys) but it sometimes works and sometimes not.
Then, I gave a try to other solution, specifically the one that suggested by this post. In fact, when I try to debug the app using Intellij IDEA, the IDE itself does as the suggested procedure and the result is
You can see that the IDE itself does as the procedure by #Kushal suggests.
After that, I found several records (referring a few as) here and here and in latter someone has said that
This was a bug in some HTC devices that was fixed with L-MR1
Therefore I came up with the idea that there may be a fix by ASUS team which you guys know about it and kindly provide me with that.
Thanks
Disabling Tools -> Android -> Enable ADB Integration solved my issue.
Running on Asus Zenfone 2.
I don't know why this issue appears but you can successfully avoid this issue by closing all the running applications on your device.
Also Unable to test app after upgrading to Lollipop
This error message is due to release binary problem by manufecturer (Asus in this case). This error will not appear in Google Nexus and Samsung Galaxy due to their handling in binary
Solution :
After searching about above problem, the below solution is found on other Stack Overflow question :
Using terminal, just reinstall with adb to avoid the Android Studio recompile time:
$terminal: /sdk/platform-tools/adb install -r
And usually it works. If it fails again, just run this command again
If you really want to try it, the process would be:
Close Studio (or try disabling Tools | Android | Enable ADB Integration)
Do the following on a shell:
$ adb push /path/to/your/project/app/build/outputs/apk/app-debug.apk /data
$ adb shell pm install /data/app-debug.apk
$ (am start command from comment #4/#5)
Restart IDE (or Re-enable ADB Integration).
This solution is suggested by Google group for alternate fix to above problem Here
Reference Answer : Here
This way you will able to re-install apk and above error will not come
I found a solution though I am not sure if others are willing to use it as it may harm the device and causes it to get useless
In fact, as the answers that the question has received just sound to be copy and paste of other questions’ answers and are not applicable in my case I disappointingly tried to make a radical move and flash my device to downgrade its software to Android 4.2.2 but chancy I decided to flash my device to Android Lollipop again to see if it removes the issue and fluky it did (at least in my case)!
IMPORTANT NOTE!
Before following this procedure, consider the fact that your device may get broken and you lose all data you have on your device. So please make a backup copy before you proceed.
I searched a lot and found methods that are partially described here and here but finally I followed this procedure:
Download the correct update file from here (ASUS support or FonePad Support) according to the type of your device (ww, tw or others). Mine is ww and downloaded ASUS Fonepad 7 (ME175CG) Software Image Version: WW_V6.3.7 For WW.
Then change the downloaded file to ASUS_BUNDEL.ZIP
Then copy that file in to root internal memory
Putting the device into recovery mode (by holding volume up and
power key down simultaneously)
Choose SD Download
The device starts to flash and after finishing it you have a brand new device and the issue is completely removed.
Now I can install apk using adb command and debugging my application as I did before and I have not seen the nasty error anymore.
I'll open this answer to receive others feedback then I mark it as the real answer.
I hope this help others resolve the issue.
I had the same issue with Asus MemoPad ME70CX and solved by restarting ADB server using command line. Also you may need to kill BlueStacks processes running in background using TaskManager.
Related
on android 6.0.1 I am getting this error when trying to use run-as.
⋊> ~ adb shell 14:29:01
shell#trlte:/ $ run-as org.ligi.passandroid
run-as: Could not set capabilities: Operation not permitted
I really like the run-as command - is there a way to get it to work on 6.0.1 ?
If you have a SAMSUNG device, don't bother - SAMSUNG broke run-as by dropping the setuid flag (so run-as has no chance of switching to a different identity).
Also don't bother trying the Smart Switch "reinitialize device" workaround, it won't work until SAMSUNG fixes it in the firmware (so it is worth updating to the latest version).
Use some other method to access your app's data, like adb backup:
adb backup -f data.ab <my.package>
dd if=data.ab bs=24 skip=1 | openssl zlib -d > data.tar
Instead of dd you can use the abe tool, which can also write .ab files.
For me, it went like this. I am using Samsung s6 API 24. The error list log's detail was the same as mentioned in the question. But when I checked the Build Logs I found the solution written there. To set the MSBuild. So I followed the following steps to resolve this and the app ran successfully.
To correct this problem I had to
Unload Android Project from solution explorer
Right-Click unloaded project and "Edit Project File"
Searched code for "EmbedAssembliesIntoApk"
Found the occurrence in the project file
<EmbedAssembliesIntoApk>false</EmbedAssembliesIntoApk>
Change it to true and reload the project.
<EmbedAssembliesIntoApk>true</EmbedAssembliesIntoApk>
Ran the app and the app starts running on Samsung s6
The solution for me was the parameter -autolaunch in the Debugger configuration of the project in the field Parameters.
I use Delphi 10.2 with S7 Edge Android 7
Unlike another answer here, I have also tried to use smart switch & hard device resetting, but unfortunately that approach did not work for me (Wasted extra one hour just to try out that approach). Besides not working, it might create additional problem "samsung account: session expired" - problem, which can be fixed only if you have root access to your device.
I by myself have used instructions from here:
https://www.youtube.com/watch?v=Sy4FWLHxGYs
and then from here:
https://www.tomsguide.com/us/samsung-galaxy-s6-guide,review-2856-3.html
for getting root access to your device, and after that run-as can be executed with additional command "su -c" as for get root user. So whole command will look like this:
su -c run-as org.ligi.passandroid
WARNING: Gaining root access to your device will most probably void your device warranty if you have any left.
Additionally to this, I wanted to be able to debug my application inside Samsung Galaxy S6, so I've altered Visual studio components, more instructions can be found here:
https://issuetracker.google.com/issues/37093233#comment53
If you happen to have Samsung based android device - I have already reported that bug to Samsung, but I've could not get any time schedule if when and if at all they are going to fix this issue. If you own some other Android device - makes sense to report this problem to manufacturer.
I was working from Delphi 10.1 berlin.
I was presented with the same problem and my solution was to configure the sdk to the previous version.
I was using Android SDK 25.2.5.32bit and downgraded to android SDK 24.3.3 32 bit. To configure:
Tools->Environment Options -> SDK Manager
Then, add the necessary sdk, in this case android SDK 24.3.3 32 bit.
#RustyX answer helped my partially. zlib didn't work in my Mac. So I had to use the Android Backup Extractor to convert .ab file to .tar file. You can download it here.
For the full step by step instruction, refer here.
In Visual Studio, App properties, Android Options, changing the debugger from C++ to .Net(Xamarin) seems to have fixed the problem for a mixed C++/C# app.
Also got this error today when I tried to deploy/debug my application on a Samsung Xcover 3 running Android 6.
I solved it by changing the project property "Android Options / Use Fast Deployment" to false.
Here is solution for MS Visual Studio 2022.
https://www.youtube.com/watch?v=_r9GLm0k55o
Just uncheck the "Use Fast Deployment".
I had previously posted an answer here which was deleted, maybe because it was a link to another stackoverflow question referring to the answer I gave there, instead of containing the full answer.
Reposting its contents here from https://stackoverflow.com/a/43242739/7823460:
I had a very similar issue on Samsung Galaxy S6 Edge, trying to start debugging on VS2015, I got a different error, much less verbose than in the attached screenshot:
run-as: Could not set capabilities: Operation not permitted
Based on the contents of the attached screenshot above, I tried 'initializing' / factory resetting the device using Samsung's Smart Switch and it actually fixed the 'run-as' issue I was having.
This is the only solution which worked and didn't involve rooting the device, so I believe it must be publicly available. Of course people attempting this should keep in mind that factory reset means that data will be lost, unless it's backed up. The same Samsung software helps with backing up your data.
i'm currently reading through head first python and upon reaching chapter 8 I got stuck. The book wants me to download SL4A from the link http://code.google.com/p.android-scripting however that link no longer works. So I did some searching and found the file on github. My real problem is when I try to download it on the emulated device it just says waiting for data connection and it never downloads. I am wondering if there is a way to fix this. Any help is appreciated thanks!
EDIT: to get it to work I downloaded both files from here https://github.com/kuri65536/python-for-android/blob/master/README.md
then I copied the files to the folder
C:\Users\lucas\android-sdks\platform-tools
then I opened CMD and cd to the path above.
then use the command:
adb install (filepath)
for both files and they appeared on the emulated device.
Download to your pc and push through ADB.
Download files and adb install worked for me in my installation (Windows 10, android studio 2.1.1) with minor differences:
1) adb command is located in:
C:\Users\MyUser\AppData\Local\Android\Mysdk\platform-tools
Need to add to path
2) Needed release sl4a-r6.1.1-x86-debug.apk. Downloaded it from release pages
I'm also reading through HeadFirstPython and got stuck at this stage (with the error: app not installed). I tried the abs method above and ended up with yet another problem: install_failed_no_matching_abis. After a lot of research, I got to understand that the "native libraries" of the sl4a.apk were not matching the system architecture of my emulated android. In other words, if one wants a faster emulator in android studio, he ought to use an x86 architecture android; but the problem with that is scripting layer for android is programmed to work on ARM architectures hence the 'install_failed_no_matching_abis' error.
The solution that worked for me was to go back to AVD in Android Studio, delete the downloaded emulator (which was of x80 cpu/abi) and download one with armeabiv7 cpu, recommended level=24. It took a lot of trial and error to get to this choice as other android cpu/abi were either too slow or just wouldn't allow me to install the required apps.
Edited: In the end, I was directed to use GenyMotion as that performed better in terms of speed. I was reluctant at first but, to my surprise that really is the case (It is super faster than ARM android studio alternative). Not only is it a great emulator, it also has this ARM translation tools that allows one to easily install ARM sl4a.apk on the x86 devices.
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:
This technique used to work perfectly before upgrading and I have not change anything since that time.
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
Workaround: disable ADB integration in Android Studio.
Tools > Android > uncheck Enable ADB integration
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.
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.
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.
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)
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
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....
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.
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.
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
I just ordered a Nexus 9 and will be using it to program. Has anyone tried to run Terminal IDE on Nexus 9 or any other devices using Android 5.0 Lollipop?
The "links" browser included with Terminal IDE ran fine on my Nexus 5 under KitKat, but it crashes with the PIE error mentioned under Lollipop. Other than that, Terminal IDE has performed flawlessly for me, for about a year now. Sorry--forgot to add: Terminal IDE under Lollipop is "stopped" if started with the Android keyboard, or Android keyboard option is toggled. It will resume running if the Terminal IDE keyboard option is toggled.
7175 recompiled all the Terminal IDE binaries statically, so they don't give the PIE error on Android 5+. http://forum.xda-developers.com/showpost.php?p=57292384&postcount=68 (dec 2014)
7175 recommends downloading the apk from the following dropbox, then unzipping (an apk is a zip) and copying across just the binaries you need (instead of sideloading the whole apk).
https://www.dropbox.com/s/h2d23ecbrt2akeu/terminalide-2.02-binary-mod-signed.apk?dl=0
I downloaded this, and its vim worked on my old 4.2.2 Android phone - but I haven't actually tried it on an Android 5+ phone! (I don't have one; I'm researching my upgrade path).
At lease one stackoverflow user uses it: Rejecting re-init on previously failed class error when loading a Class with dalvikvm
A question within an answer: Anyone know how to confirm these binaries are safe? Especially ssh - downloading a "secure" shell binary from an anonymous user defeats the purpose!
The background of the post seems 100% legit, and has 467 "thanks" (wait, that's for all 7175's posts; this particular one only got 2 "thanks"...) - presumably people who downloaded it, and found no problem. But the site seems dodgey (http://forum.xda-developers.com), with lots of ads and security warnings. Maybe they are recent, after these older posts, and xda used to be good?
Terminal IDE appeals to people who don't want to root their phones - who probably don't want to sideload apps, or download anonymous binaries off the internet. I think the Play store does some rudimentary verification, and the more people who use it, the more likely problems are found. So it would be reassuring if spartacusrex could release this on the Play store as an upgrade - or, 7175 release a new fork.... or someone else release one. Forking is one of the strengths of open source!
BTW: I feel really bad doubting 7175's kind and great work, but sadly, security is a real issue. :(
No, but termux seems like a good Terminal IDE replacement for Lollipop - and under active development. Has vim, ssh, git, gcc etc and a version of apt-get.
[It only works in Android 5+, so I haven't tried it yet myself.]
Edit: It looks like it's not working on all new devices, maybe a target SDK version incompatibility? Terminal IDE should work at least on some other devices since it uses statically compiled binaries to run different parts of it. Statically compiled binaries are PIE(position independent executable) safe which is a requirement in lollipop. I've been running it on a lollipop build with my Galaxy Nexus no problem.
EDIT2: Also there are a few binaries that are dynamically linked and are not PIE, so those won't work.
You have lot of options now:
* Termux
* GnuRoot apps
* UserLAnd
* KBox
Of course, it should be possible to build a great filesystem yourself with fakechroot, fakeroot or proot. Or a non-root package manager.
I remember seeing a project named like 'Gentoo prefix for Android non-root' on Sourceforge. I don't know if it is still at alpha stage...
I use the latest adt-bundle-windows-x86_64-20130717, with
Android SDK Tools - 22.0.4
Android SDK Platform-tools - 18
I had tried to install app on emulator 2.3.3, both for ARM and Intel. However, it no longer work (It used to work in my same Win64 machine before I'm using latest adt)
Installation error: INSTALL_FAILED_DEXOPT
Please check logcat output for more details.
Launch canceled!
My emulator setting is as follow.
I had followed how to solve INSTALL_FAILED_DEXOPT this error?. It doesn't help for my case.
Note that, emulator with 4.1.2 work extremely well for Intel. I even try to email the APK, and download -> install from emulator. But, this is what I'm getting Application not installed
Any workaround to overcome this problem?
My logcat is having such logging
E/PackageManager(855): Package org.yccheok.jstock.gui has mismatched uid: 10031 on disk, 10033 in settings
E/dalvikvm(1241): LinearAlloc exceeded capacity (5242880), last=468
E/dalvikvm(1241): VM aborting
E/installd(798): dexopt failed on '/data/dalvik-cache/data#app#org.yccheok.jstock.gui-1.apk#classes.dex' res = 11
Note, the problem will not occur, if I were using emulator 4.1.2
Most of the time associated with excessive values for LinearAlloc. Putting verbose mode for logcat could give you more details (can even pinpoint the problem). There no definite fix I heard of.Sometimes it can be fixed by wiping AVD, some get fix by increasing SD card only, some had to recreate new AVD, some fixed it by reinstalling ADT, there are lots of fixes people speak of, answer can be varied as actual problem.
Sometimes problem can be corrupted files, or application install entries which makes android confused whether app is installed or not. Or by use of complex libraries, or even problem with the compiler itself. There's not a lot of clear information on this error from Google, they say it is related to a bug in Android OS that doesn't frees files handles in some cases. However as looking to logcat it always connected to some dex files. and so as to DDMS and compiler.I suggest you to try all of the fixes I stated, also refer the given links
Issue 22586: Dexopt fails with "LinearAlloc exceeded" for deep interface hierarchies
Cleanup redundant interfaces from iftable to avoid excessive LinearAlloc use
Issue 42538: INSTALL_FAILED_DEXOPT solved by dex.disable.merger=true
If everything failed please put your verbose logcat
Try uninstalling your app before installing it again. It seems to have solved the issue for some according to this
I was facing the same issue after upgrading ADT and I was stuck for this issue for almost half and a day.After every HIT and TRY method found the solution.
**
ONE OF LIBRARY PROJECT BUILD TARGET WAS HIGHER THEN MY PROJECT , JUST
CHANGED LIBRARY PROJECT BUILD TARGET TO 3.0 AND MY PROJECT BUILD
TARGET TO 4.0.3 AND IT VANISHES.
**
Just posted my solution if it helps others in future.
It's very hard to find out what the error is from the information you provided.
Try the following
Clean your project
Uninstall your app
Download a different version of adt bundle
Experiment with different emulators with different values
Try to use a real device, does the problem still occur?
Look through these links, maybe your problem is similar:
http://blog.elsdoerfer.name/2009/05/25/android-fix-package-uid-mismatches/
How to solve Installation failed due to invalid APK file?
LinearAlloc exceeded capacity (5242880), last=1092 Error while installing on my Samsung Tablet Device
INSTALL_FAILED_DEXOPT error when trying to install application
Good luck!