简体   繁体   中英

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

I am trying to make dlib -android on Android Studio. It was downloaded from: https://github.com/tzutalin/dlib-android .

After changing a couple of things such as a mips64... file, it synced and built successfully. But when I try to run with a device or a virtual device, I always get

"Cause: invalid code lengths set" error. The run tasks ended at App:packageDebug. From the long list of things, three under compiler are more informative I guess:

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'.

I searched all over the places and tried everything I could find, but it did not work. Also, I cleaned the cache and restarted, I tried different emulator and devices. I also tried different project settings and structure settings. I also noticed that a very similar post was not answered: build failed because of "org.gradle.tooling.BuildException: invalid code lengths set"

I would like to add that other projects made on the same machine went through fine and ran well on phones or virtual devices.

Or, is it caused by the large res/raw/shape_predictor_68_face_landmarks.dat file that it could not compress?

Or, should I remove the current android studio and install an older version?

Thanks a lot for any suggestion!

I came up with is by downgrading your project level gradle to 3.1.0. It seems to be working on it. The only reason why I think it is causing the problem is latest gradle plugin try to validate every file in your project and somehow it cant read the shape_predictor_68_face_landmarks.dat.

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM