【问题标题】:org.gradle.tooling.BuildException: invalid code lengths setorg.gradle.tooling.BuildException:设置的代码长度无效
【发布时间】:2019-05-07 18:30:47
【问题描述】:

我正在尝试在 Android Studio 上制作 dlib-android。它是从以下位置下载的: https://github.com/tzutalin/dlib-android

在更改了一些东西(例如 mips64... 文件)后,它同步并成功构建。但是当我尝试使用设备或虚拟设备运行时,我总是得到 ​​p>

"Cause: invalid code lengths set" error. The run tasks ended at App:packageDebug. 从一长串的事情来看,我猜编译器下的三个信息量更大:

org.gradle.tooling.BuildException: invalid code lengths set

java.util.zip.ZipException: invalid code lengths set

java.lang.IllegalStateException: Still waiting to inspect output APK's res/raw/shape_predictor_68_face_landmarks.dat

On the right side there was: org.gradle.api.tasks.TaskExecutionException: Execution failed for task ':app:packageDebug'.

我搜索了所有地方并尝试了所有可以找到的方法,但没有成功。另外,我清理了缓存并重新启动,我尝试了不同的模拟器和设备。我还尝试了不同的项目设置和结构设置。 我还注意到一个非常相似的帖子没有得到回复: build failed because of "org.gradle.tooling.BuildException: invalid code lengths set"

我想补充一点,在同一台机器上制作的其他项目运行良好,并且在手机或虚拟设备上运行良好。

或者是 res/raw/shape_predictor_68_face_landmarks.dat 文件太大导致无法压缩?

或者,我应该删除当前的 android studio 并安装旧版本吗?

非常感谢您的任何建议!

【问题讨论】:

    标签: java android github gradle android-gradle-plugin


    【解决方案1】:

    我想出的方法是将您的项目级 gradle 降级到 3.1.0。它似乎正在努力。我认为导致问题的唯一原因是最新的 gradle 插件尝试验证项目中的每个文件,但它无法读取 shape_predictor_68_face_landmarks.dat。

    参考:https://github.com/tzutalin/dlib-android-app/issues/47

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2020-11-08
      • 1970-01-01
      • 2016-08-15
      • 1970-01-01
      相关资源
      最近更新 更多