尝试使用平台 4.1 的 adb 安装 android apk 包时失败 [INSTALL_FAILED_CONTAINER_ERROR]
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/12480302/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Failure [INSTALL_FAILED_CONTAINER_ERROR] when trying to install android apk package using adb for platform 4.1
提问by MOHAMED
I generated an apk package for my android application. and I tried to install the package (apk) on android platform 4.1 (level 16) using the adbcommand but it genrates error:
我为我的 android 应用程序生成了一个 apk 包。我尝试使用adb命令在 android 平台 4.1(级别 16)上安装包(apk),但它生成错误:
Failure [INSTALL_FAILED_CONTAINER_ERROR]
when trying to run with eclipse (run button) for the same platform (4.1 level 16) it works without a problems
尝试在同一平台(4.1 级别 16)上使用 eclipse(运行按钮)运行时,它可以正常工作
this behaviour is not reproduced for platform 2.1 and platform 3.2
平台 2.1 和平台 3.2 不会重现此行为
回答by JNI_OnLoad
You need to make changes in AndroidManifest.xml
. The change which you need to do is. Change :
您需要在AndroidManifest.xml
. 你需要做的改变是。改变 :
android:installLocation="preferExternal"
to
到
android:installLocation="auto"
this worked for me.
这对我有用。
回答by emidander
This will happen if android:installLocation
is set to "preferExternal"
and you have an AVD with a too small SD card. Increase the size of the SD card or change installLocation
to auto
in AndroidManifest.xml
.
如果android:installLocation
设置为"preferExternal"
并且您的 AVD 的 SD 卡太小,则会发生这种情况。增加 SD 卡的大小或更改installLocation
为auto
in AndroidManifest.xml
。
回答by user2161301
I got this error when I deleted my app after changing the MainActivity's name. idk if the app didn't install due to space issues or the phone thought the package is corrupt but deleting the dalvik cache and rebootingsolved it for me.
在更改 MainActivity 的名称后删除我的应用程序时出现此错误。如果应用程序由于空间问题而没有安装,或者手机认为软件包已损坏,但删除 dalvik 缓存并重新启动为我解决了这个问题。
回答by Felix Bellaby
INSTALL_FAILED_CONTAINER_ERROR is also returned when trying to install an apk that contains native libraries compiled for a different architecture.
当尝试安装包含为不同架构编译的本机库的 apk 时,也会返回 INSTALL_FAILED_CONTAINER_ERROR。
Try running "logcat" from the "adb shell" after you get the error. If it reports a java IOException "Failed to extract native code" then you need to install the apk on an avd created for the native library architecture, or include native libraries in your apk for the architecture on your avd/device.
收到错误后,尝试从“adb shell”运行“logcat”。如果它报告 java IOException“无法提取本机代码”,那么您需要在为本机库架构创建的 avd 上安装 apk,或者在您的 apk 中为您的 avd/设备上的架构包含本机库。
回答by Linh Van
i change installLocation="auto"
in manifest but not work. I found problem in something wrong with my sdcard.
我改变installLocation="auto"
了清单但不起作用。我发现我的 SD 卡有问题。
So, i change android:installLocation="preferExternal
to internalOnly
.
It work for me!
所以,我android:installLocation="preferExternal
改为internalOnly
. 它对我有用!
回答by user3098756
I wasnt able to change manifest of the build, so for me was the solution unmount SD card, install app and then mount it back.
我无法更改构建的清单,所以对我来说解决方案是卸载 SD 卡,安装应用程序,然后将其重新安装。