java 解析覆盖失败 - Aapt2 - Android Studio

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/49937403/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-11-03 10:29:36  来源:igfitidea点击:

failed parsing overlays - Aapt2 - Android Studio

javaandroidparsingoverlaysaapt2

提问by Cyril

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)

我正在尝试在 Android Studio 中将 dlib 用于我大学的项目。我确实导入了我需要的所有 .so 文件,但我无法导入shape_predictor_68_face_landmarks.dat...(我想将其作为原始文件导入)

I get AAPT2 error: check logs for detailsand 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.

我明白AAPT2 error: check logs for details了,Java 编译器说failed parsing overlays. 你知道我能做些什么来解决这个问题吗?我从未见过关于failed parsing overlays.

I already tried to put android.enableAapt2=falsein the gradle.propertiesand the testOptionsin the gradle.buildwithout success...

我已经试图把android.enableAapt2=falsegradle.propertiestestOptionsgradle.build没有成功...

You can find the build log here : Build log

您可以在此处找到构建日志:构建日志

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

和这里的项目:https: //github.com/ghysc/Stage

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

如果您需要更多信息,请告诉我。

Thanks for reading.

谢谢阅读。

Cyril G

西里尔·G

回答by Izabela Orlowska

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:

使用您的 GitHub 项目,我发现您拥有的资源文件之一存在问题 - AAPT2 无法处理它:

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

./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:

这是 AAPT2 中的一个错误,但最近已修复。
因此,如果您将 build.gradle 文件中的 android gradle 插件版本更新为 3.2.0-alpha11 或更高版本,则一切都可以正常编译:

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

回答by Cyril

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 !

呵呵,其实我只是换个方式解决了这个问题。当我导入tzutalin的项目(:github.com/tzutalin/dlib-android-app)时,我更改了包的名称,这就是为什么我的程序找不到库在哪里存储的原因!

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

package com.tzutalin.dlib;为 dlib 库重新命名了包,现在一切正常。