使用AVD直接运行代码报错 30C

AVD本身的运行没有问题
报错如下

[2016-09-13 10:51:12 - TestApp] ------------------------------
[2016-09-13 10:51:12 - TestApp] Android Launch!
[2016-09-13 10:51:12 - TestApp] adb is running normally.
[2016-09-13 10:51:12 - TestApp] Performing com.cyber.testapp.StartActivity activity launch
[2016-09-13 10:51:12 - TestApp] Automatic Target Mode: Unable to detect device compatibility. Please select a target device.
[2016-09-13 10:51:16 - TestApp] Launching a new emulator with Virtual Device 'AVD_for_Nexus_7_2012_by_Google'
[2016-09-13 10:51:20 - Emulator] emulator: WARNING: VM heap size set below hardware specified minimum of 96MB
[2016-09-13 10:51:20 - Emulator] emulator: WARNING: Setting VM heap size to 256MB
[2016-09-13 10:51:20 - Emulator] Hax is enabled
[2016-09-13 10:51:20 - Emulator] Hax ram_size 0x40000000
[2016-09-13 10:51:20 - Emulator] HAX is not working and emulator runs in emulation mode.
[2016-09-13 10:51:20 - Emulator] The memory needed by this VM exceeds the driver limit.
[2016-09-13 10:51:20 - Emulator] qemu-system-x86_64.exe: -drive if=none,index=1,id=cache,file=C:\Users\LDY.android\avd\AVD_for_Nexus_7_2012_by_Google.avd/cache.img: could not open disk image C:\Users\LDY.android\avd\AVD_for_Nexus_7_2012_by_Google.avd/cache.img: Could not open 'C:\Users\LDY.android\avd\AVD_for_Nexus_7_2012_by_Google.avd/cache.img': Invalid argument

2个回答

gradle里配置dexOptions{javaMaxHeapSize = "..."}比如2048MB
而且你的AVD是_Nexus_7,安卓7.0了吧,你gradle里配置的sdk版本可能不匹配(这点仅是猜测)~祝解决问题

想了下,还有应用程序对应的API不一样,不仅在gradle中修改sdk版本,在AndroidManifest.xml中也需要进行一个修改api,

这句话中的SdkVersion也要改成对应的level值

Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
立即提问
相关内容推荐