Android 12 S artifact_path_requirements Offending entries Build failed ckati failed with/ aosp预制apk

Posted learnframework

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Android 12 S artifact_path_requirements Offending entries Build failed ckati failed with/ aosp预制apk相关的知识,希望对你有一定的参考价值。

粉丝朋友在学习我的课程内置应用时候,发现如果在android 12 S上预制apk时候发现有编译不过情况,报artifact_path_requirements相关错误
入门课,实战课,跨进程专题
ps需要学习深入framework课程和课程优惠
(可以加我qq:2102309716 优惠购买)
具体错误显示如下:

build/make/core/artifact_path_requirements.mk:26: warning:  build/make/target/product/sdk_phone_x86_64.mk produces files inside build/make/target/product/generic_system.mks artifact path requirement. 
Offending entries:
system/app/MyApp/MyApp.apk
In file included from build/make/core/main.mk:1383:
build/make/core/artifact_path_requirements.mk:26: error: Build failed.
00:42:13 ckati failed with: exit status 1

这里乍一看估计99%的人都不知道怎么回事,这里其实可以从提示是可以看出来:
大概是因为新版本artifact_path_requirements有对预装相关东西进行了规则检测,发现system/app/MyApp/MyApp.apk这种预制到system/app的情况属于违规了。
那么具体怎么解决呢?

通过在github寻找到了一些第三方rom维护者也有遇到类似问题,参考他们解决方案,自己这边再消化后,我的修改如下:

diff --git a/envsetup.sh b/envsetup.sh
index 16873095aa..8c4a8c62e6 100644
--- a/envsetup.sh
+++ b/envsetup.sh
@@ -211,7 +211,7 @@ function setpaths()
     local targetgccversion=$(get_build_var TARGET_GCC_VERSION)
     local targetgccversion2=$(get_build_var 2ND_TARGET_GCC_VERSION)
     export TARGET_GCC_VERSION=$targetgccversion
-
+    export DISABLE_ARTIFACT_PATH_REQUIREMENTS="true"
     # The gcc toolchain does not exists for windows/cygwin. In this case, do not reference it.
     export ANDROID_TOOLCHAIN=
     export ANDROID_TOOLCHAIN_2ND_ARCH=

即build/envsetup.sh 加上export DISABLE_ARTIFACT_PATH_REQUIREMENTS="true"就可以顺利编译通过不再报artifact_path_requirements错误,这里其实就相当于把新版本编译系统中artifact_path_requirements检测关闭就可以

附一下成功图片:

成功apk路径:

以上是关于Android 12 S artifact_path_requirements Offending entries Build failed ckati failed with/ aosp预制apk的主要内容,如果未能解决你的问题,请参考以下文章

ubuntu 20.04 aosp 13/android s/android T/android12/android13 build

android Input专题- Q/R/S 10/11/12 InputManager源码分析

Android 12(S)新特性小结

android Input专题- Q/R/S 10/11/12 InputManager源码分析

android Input专题- Q/R/S 10/11/12 InputManager源码分析

Android facebook-login 库 11.2.0 崩溃 Android 12 - 定位 S+(版本 31 及更高版本)需要 FLAG_IMMUTABLE 或 FLAG_MUTABLE 之