Android Enthusiasts
Q&A for enthusiasts and power users of the Android operating system
Latest Questions
21
votes
3
answers
127650
views
Clear Caches from ADB?
How do I clear caches (app, individual apps, Dalvik, ART if possible) via ADB? Using apps, recovery, or doing it through Settings are not options for me. Also, my phone is not rooted.
How do I clear caches (app, individual apps, Dalvik, ART if possible) via ADB?
Using apps, recovery, or doing it through Settings are not options for me. Also, my phone is not rooted.
LakeHMM
(360 rep)
May 26, 2015, 09:15 PM
• Last activity: Jul 24, 2023, 10:29 AM
2
votes
1
answers
1074
views
Is deleting /system/bin/dex2oat file safe?
I was looking into a couple of Android tombstones files of an old Samsung phone running Marshmallow. Found a crash in every single one with the same culprit, `dex2oat`. From my limited understanding it is a Compiler that takes arguments from Android Runtime and convert `dex` files to Android optimis...
I was looking into a couple of Android tombstones files of an old Samsung phone running Marshmallow. Found a crash in every single one with the same culprit,
dex2oat
.
From my limited understanding it is a Compiler that takes arguments from Android Runtime and convert dex
files to Android optimised ones in oat
format.
I ran into the same issue even if I factory reset or freezing a lot of apps. I have this device rooted and decided to take a risky step. I backed up first and deleted dex2oat
from /system/bin
. Then I rebooted system with risk of bricking it.
So far it is working fine.
Due my lack of understanding I don't know how crucial is this dex2oat
to system stability and I want to know what is the impact on it.
Ertox
(21 rep)
May 31, 2020, 07:34 PM
• Last activity: Jul 25, 2022, 04:37 PM
1
votes
1
answers
2652
views
Running dex2oat on host computer
I have compiled dex2oat on linux-x86_64 for linux-x86. I can run it just like a normal application. The background is, I have a tool which can generate dex codes and I want to perform some basic checks that dex2oat does. So it is not important for me to get an actual runnable file. I do get the foll...
I have compiled dex2oat on linux-x86_64 for linux-x86. I can run it just like a normal application. The background is, I have a tool which can generate dex codes and I want to perform some basic checks that dex2oat does. So it is not important for me to get an actual runnable file.
I do get the following output:
dex2oat I 4183 4183 art/dex2oat/dex2oat.cc:1239] out/host/linux-x86/bin/dex2oat --runtime-arg -Xms64m --runtime-arg -Xmx64m --image-classes=frameworks/base/preloaded-classes --dex-file=/home/marc/Apps/Example1.apk --dex-location=bla.apk --oat-file=bla.oat --image=out.art --base=0x60000000 --instruction-set=x86 --instruction-set-features=default --runtime-arg -Xrelocate --host --android-root=out/host/linux-x86 --include-patch-information
dex2oat E 4183 4183 art/runtime/runtime.cc:1108] Failed to return pre-allocated NoClassDefFoundError
dex2oat F 4183 4183 art/runtime/thread.h:330] Check failed: new_exception != NULL
dex2oat F 4183 4183 art/runtime/runtime.cc:284] Runtime aborting...
dex2oat F 4183 4183 art/runtime/runtime.cc:284] Aborting thread:
dex2oat F 4183 4183 art/runtime/runtime.cc:284] "main" prio=5 tid=1 Runnable (still starting up)
dex2oat F 4183 4183 art/runtime/runtime.cc:284] | group="" sCount=0 dsCount=0 obj=(nil) self=0xf89a8e78
dex2oat F 4183 4183 art/runtime/runtime.cc:284] | sysTid=4183 nice=0 cgrp=user/1000.user/c2.session sched=0/0 handle=0xf6b76700
dex2oat F 4183 4183 art/runtime/runtime.cc:284] | state=R schedstat=( 17496280 53788 15 ) utm=1 stm=0 core=7 HZ=100
dex2oat F 4183 4183 art/runtime/runtime.cc:284] | stack=0xff0f1000-0xff0f3000 stackSize=7MB
dex2oat F 4183 4183 art/runtime/runtime.cc:284] | held mutexes= "abort lock" "mutator lock"(shared held)
Does anyone know what causes this error or did I supply the wrong arguments?
I have added a cout statement in the code and it turns out that the class being searched for is Ljava/lang/Object;
user1120897
(11 rep)
Jan 25, 2015, 03:02 PM
• Last activity: Mar 19, 2022, 02:06 AM
0
votes
2
answers
3909
views
How to clear caches in LG G2 running Lollipop 5.0.2?
The Lollipop update for AT&T LG G2 has pretty much destroyed my phone. I'm hoping clearing out every sort of cache might help. But I can't clear the caches the usual ways because (1) the Settings app always crashes when I am in the section where you clear app caches, as does any other app that is ma...
The Lollipop update for AT&T LG G2 has pretty much destroyed my phone. I'm hoping clearing out every sort of cache might help. But I can't clear the caches the usual ways because (1) the Settings app always crashes when I am in the section where you clear app caches, as does any other app that is made for clearing caches, and (2) restarting into recovery doesn't provide options for clearing any caches. Plus, I'm curious about how to clear ART caches since I haven't found much information about them online. By the way, my phone is not rooted.
So, the question is: How do I clear (1) app caches, (2) individual apps' caches, (3) Dalvik cache (if applicable anymore), and (4) ART cache under these restraints? I'm thinking I'll have to do something via adb, but I can't find info anywhere on how to do it.
Thanks for any help you can provide!
LakeHMM
(360 rep)
May 25, 2015, 09:24 PM
• Last activity: Sep 4, 2021, 01:09 PM
0
votes
0
answers
163
views
able to use the user-installed app even if we remove the app's odex file
I want to get the answers for the following queries: If I remove the app's odex file from the `data/app/packagename/oat/arm64/base.odex` , then does it mean that the app will run in the same way as it would have run in the Dalvik Virtual Machine (DVM) environment? Is Android Runtime DVM compatible?...
I want to get the answers for the following queries:
If I remove the app's odex file from the
data/app/packagename/oat/arm64/base.odex
, then does it mean that the app will run in the same way as it would have run in the Dalvik Virtual Machine (DVM) environment?
Is Android Runtime DVM compatible? The reasons for asking this is I removed the app's odex file as described above and still I am able to run the app?
Thanks a lot for your response.
Nikhil_Coder
(121 rep)
Apr 15, 2021, 07:29 AM
• Last activity: Apr 15, 2021, 11:24 AM
1
votes
1
answers
467
views
Which Virtual machine is used in Android 11?
Every Android application runs in a virtual machine. We know that Dalvik virtual machine \was the one that is used by Android. Next, they changed to ART (Android Runtime machine). Just correct me if I am wrong. Android 11 uses which virtual machine, Dalvik or ART?
Every Android application runs in a virtual machine. We know that Dalvik virtual machine \was the one that is used by Android. Next, they changed to ART (Android Runtime machine). Just correct me if I am wrong. Android 11 uses which virtual machine, Dalvik or ART?
Mdshammi111
(11 rep)
Jan 21, 2021, 11:50 PM
• Last activity: Jan 22, 2021, 06:38 AM
0
votes
0
answers
50
views
Does Android perform cold app startup optimization?
I am trying to measure the time it takes to launch an App (cold startup) on Android. As the [official documentation][1] states, that the startup time will be displayed in the logcat: ``` ActivityManager: Displayed com.android.myexample/.StartupTiming: +3s534ms ``` The problem I currently have is tha...
I am trying to measure the time it takes to launch an App (cold startup) on Android.
As the official documentation states, that the startup time will be displayed in the logcat:
ActivityManager: Displayed com.android.myexample/.StartupTiming: +3s534ms
The problem I currently have is that startup times vary greatly. I tested on three different days à 10 times. These are the results:
- Day 1:
- ~1100ms
- Day 2:
- ~900ms
- Day 3:
- ~350ms
**My Question:**
Does Android perform any optimization in the background for the App startup? Is there a way to reliably measure the startup time?
I haven't done any changes to the App in these three days. Before the testing, the phone was at 100% battery capacity and was cold to the touch (to eliminate the possibility of thermal throttling).
On day 2 and 3, I deleted the App, restarted the phone, reinstalled the App and tested again with the same results (day 2 was again ~900ms and on day 3: ~350ms).
Maybe it has something to do with the ART (Android RunTime) using JIT (just-in-time) and AOT (ahead-of-time) compiler?!
The app does not perform any network actions. At startup it only ready about 100 pictures from the internal storage and displays them in a Recycler View .
I used a Google Pixel 2 running on Android 9. The app is written in Java.
Markus
(1 rep)
Dec 16, 2020, 11:03 AM
1
votes
0
answers
64
views
Is it possible to run jar files in an android application?
I am a begginer in android and I want to develop an application which show a list of jar files to user and user can choose one of them and run it. Is it possible to run a jar file in an android application? (not as a library) if yes, how does it run? I mean, a jar file needs to run in JVM but an apk...
I am a begginer in android and I want to develop an application which show a list of jar files to user and user can choose one of them and run it. Is it possible to run a jar file in an android application? (not as a library)
if yes, how does it run? I mean, a jar file needs to run in JVM but an apk file runs in ART.
mhs heydari
(11 rep)
Sep 23, 2020, 03:42 AM
1
votes
0
answers
79
views
Any way to force Android to treat copied pasted images as new?
I have some art apps that only let you choose images from built-in galleries that display images chronologically. I have hundreds/thousands of images on my tablet (organized in folders), especially older ones I want to edit. It'll take forever to find within these apps galleries. One thing I noticed...
I have some art apps that only let you choose images from built-in galleries that display images chronologically.
I have hundreds/thousands of images on my tablet (organized in folders), especially older ones I want to edit. It'll take forever to find within these apps galleries.
One thing I noticed is that downloaded images appear at the top of these galleries. So I thought a workaround would be to COPY & PASTE the older image (via file managers) - so that it appears as new.
But for some reason, Android will only treat downloaded images as new - not copied pasted images.
Is there any trick to make this work? Because I'm forced to edit on Android - but it's so annoying to do simple things as in Windows.
Misha Prada
(11 rep)
Apr 19, 2020, 06:53 PM
1
votes
0
answers
409
views
How do AOT and JIT work together in Android Nougat and later?
The Android OS was using interp years ago, then they added Just-In-Time (JIT). However, since Android 5.0, they replaced JIT with Ahead-Of-Time (AOT) compilation which increased app installation time quite a bit, so I wasn't following its development. Then in Android 7.0, it seemed JIT had come back...
The Android OS was using interp years ago, then they added Just-In-Time (JIT). However, since Android 5.0, they replaced JIT with Ahead-Of-Time (AOT) compilation which increased app installation time quite a bit, so I wasn't following its development. Then in Android 7.0, it seemed JIT had come back, but I cannot understand how JIT and AOT would be able to work together.
Does this mean they finally ditched AOT and switched back to JIT? (I have read some articles but since I have detached myself for a while from the follow ups to development, I am not sure if I still understand everything correctly.
Cyker
(457 rep)
Nov 14, 2018, 07:07 PM
• Last activity: Aug 5, 2019, 08:20 PM
2
votes
0
answers
181
views
Why is ART still needed on Android?
The reason Andy Rubin chose Java for Android Dev is not publicly known, only speculations, but it seems to me that the combination of being able to run a Java app everywhere (because the earliest version of Android used JVM) and the huge popularity of Java made it a sexy choice. Android Run Time (AR...
The reason Andy Rubin chose Java for Android Dev is not publicly known, only speculations, but it seems to me that the combination of being able to run a Java app everywhere (because the earliest version of Android used JVM) and the huge popularity of Java made it a sexy choice.
Android Run Time (ART) is the second Iteration of Java Virtual Machine after Dalvik Virtual Machine.
Obviously, Write once, run everywhere, which Java promised is not True on Android due to the highly modified JVM == ART.
My question is this:
since apps written for Android are not portable (i.e the apps are platform dependent), why still hold on to it?
Why convert to bytecode before running it on ART and not just compile to native code directly without the need for an interpreter (ART) like in the case of Apple's Swift?
Why tolerate the performance loss just for ART?
an iPhone App on 4gb ram will perform better than the same app on Android with 6gb of RAM due to the absence of the possibly unnecessary ART layer.
In 2019 and beyond why is the ART necessary?
LekeOpe
(121 rep)
Jul 4, 2019, 09:22 AM
5
votes
1
answers
9162
views
Album art doesn't change
So I've been successfully using programs to change album arts for my cellphone for the past 3 years and something bothers me about the way that the actual app on the Samsung reverts this changes under the following circumstances: If I've put a music from a specific album, for example, *Abbey Road*,...
So I've been successfully using programs to change album arts for my cellphone for the past 3 years and something bothers me about the way that the actual app on the Samsung reverts this changes under the following circumstances:
If I've put a music from a specific album, for example, *Abbey Road*, with a specific album art, onto the memory card of my cell phone, and then I decide that I want to change the art, and so I delete this album from the memory card and just put the same one or a different one, it doesn't matter with a different art but with the same album name, *Abbey Road*, the app will automatically show the album art that was the first time *Abbey Road* was in the cellphone.
Are there any ways to fix it?
Rogério Silva
(53 rep)
Apr 16, 2016, 11:41 PM
• Last activity: May 31, 2019, 07:09 PM
0
votes
2
answers
719
views
does ART use dalvik bytecode?
I know dalvik vm use dalvik bytecode. does ART use dalvik bytecode or something else ?
I know dalvik vm use dalvik bytecode. does ART use dalvik bytecode or something else ?
utarid
(103 rep)
May 16, 2018, 01:51 PM
• Last activity: May 17, 2018, 08:30 AM
6
votes
3
answers
12484
views
Should Dalvik Cache be wiped in Android OS that supports ART?
When switching custom ROMs (in ART), is it necessary to wipe the Dalvik Cache? Wiping the Cache is necessary, but should wiping Dalvik (which doesn't exist in Android Lollipop and afterward) be necessary? What impact will it cause if we wipe Dalvik (something not present)? In ART, what does the Dalv...
When switching custom ROMs (in ART), is it necessary to wipe the Dalvik Cache?
Wiping the Cache is necessary, but should wiping Dalvik (which doesn't exist in Android Lollipop and afterward) be necessary?
What impact will it cause if we wipe Dalvik (something not present)?
In ART, what does the Dalvik cache contains? (is it an empty folder?)
doylefermi
(160 rep)
Jun 5, 2015, 07:40 AM
• Last activity: Apr 16, 2017, 04:05 PM
4
votes
5
answers
7660
views
Moto E Not Starting Properly After Changing runtime to ART
I have recently bought a *MOTO E* and it's working cool. Then I have enabled *Developer options* and changed my runtime from *Dalvik* to *ART.* Afterwards I restarted my device. I got the message saying *Android is upgraging.* After completeing the process I got exceptions like unfortunately the pro...
I have recently bought a *MOTO E* and it's working cool. Then I have enabled *Developer options* and changed my runtime from *Dalvik* to *ART.* Afterwards I restarted my device. I got the message saying *Android is upgraging.* After completeing the process I got exceptions like
unfortunately the process com.android.phone has stopped
Please help me how to get out of this problem. I am getting that message for around 10 times and mobile restarting once again.
Software Sainath
(185 rep)
Jul 2, 2014, 05:55 AM
• Last activity: Apr 3, 2017, 06:15 PM
0
votes
6
answers
8179
views
Device stuck in bootloop after enabling ART
I activated the Android Runtime (ART) instead of Dalvik and after that my phone rebooted but it seems that it's stuck in a bootloop. Will the first bot after choosing ART take some extra time? How can I tell if it's stuck in a bootloop rather than just booting slowly? My device is an HTC Explorer ru...
I activated the Android Runtime (ART) instead of Dalvik and after that my phone rebooted but it seems that it's stuck in a bootloop.
Will the first bot after choosing ART take some extra time? How can I tell if it's stuck in a bootloop rather than just booting slowly?
My device is an HTC Explorer running CM 11 beta 4 build.
user202476
(3 rep)
Feb 10, 2014, 06:28 PM
• Last activity: Apr 3, 2017, 06:10 PM
1
votes
1
answers
142
views
MOTO E 1st Gen From Dalvik to ART : com.android.systemui stop and loop
May I first apologize for my english : non-native speaker, some erratic grammar might happen. *Si un francophone passe ici, ce sera bien plus facile pour moi ;)* I'm NOT skilled in android fix, so be patient and please forgive if i ask you more precision to understand what you say ! Some previous qu...
May I first apologize for my english : non-native speaker, some erratic grammar might happen.
*Si un francophone passe ici, ce sera bien plus facile pour moi ;)*
I'm NOT skilled in android fix, so be patient and please forgive if i ask you more precision to understand what you say !
Some previous questions were on the same problem, but i did not succeed on performing the solution , or [doesn't dare other] for i did not understood it[2]
I own a Motorola E, 1st Gen, since feb.2015.
- Legal warranty void six weeks ago...
- No root, no boot, no custom rom.
- Kitkat 4.4 (or maybe 4.4.2, can't remember)
In the last weeks, a trouble appeared : i could neither listen or speak to my interlocutor, but by pluging in a wire headset or putting the phone on speaker (the one you shan't but still use while driving). The normal "phone pressed against the ear" did not worked anymore.
The first times, a simple reboot was all it needed to go back to normal.
Since a few days, reboot have no effect.
After an extend search on the internet, i found a solution for the Moto G (2nd gen) that appeared to work perfectly.
**Going from Dalvik to ART, which i did friday (march 10th).**
- 1st reboot, upgrading 150 apps
=> Several error messages stated that XXX app has stopped. Then "com.android.systemui" has stop, and i cannot validate the prompt : once I click "OK", it comes back before i could even read the next error message.
I can't do anything with the phone.
==> Reboot by long hold on POWER
- 2nd reboot, upgrading 39 apps
=> Several messages again, com.android.systemui again
==> Reboot by long hold on POWER
- 3rd reboot, the same
- 4th reboot, upgrading 29 apps
- 5th reboot, the same
- 6th reboot, the same
- 7th reboot, upgrading 28 apps.
- xxth reboot, the same ...
Today, After a day's rest and no manipulation, count on upgrading application dropped to 27.
By repetivly pressing "ok" and 'report" when avalaible, i somehow managed to get as far as parameters menu.
Can't scoll in the microscopic time given between two prompt.
However,
-> The phone seems to receive calls (it ringed about an hour ago) but not to show the screen (caller ID, accepting the call, etc.)
-> Afterward, the led flashed again.
The android buttons (back, home, active application list) doesn't show up.
And here i'm stuck !
What i tried :
- A coffee. Did nothing to the phone, but improved my optimism
- Shut it down, let it rest, power it
- Fully charge it
- Make it reboot by a long hold on power button while it was "upgrading 28 apps".
- Pluging it to the computer, to see if it did anything (it didn't)
- Making loud assumption on the engineer's mother honour and weight.
- Go to recovery mode, and let it boot (if i understand well, it's just a normal boot for long inactivity)
- Go to recovery mode, and wipe cache partition
- Tried to do this : https://android.stackexchange.com/questions/81411/moto-e-is-not-switching-on-after-changing-runtime-to-art?noredirect=1&lq=1
=> I made it up to the 5th step ; but 6th don't work "Not recognized as a command or program" I tried the shell on E:\Programmes\AndroidSDK and E:\AndroidSDK\platform-tools. Neither works.
What should i do now ?
Thanks a lot,
Kaldui.
Kaldui
(111 rep)
Mar 13, 2017, 04:11 PM
• Last activity: Mar 14, 2017, 12:33 PM
1
votes
1
answers
157
views
my lgl16c "lucky" is stuck optimizing apps after I changed the runtime
my lgl16c was behaving very poorly to the point of which I went to the developer options and swapped the runtime from dalvik to art on android 4.4.2...and now it got stuck "optimizing app 1 of 1" after countless reboots...it's been stuck on this for days without anything changing, and there is no an...
my lgl16c was behaving very poorly to the point of which I went to the developer options and swapped the runtime from dalvik to art on android 4.4.2...and now it got stuck "optimizing app 1 of 1" after countless reboots...it's been stuck on this for days without anything changing, and there is no answer on google...is this a special case or what?
the 117 doctor
(13 rep)
Jul 6, 2016, 12:13 AM
• Last activity: Nov 1, 2016, 07:29 PM
0
votes
1
answers
955
views
Move to SD Card Option Greyed out even for Compatible Apps
I am using a Motorola Moto E with Android Kitkat and I am unable to move applications to my SD Card even for Apps that support moving to SD Card. I am using ART Runtime (Developer) instead of Dalvik.
I am using a Motorola Moto E with Android Kitkat and I am unable to move applications to my SD Card even for Apps that support moving to SD Card.
I am using ART Runtime (Developer) instead of Dalvik.
John S Perayil
(628 rep)
Dec 17, 2014, 09:03 AM
• Last activity: Sep 19, 2016, 02:54 AM
0
votes
0
answers
890
views
Lollipop/ART - how do I manually optimize APK files?
I've asked [this question][1] before. After checking out `logcat`, it seems that the OS is looking for the `odex` files. I've checked the `odex` files of other system apps on my ROM, and it turns out they're `ELF` files. For the ones asking, these are bytecode files produced by ART (`dex2oat`, I'm n...
I've asked this question before. After checking out
logcat
, it seems that the OS is looking for the odex
files. I've checked the odex
files of other system apps on my ROM, and it turns out they're ELF
files.
For the ones asking, these are bytecode files produced by ART (dex2oat
, I'm not sure).
I've observed that these files get generated on boot (Android is Starting: Optimizing App XXX of XXX
).
For some reason, my phone's ROM doesn't run the optimization part. Instead, the oat
files are already pre-generated and stored on the system partition. As a result, the apps that I want to pre-install don't get the oat
treatment and crashes when I launch them (ClassNotFoundException
since the oat
files don't exist.)
**How do I manually run the app optimizer?** If it comes down to using the command line, how do I use dex2oat
**without root access/on a Linux PC**?
Aloha
(355 rep)
Sep 18, 2016, 06:25 AM
Showing page 1 of 20 total questions