How to allow my app to be moved to memory card?

Asked

Viewed 764 times

4

All the applications I’m developing of tests do not allow me to move them to the memory card. Is there any way to do this? You have to ask for some permission on Manifest.xml?

I put the property that the android:installLocation in Manifest.xml and it even worked, but I have the following problem.

When I change my phone to the Card and try to open the error app, but if I restart the phone and open the app again works, then I step to the mobile and when I will open the error app, but if I restart and open the app works and so gets.

I even managed to switch from one place to another, but I need to restart the phone to work the app. I will put here an excerpt of the error that is giving:

09-21 01:03:46.868  21820-21820/com.anderson.escuta W/art? Failed to find OatDexFile for DexFile /mnt/asec/com.anderson.escuta-1/pkg.apk in OatFile /data/dalvik-cache/mnt@[email protected]@[email protected]
09-21 01:03:46.868  21820-21820/com.anderson.escuta E/art? oat file /data/dalvik-cache/mnt@[email protected]@[email protected] does not contain contents for /mnt/asec/com.anderson.escuta-1/pkg.apk with checksum 786154219
09-21 01:03:46.868  21820-21820/com.anderson.escuta E/art? oat file /data/dalvik-cache/mnt@[email protected]@[email protected] contains contents for /data/app/com.anderson.escuta-2.apk
09-21 01:03:46.868  21820-21820/com.anderson.escuta A/art? art/runtime/class_linker.cc:955] Failed to remove obsolete oat file from /data/dalvik-cache/mnt@[email protected]@[email protected]: Permission denied
09-21 01:03:47.128  21820-21820/com.anderson.escuta A/art? art/runtime/runtime.cc:203] Runtime aborting...
09-21 01:03:47.128  21820-21820/com.anderson.escuta A/art? art/runtime/runtime.cc:203] Aborting thread:
09-21 01:03:47.128  21820-21820/com.anderson.escuta A/art? art/runtime/runtime.cc:203] "main" prio=10 tid=1 Runnable
09-21 01:03:47.128  21820-21820/com.anderson.escuta A/art? art/runtime/runtime.cc:203]   | group="main" sCount=0 dsCount=0 obj=0x653aa060 self=0x4191cdd8
09-21 01:03:47.128  21820-21820/com.anderson.escuta A/art? art/runtime/runtime.cc:203]   | sysTid=21820 nice=-20 cgrp=apps sched=0/0 handle=0x400a1154
09-21 01:03:47.128  21820-21820/com.anderson.escuta A/art? art/runtime/runtime.cc:203]   | state=R schedstat=( 40233070 20508181 144 ) utm=2 stm=2 core=1 HZ=100
09-21 01:03:47.128  21820-21820/com.anderson.escuta A/art? art/runtime/runtime.cc:203]   | stack=0xbe526000-0xbe52a000 stackSize=8MB
09-21 01:03:47.128  21820-21820/com.anderson.escuta A/art? art/runtime/runtime.cc:203]   native: art::Thread::DumpStack(std::ostream&) const+87 [0x41848214] (libart.so)
09-21 01:03:47.128  21820-21820/com.anderson.escuta A/art? art/runtime/runtime.cc:203]   native: ??? [0x418403a4] (libart.so)
09-21 01:03:47.128  21820-21820/com.anderson.escuta A/art? art/runtime/runtime.cc:203]   native: art::Runtime::Abort()+79 [0x41840934] (libart.so)
09-21 01:03:47.128  21820-21820/com.anderson.escuta A/art? art/runtime/runtime.cc:203]   native: art::LogMessage::~LogMessage()+505 [0x416eda7a] (libart.so)
09-21 01:03:47.128  21820-21820/com.anderson.escuta A/art? art/runtime/runtime.cc:203]   native: art::ClassLinker::FindDexFileInOatFileFromDexLocation(std::string const&, unsigned int)+571 [0x41709dd8] (libart.so)
09-21 01:03:47.128  21820-21820/com.anderson.escuta A/art? art/runtime/runtime.cc:203]   native: ??? [0x4181064c] (libart.so)
09-21 01:03:47.128  21820-21820/com.anderson.escuta A/art? art/runtime/runtime.cc:203]   at dalvik.system.DexFile.openDexFileNative(Native method)
09-21 01:03:47.128  21820-21820/com.anderson.escuta A/art? art/runtime/runtime.cc:203]   at dalvik.system.DexFile.openDexFile(DexFile.java:296)
09-21 01:03:47.128  21820-21820/com.anderson.escuta A/art? art/runtime/runtime.cc:203]   at dalvik.system.DexFile.<init>(DexFile.java:80)
09-21 01:03:47.128  21820-21820/com.anderson.escuta A/art? art/runtime/runtime.cc:203]   at dalvik.system.DexFile.<init>(DexFile.java:59)
09-21 01:03:47.128  21820-21820/com.anderson.escuta A/art? art/runtime/runtime.cc:203]   at dalvik.system.DexPathList.loadDexFile(DexPathList.java:263)
09-21 01:03:47.128  21820-21820/com.anderson.escuta A/art? art/runtime/runtime.cc:203]   at dalvik.system.DexPathList.makeDexElements(DexPathList.java:230)
09-21 01:03:47.128  21820-21820/com.anderson.escuta A/art? art/runtime/runtime.cc:203]   at dalvik.system.DexPathList.<init>(DexPathList.java:112)
09-21 01:03:47.128  21820-21820/com.anderson.escuta A/art? art/runtime/runtime.cc:203]   at dalvik.system.BaseDexClassLoader.<init>(BaseDexClassLoader.java:48)
09-21 01:03:47.128  21820-21820/com.anderson.escuta A/art? art/runtime/runtime.cc:203]   at dalvik.system.PathClassLoader.<init>(PathClassLoader.java:65)
09-21 01:03:47.128  21820-21820/com.anderson.escuta A/art? art/runtime/runtime.cc:203]   at android.app.ApplicationLoaders.getClassLoader(ApplicationLoaders.java:57)
09-21 01:03:47.128  21820-21820/com.anderson.escuta A/art? art/runtime/runtime.cc:203]   - locked <0x60c49c30> (a android.util.ArrayMap)
09-21 01:03:47.128  21820-21820/com.anderson.escuta A/art? art/runtime/runtime.cc:203]   at android.app.LoadedApk.getClassLoader(LoadedApk.java:329)
09-21 01:03:47.128  21820-21820/com.anderson.escuta A/art? art/runtime/runtime.cc:203]   - locked <0x658d5558> (a android.app.LoadedApk)
09-21 01:03:47.128  21820-21820/com.anderson.escuta A/art? art/runtime/runtime.cc:203]   at android.app.LoadedApk.makeApplication(LoadedApk.java:518)
09-21 01:03:47.128  21820-21820/com.anderson.escuta A/art? art/runtime/runtime.cc:203]   at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4388)
09-21 01:03:47.128  21820-21820/com.anderson.escuta A/art? art/runtime/runtime.cc:203]   at android.app.ActivityThread.access$1500(ActivityThread.java:139)
09-21 01:03:47.128  21820-21820/com.anderson.escuta A/art? art/runtime/runtime.cc:203]   at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1260)
09-21 01:03:47.128  21820-21820/com.anderson.escuta A/art? art/runtime/runtime.cc:203]   at android.os.Handler.dispatchMessage(Handler.java:102)
09-21 01:03:47.128  21820-21820/com.anderson.escuta A/art? art/runtime/runtime.cc:203]   at android.os.Looper.loop(Looper.java:136)
09-21 01:03:47.128  21820-21820/com.anderson.escuta A/art? art/runtime/runtime.cc:203]   at android.app.ActivityThread.main(ActivityThread.java:5103)
09-21 01:03:47.128  21820-21820/com.anderson.escuta A/art? art/runtime/runtime.cc:203]   at java.lang.reflect.Method.invoke(Native method)
09-21 01:03:47.128  21820-21820/com.anderson.escuta A/art? art/runtime/runtime.cc:203]   at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:790)
09-21 01:03:47.128  21820-21820/com.anderson.escuta A/art? art/runtime/runtime.cc:203]   at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:606)
09-21 01:03:47.128  21820-21820/com.anderson.escuta A/art? art/runtime/runtime.cc:203] Dumping all threads without appropriate locks held: thread list lock
09-21 01:03:47.128  21820-21820/com.anderson.escuta A/art? art/runtime/runtime.cc:203] All threads:
09-21 01:03:47.128  21820-21820/com.anderson.escuta A/art? art/runtime/runtime.cc:203] DALVIK THREADS (13):
09-21 01:03:47.128  21820-21820/com.anderson.escuta A/art? art/runtime/runtime.cc:203] "main" prio=10 tid=1 Runnable
09-21 01:03:47.128  21820-21820/com.anderson.escuta A/art? art/runtime/runtime.cc:203]   | group="main" sCount=0 dsCount=0 obj=0x653aa060 self=0x4191cdd8
09-21 01:03:47.128  21820-21820/com.anderson.escuta A/art? art/runtime/runtime.cc:203]   | sysTid=21820 nice=-20 cgrp=apps sched=0/0 handle=0x400a1154
09-21 01:03:47.128  21820-21820/com.anderson.escuta A/art? art/runtime/runtime.cc:203]   | state=R schedstat=( 72628903 34617087 268 ) utm=5 stm=2 core=0 HZ=100
09-21 01:03:47.128  21820-21820/com.anderson.escuta A/art? art/runtime/runtime.cc:203]   | stack=0xbe526000-0xbe52a000 stackSize=8MB
09-21 01:03:47.128  21820-21820/com.anderson.escuta A/art? art/runtime/runtime.cc:203]   native: art::Thread::DumpStack(std::ostream&) const+87 [0x41848214] (libart.so)
09-21 01:03:47.128  21820-21820/com.anderson.escuta A/art? art/runtime/runtime.cc:203]   native: art::ThreadList::DumpLocked(std::ostream&)+67 [0x41853184] (libart.so)
09-21 01:03:47.128  21820-21820/com.anderson.escuta A/art? art/runtime/runtime.cc:203]   native: ??? [0x41840456] (libart.so)

Does anyone have any idea what it might be?

  • Anderson, how so move? You tell the user to move through the system settings?

  • That’s right! I saw that some app allow this, but the ones I did here no allows. kkk

  • Anderson, what version of your Android? I found a bug: https://code.google.com/p/android/issues/detail?id=34880 related to this issue, which is from version 4.1.1, maybe fixed in 4.1.2. It seems that there are reports that still persist in version 4.4...

  • My version is 4.1.1. But the strange that I have tried several app that I downloaded from playsotre even with very inferior versions and never had this problem. I do not know what it can be. ;/ But still vlw

  • I do not know what can be really, try on another device. I do not even know how to help much, I researched well and did not find any pattern or any solution...

  • ok, all right. When I find out I put here.

Show 1 more comment

1 answer

5

Using the property android:installLocation tag <manifest> you can control the installation location of the application.

There are three possible values:

  1. internalOnly, which is the default if you do not enter a value for the attribute. With it the application is installed in the internal memory and cannot be moved.
  2. preferExternal defines that the installation should be done preferably in the external storage. The System may not honor such a request if there is no external storage mounted during the installation.
  3. Worth auto the system installs the application in the internal memory, but provides the possibility for the user to change to the external storage.

To use just set in your AndroidManifest:

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="nome.do.seu.pacote"
    android:installLocation="internalOnly|preferExternal|auto">

    ...

</manifest>

References:

  1. http://developer.android.com/guide/topics/manifest/manifest-element.html#install
  • It worked, I was able to pass the app to the memory card, but when I open it from several errors, I’ll paste some lines here: art/Runtime/class_linker.cc:955] Failed to remove obsolete Oat file from /data/Dalvik-cache/mnt@[email protected]@[email protected]: Permission denied Dumping all threads without appropriate Locks Held: thread list lock ?

  • Strange, from what I understand of the mistake, has a mixture of dalvik with art, changed of runtime in the meantime? This error appears in that Dialog Android standard? Or logcat? Try to get the whole app back to internal memory and reinstall to see if it solves. Tomorrow I do a better search.

  • I didn’t change anything, I just put the "android:installLocation". I wanted to show you the whole Log of the error, how do I do it? Because it doesn’t fit here. I put as an answer to the question?

  • 1

    Put in your question, formatted as code, because it has limited height.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.