Closed m0vie closed 8 years ago
The problem seems to be specific to odexed system apps for which dex2oat fails when being run on-demand.
If dex2oat has to be run on demand, it's already too late. You can forget about the UID stuff, the question is why dex2oat isn't triggered earlier. You say that some apps were not optimized - do you have more information about that (e.g. logs where I can say that/why it fails or is skipped)? Does it try to repeat the optimization after a reboot?
Reboots did not cause the Nfc app to be compiled. It kept failing.
I just noticed that I did actually create a logcat of the first boot after xposed installation in recovery, and uploaded it: http://sprunge.us/ffKW
I could not find any indication as to why some apps would get compiled and others wouldn't.
You could please try https://www.dropbox.com/s/8lddtv03riu8a1r/xposed-v80-sdk23-arm64-test2.zip?dl=0? It fixes some early errors on LG devices, it might help here as well.
That build seems to work for me (flashed and cleared dalvik-cache).
No dex2oat
errors in the boot log anymore.
Note however, that I did not do a complete wipe, but used the device in its current state. So some system apps such as com.google.android.gsf
were already updated and the version from /data/ was used instead. But the one that kept failing all the time before (com.android.nfc
/ NfcNci
) is still the original system app and works perfectly now.
Hey. Having similar issues on Nexus 6P, stock 6.0.1 latest image (mmb29p).
The steps I took:
and then services (namely "Nfc Service") start to force-close in a loop.
I tried the above steps with "xposed-v79-sdk23-arm64.zip" and also with "xposed-v80-sdk23-arm64-test2.zip" Both versions result in the same issue :(
I also met these same problems in the same situation.
I try to shutdown and reboot nexus 6p, NFC problem will be solved, but some other system apps still display "stop" sometimes.
same scenario as purpleman2k. clean install of everything. neither v79 nor v80t2 work, both produce nfc service crash.
UPD. after playing with a device for a few hours (too many apps installed and customisations done to list all and be able to pinpoint the fix, but amongst them was unrooting from SuperSU and rerooting again) I was able to install v80t2 without NFC crash. hm.
Hey, I have the same issue with a brand new Nexus 6p.
I also tried:
---> Get NFC Loop
Changed SuperSu to multiuser-support, thrust for systemlevel applications and activation during boot in the options had NO effect.
I did hear that flashing xposed > do factory reset, cleaning data > install xposed installer > flash SuperSU could be a possible way that works. Does anyone have experience on this? Does it make a difference when the reboot is done by the xposed-installer?
Many people have his issue, so it must be related to the more recent versions. Is there a confirmation that v78 is working better and without FC for NFC and gaps? Is there a workaround? I would like to install xprivacy....
@rovo89 the link seems to be broken now. Is there a way to publish that fix again?
Same NFC loop problem here. My configuration/ procedure: 1) nexus 5 lte 2) flashed factory 6.0.1 MMB29Q 3) flashed TWRP 3 4) flashed SUPERSU 2.66 BETA 5) flashed xposed-v80-sdk23-arm 6) nfc loop
I have tried v78-sdk23-6.0-arm as well, same problem I have tried disabling nfc first, setting SuperSU as multiuser support, start at boot, and trust system user, nothing.
Please help :)
thanks!
Just wanted to let you know, I had the same problem on AOSP 6.0 on Xperia Z2 tablet.. I then did factory reset, delete cache and dalvik from the recovery, and then it worked fine.
Confirmed on Nexus 5x on stock and Omni (both odexed), xposed v78..v80.
PS, it works after a factory reset until a dalvik cache wipe.
Many people have his issue, so it must be related to the more recent versions. Is there a confirmation that v78 is working better and without FC for NFC and gaps? Is there a workaround? I would like to install xprivacy....
Try a custom deodexed ROM (even simply a deodexed stock ROM). But it's strange to get this error on 32-bit.
Confirmed on Nexus 5 (32-bit). Stock MMB29V + SuperSU 2.68 (beta) + ElementalX kernel 6.14 + V80. Dirty flashing v78 resolved the problem.
Confirmed on Nexus 6 (32-bit). Stock MMB29V + SuperSU 2.67 (beta) + v79 and v80.
It's not the first time it happened to me. I flash every monthly update and it happens about one times on three... I could not find a rule to get rid of it… (dalvik cache wip? reboot? flash system again?)
If you need any log or test, ask me! Thanks :+1:
Have the same problem on my Nexus 5 (hammerhead) after Stock update MMB29V.
I fixed the FC by executing the failed command via adb root shell:
/system/bin/dex2oat --runtime-arg -classpath --runtime-arg /system/framework/XposedBridge.jar --instruction-set=arm --instruction-set-features=smp,-div,-atomic_ldrd_strd --runtime-arg -Xnorelocate --boot-image=/system/framework/boot.art --runtime-arg -Xms64m --runtime-arg -Xmx512m --instruction-set-variant=krait --instruction-set-features=default --dex-file=/system/app/NfcNci/oat/arm/NfcNci.odex --oat-file=/data/dalvik-cache/arm/system@app@NfcNci@NfcNci.apk@classes.dex
Interestingly, after the next reboot, 13 further apps were optimized which were obviously skipped on the initial run.
When I clear the dalvik-cache now, everything is properly optimized in one run.
Please avoid "me too" comments. I'll let you know when I have time to analyze this further. I might need further logs then, especially of the initial boot where it misses to compile certain apps. I would like to see if they're mentioned at all and why they're skipped.
This worked for me, what @michaelprager did but for Nexus 6P/arm64:
/system/bin/dex2oat --runtime-arg -classpath --runtime-arg /system/framework/XposedBridge.jar --instruction-set=arm64 --instruction-set-features=smp,a53 --runtime-arg -Xnorelocate --boot-image=/system/framework/boot.art --runtime-arg -Xms64m --runtime-arg -Xmx512m -j2 --instruction-set-variant=cortex-a53 --instruction-set-features=default --dex-file=/system/app/NfcNci/oat/arm64/NfcNci.odex --oat-file=/data/dalvik-cache/arm64/system@app@NfcNci@NfcNci.apk@classes.dex
Had the same problem on Nexus 6. @michaelprager's trick didn't help, besides NFC there were problems with the other services. Even with the trick above I've had only a handful of apps (sometimes 13, sometimes 31, sometimes 31 and the count up would start from 10) which would optimize after cleaning cache.
TL;DR version -- before flashing Xposed I've flashed LED Enabler and I believe that was the reason Xposed flash "didn't take".
What did help me was:
Came across the same problem:
03-29 18:21:44.900 24452-24452/? E/dex2oat: Failed to create oat file: /data/dalvik-cache/arm/system@app@CloudPrint2@CloudPrint2.apk@classes.dex: Permission denied
03-29 18:21:44.902 24434-24434/? W/art: Failed execv(/system/bin/dex2oat --runtime-arg -classpath --runtime-arg /system/framework/XposedBridge.jar --instruction-set=arm --instruction-set-features=smp,-div,-atomic_ldrd_strd --runtime-arg -Xnorelocate --boot-image=/system/framework/boot.art --runtime-arg -Xms64m --runtime-arg -Xmx512m --instruction-set-variant=krait --instruction-set-features=default --dex-file=/system/app/CloudPrint2/CloudPrint2.apk --oat-file=/data/dalvik-cache/arm/system@app@CloudPrint2@CloudPrint2.apk@classes.dex) because non-0 exit status
Thanks @michaelprager, I re-exec the command of dex2oat
manually via adb shell
as root user.
➜~ adb shell shell@hammerhead:/ $ su root@hammerhead:/ # /system/bin/dex2oat --runtime-arg -classpath --runtime-arg /system/framework/XposedBridge.jar --instruction-set=arm --instruction-set-features=smp,-div,-atomic_ldrd_strd --runtime-arg -Xnorelocate --boot-image=/system/framework/boot.art --runtime-arg -Xms64m --runtime-arg -Xmx512m --instruction-set-variant=krait --instruction-set-features=default --dex-file=/system/app/CloudPrint2/CloudPrint2.apk --oat-file=/data/dalvik-cache/arm/system@app@CloudPrint2@CloudPrint2.apk@classes.dex
The CloudPrint2 does not FC again..
Could you try this please? https://www.dropbox.com/s/2wqrzrydabq4qbp/xposed-v83-sdk23-arm-test2.zip?dl=0 https://www.dropbox.com/s/473up554s3d07ax/xposed-v83-sdk23-arm64-test2.zip?dl=0 (you should propably clear the Dalvik cache if you have used some work-around before)
If this works, please just let me know and I'll release an official version with the fix soon. There's no need to create guides how to use these test versions, upload them to alternative places, ...
Just flashed Nexus 6P mhc19q
+ xposed v83-sdk23-arm64-test2
and cleared the Dalvik cache. All apps were compiled on the first boot, and no crashes afterwards.
Great! Further tests would still be welcome, I'll do some more myself.
Just out of curiosity: Is there really a compiled file for NfcNci.apk
in the Dalvik cache afterwards? There might not be one, and the trick is actually that apps should be able to run even if they haven't been recompiled.
/data/dalvik-cache/arm64/system@app@NfcNci@NfcNci.apk@classes.dex 856744 2009-01-01 09:00:00
is there. Il'l have another detailed look later, but so far everything looks good.
OK. The issue is actually a bit more complex... Android sometimes decides to skip some apps when they haven't been used for a longer time. This behavior was even intensified on 6.0.1: https://github.com/android/platform_frameworks_base/commit/71d3260ffa99bf7e580d9ebd979a1e7863b50223
In your case, it seems that the system has decided to compile the app anyway. My fix is especially about those case where the app wasn't compiled.
Does that mean that the app will be compiled on-the-fly? Is that going to degrade performance in some way?
As far as I could see so far, these apps aren't compiled at all, but interpreted. That will certainly have a little performance impact, but keep in mind that these are very few apps, and especially those which haven't been used for a longer time. Android might still decide to compile them at a later time if they're actually used. And the point is: AOSP already has the same behavior. It just wasn't used when Xposed is installed because Xposed forces the image to be recompiled, so checksums didn't match, and also it checks that the file is recompiled for Xposed. My changes allow the interpreted usage of the odex file when everything else has failed. And that's still better than a bootloop, right? 😊
I experienced this issue on a nexus 5x with factory images (mhc19q). I was able to get the system to actually boot using this approach. https://github.com/rovo89/android_art/issues/28#issuecomment-202824817 I grep logcat looking for the Failed execv(
and then manually running those commands as root.
However, even though the system boots up, even some 3rd party apps installed from the play store are crashing with this same type of issue.
@giantpune Did you try the test version I posted above?
It seems like that test2 zip did fix the issue with the app I was having. I'll play with it some more and report back if I notice some other app misbehaving.
Test version did worked. Apps are decompiled. But apps moved to external-sd won't load and some apps won't uninstall/install
EDIT: Apps moved to external-sd are loading, but it takes very long to load. The same for uninstalling apps
@Modzon Could you please be more specific? Does it affect all apps that you have moved? How have you moved them? Does moving them back to internal space help? Does the issue come back when you move them to external SD again? Which apps can't be installed/uninstalled? What's the error message? Can you provide logs for any of these issues?
@rovo89 The problem of the apps that won't load is already fixed. The most app's I've moved to the external sdcard with the adoptable storage of Android MM. The uninstallation problem only affects the smaller apps moved to the external sdcard but it is also fixed.
Fixed in v83.
I just set up a new nexus 6p like the following:
After rebooting 48 apps were optimized just fine.
But some others were not optimized on the boot but lateron, in which case it was not successful.
This leads to an infinitle FC loop.
Investigating the issue I did the following:
This still did not work:
So now the problem is the sepolicy:
dex2oat
is being run as UID nfc and not system.So lets' try after
setenforce permissive
:The file could now be created, but has UID/GID of nfc/nfc:
And everything works perfectly.
The problem seems to be specific to odexed system apps for which dex2oat fails when being run on-demand.
I also tried the whole thing using various versions of SuperSU (2.66, 2.52, no SuperSU at all), to no avail so it seems to be unrelated to any other changes.