无法在Android Studio 2.3.0中运行应用程序到Genymotion 2.8.1中的模拟器

时间:2017-03-25 03:24:26

标签: android genymotion linuxmint android-studio-2.3

我正在尝试将应用程序从Android Studio 2.3.0运行到Genymotion模拟器,(模拟器规范:Nexus 5 API 22 res 1080x1920 px 4 proc,2GB RAM)但它始终失败并显示以下错误消息:

Installation failed with message Failed to install all .
It is possible that this issue is resolved by uninstalling an existing version of the apk if it is present, and then re-installing.

WARNING: Uninstalling will remove the application data!

Do you want to uninstall the existing application?

图像: enter image description here

然后当我点击OK时,左下角会出现另一个错误: enter image description here

出现此错误消息:

03/25 10:10:56: Launching app
$ adb install-multiple -r /home/dana/AndroidStudioProjects/Samples/CRUD/app/build/intermediates/split-apk/debug/slices/slice_0.apk /home/dana/AndroidStudioProjects/Samples/CRUD/app/build/outputs/apk/app-debug.apk /home/dana/AndroidStudioProjects/Samples/CRUD/app/build/intermediates/split-apk/debug/slices/slice_5.apk /home/dana/AndroidStudioProjects/Samples/CRUD/app/build/intermediates/split-apk/debug/dep/dependencies.apk /home/dana/AndroidStudioProjects/Samples/CRUD/app/build/intermediates/split-apk/debug/slices/slice_1.apk /home/dana/AndroidStudioProjects/Samples/CRUD/app/build/intermediates/split-apk/debug/slices/slice_6.apk /home/dana/AndroidStudioProjects/Samples/CRUD/app/build/intermediates/split-apk/debug/slices/slice_4.apk /home/dana/AndroidStudioProjects/Samples/CRUD/app/build/intermediates/split-apk/debug/slices/slice_3.apk /home/dana/AndroidStudioProjects/Samples/CRUD/app/build/intermediates/split-apk/debug/slices/slice_2.apk /home/dana/AndroidStudioProjects/Samples/CRUD/app/build/intermediates/split-apk/debug/slices/slice_7.apk /home/dana/AndroidStudioProjects/Samples/CRUD/app/build/intermediates/split-apk/debug/slices/slice_8.apk /home/dana/AndroidStudioProjects/Samples/CRUD/app/build/intermediates/split-apk/debug/slices/slice_9.apk 
Error while Installing APKs

图像: enter image description here

来自事件日志的另一条错误消息:

10:08 AM    Session 'app': Error Installing APKs

10:10 AM    Executing tasks: [:app:assembleDebug]

10:10 AM    Gradle build finished in 1s 533ms

10:10 AM    Error while uploading slice_0.apk : WARNING: linker: /system/lib/libhoudini.so has text relocations. This is wasting memory and prevents security hardening. Please fix.
                    Success: streamed 60803 bytes

图片:enter image description here

我的笔记本电脑规格是Linux Mint Cinnamon 64位,如下图所示:enter image description here

据我所知,当adb被adb切成多个部分时,这个问题与adb有关。

当我尝试从同一genymotion运行应用程序到不同的模拟器时,我得到了同样的错误。模拟器规范是Nexus 5 API 23,带有1个proc& 2 GB RAM。

我相信我不是唯一一个遭受这个问题的人。我将不胜感激任何帮助。先谢谢

4 个答案:

答案 0 :(得分:2)

将此添加到您的清单文件

 dexOptions {
    javaMaxHeapSize "4g"
}

答案 1 :(得分:1)

我有接收器错误。我已经尝试重新安装虚拟机箱并且genymotion正常工作

答案 2 :(得分:0)

我遇到了同样的问题。

我通过在Android Studio中禁用“即时运行”来解决此问题:首选项/构建,执行,部署/即时运行,第一个复选框。

我没有时间真正理解为什么,但就我而言,它解决了这个问题。

答案 3 :(得分:0)

这对我有用:

  • 已禁用在Android Studio中即时运行:文件 - 设置 - 构建,执行,部署 - 即时运行 - 取消选中启用即时运行。
  • 模拟器:设置 - 安全 - 开启(未知资源 - 允许从未知资源安装应用)。
  • 仿真器:开发设置 - 调试部分 - 开启(通过USB进行USB调试和验证应用)。我非常怀疑USB调试与它有什么关系。