Cyril
Cyril

Reputation: 51

failed parsing overlays - Aapt2 - Android Studio

I'm trying to use dlib in Android Studio for my university's project. I did import all the .so files that I needed, but I can't import the shape_predictor_68_face_landmarks.dat... (I want to import it as a raw file)

I get AAPT2 error: check logs for details and the Java compiler says failed parsing overlays. Do you know what can I do to fix this ? I've never seen a topic about failed parsing overlays.

I already tried to put android.enableAapt2=false in the gradle.properties and the testOptions in the gradle.build without success...

You can find the build log here : Build log

And the project here : https://github.com/ghysc/Stage

If you need any more information, please let me know.

Thanks for reading.

Cyril G

Upvotes: 4

Views: 15250

Answers (2)

Cyril
Cyril

Reputation: 51

Huh, actually I just solved this problem in another way. When I imported the project of tzutalin ( : github.com/tzutalin/dlib-android-app), I changed the name of the package, which is why my program couldn't find where the library where stored !

I re-named the package package com.tzutalin.dlib; for the dlib library and everything is fine now.

Upvotes: 1

Izabela Orlowska
Izabela Orlowska

Reputation: 7532

Using your GitHub project I found out it was a problem with one of the resource files you had - it was too big for AAPT2 to process:

./app/src/main/res/raw/shape_predictor_68_face_landmarks.dat

This was a bug in AAPT2 but it has been fixed recently.
So if you update your android gradle plugin version in your build.gradle file to 3.2.0-alpha11 or newer it all compiles fine:

classpath 'com.android.tools.build:gradle:3.2.0-alpha11'

Upvotes: 7

Related Questions