简体   繁体   English

dex2oat在Android 6 / Marshmallow上失败 - 权限被拒绝 - 不是即时运行相关

[英]dex2oat Failing on Android 6/Marshmallow - Permission denied - Not instant run related

In our production build (done on a CI server, so no Instant Run), users are reporting that the app either: 在我们的生产构建中(在CI服务器上完成,因此没有即时运行),用户报告该应用程序:

  • takes a long time (> 10 minutes) to install, possibly never completing 安装需要很长时间(> 10分钟),可能永远不会完成

or 要么

  • after rebooting, they see "Optimizing Apps 1 of 1" with our application installed. 重新启动后,他们会在我们的应用程序安装后看到“优化应用程序1 of 1”。

With several bug reports from them at this point, the common thread seems to be the dex2oat process failing: 有了他们的几个错误报告,共同的线程似乎是dex2oat进程失败:

dex2oat : /system/bin/dex2oat --compiler-filter=speed --dex-file=/data/app/**packagename**-1/base.apk --oat-file=/data/dalvik-cache/arm64/data@app@**packagename**-1@base.apk@classes.dex E dex2oat : Failed to create oat file: /data/dalvik-cache/arm64/data@app@**packagename**-1@base.apk@classes.dex: Permission denied 05-11 20:48:21.783 7316 7316 I dex2oat : dex2oat took 3.058ms (threads: 8) 05-11 20:48:21.793 7293 7293 W art : Failed execv(/system/bin/dex2oat --runtime-arg -classpath --runtime-arg --instruction-set=arm64 --instruction-set-features=smp,a53 --runtime-arg -Xrelocate --boot-image=/system/framework/boot.art --runtime-arg -Xms64m --runtime-arg -Xmx512m --compiler-filter=speed --instruction-set-variant=generic --instruction-set-features=default --dex-file=/data/app/**packagename**-1/base.apk --oat-file=/data/dalvik-cache/arm64/data@app@**packagename**-1@base.apk@classes.dex) because non-0 exit status

We are seeing this issue across multiple manufacturers (Samsung, Kyocera, Blackberry) and phones. 我们在多个制造商(三星,京瓷,黑莓)和手机上看到了这个问题。 So far, all the bug reports that I have are against Android 6.0.X 到目前为止,我所有的错误报告都是针对Android 6.0.X的

  • Gradle version: gradle-4.4 Gradle版本:gradle-4.4
  • Gradle plugin: 'com.android.tools.build:gradle:3.1.2' Gradle插件:'com.android.tools.build:grad:3.12'
  • compileSdkVersion 26 compileSdkVersion 26
  • buildToolsVersion '27.0.3' buildToolsVersion '27 .0.3'
  • minSdkVersion 19 minSdkVersion 19
  • targetSdkVersion 26 targetSdkVersion 26
  • Multidex version 1.0.3 Multidex版本1.0.3

I'm aware of Several Bugs with similar symptoms around Instant Run, but I do not believe this is that. 我知道几个 Bug在Instant Run周围有类似的症状,但我不相信这就是那个。 I've also seen a few other, older questions here, but only the Instant Run related ones have any answers or they are with much older versions of the plugins/gradle/build tools. 我在这里也看到了其他一些较旧的问题,但只有与Instant Run相关的问题有任何答案,或者它们与旧版本的插件/ gradle / build工具有关。

Comparing the last version we had before we started getting these reports to now, the only thing I think might be relevant is that I upgraded the Multidex library from 1.0.2 to 1.0.3 . 比较我们在开始获取这些报告之前的最新版本,我认为唯一可能相关的是我将Multidex库从1.0.2升级到1.0.3

Of course, I have been totally unable to reproduce the issue on any of my test devices, across any OS version, including factory resetting them. 当然,我完全无法在任何操作系统版本的任何测试设备上重现该问题,包括工厂重置它们。

Anyone have any thoughts, suggestions or even things to try? 任何人有任何想法,建议甚至尝试的事情? I'm running out of ideas quickly. 我很快就没有想法了。

Additional information 附加信息

Having finally gotten ahold of one of the devices where this problem is evident, some additional facts: 终于得到了其中一个显然存在问题的设备,还有一些额外的事实:

  • The problem occurs installing via adb as well 通过adb安装也会出现问题
  • The problem occurs with a locally compiled binary 本地编译的二进制文件会出现此问题
  • Setting the binary to debuggable true causes the installation to go from 9:43 to less than 20 seconds. 将二进制文件设置为debuggable true会导致安装从9:43到小于20秒。 This is true even if I leave other settings such as proguard and minification turned on. 即使我打开了诸如proguard和minification等其他设置,也是如此。

Looks like the Gradle Plugin 3.1.2 is causing the Issue 看起来像Gradle Plugin 3.1.2导致了问题

I was able to confirm that this is a bug in the android gradle plugin version 3.1.2. 我能够确认这是android gradle插件版本3.1.2中的一个错误。 By reverting to 3.0.1 I was able to compile identical code and have it dex2oat immediately and successfully. 通过恢复到3.0.1,我能够编译相同的代码并立即成功地使用dex2oat。 This issue is also present in the 3.2.0-alpha15 gradle plugin. 此问题也出现在3.2.0-alpha15 gradle插件中。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Android dex2oat 构建:错误:Dex2oat 无法编译启动映像 - Android dex2oat build:ERROR: Dex2oat failed to compile a boot image android中的execv(/ system / bin / dex2oat)失败 - Failed execv(/system/bin/dex2oat ) in Android Android 应用程序在开始时崩溃,显示“E/dex2oat:无法创建 oat 文件”和“非 0 退出状态” - Android app crashes at start with "E/dex2oat: Failed to create oat file" and "non-0 exit status" dexopt和dex2oat之间的区别? - Difference between dexopt and dex2oat? dex2oat 是否编译所有方法? - Does dex2oat compile all methods? 为目标SDK 22+的Android库禁用ART运行时(vmSafeMode)和dex2oat? - Disable ART runtime (vmSafeMode) and dex2oat for an Android Library targeting SDK 22+? Android App开始慢 - dex2oat Zip缺席。取消 - Gradle 2.10 - Android App starting slow - dex2oat Zip is absent. Canceled - Gradle 2.10 安装应用程序需要几分钟时间并出现 dex2oat 警告 - Installing app takes minutes with dex2oat warnings Android Marshmallow:新文件(...)授予权限被拒绝 - Android Marshmallow: new File (…) gives permission denied oat位置在android marshmallow上无效错误 - oat location is not valid error on android marshmallow
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM