1.缺少需要的ndk版本
在as中下载所需的ndk版本
2.Could not compile build file ‘D:\XXX\Gallery\NewGallery2_0619\NewGallery2\build.gradle’.
startup failed:
build file ‘D:\XXX\Gallery\NewGallery2_0619\NewGallery2\build.gradle’: 79:
(work - runtime) is a binary expression, but it should be a variable expression at line: 79 column: 17. File: BuildScript @ line 79, column 17.
work-runtime= “2.7.1”
修改work-runtime为work,并将各个module的build.gradle中implementation "androidx.work:work-runtime:$rootProject.work-runtime"一行中最后的-runtime移除。
3.错误: 找不到符号–>符号: 类 SystemProperties–>位置: 程序包 android.os.SystemProperties;
将out/soong/.intermediates/frameworks/base/framework-minus-apex/android_common/combined/framework-minus-apex.jar重命名为framework.jar并存入新建的studio_libs/unisoc_framework目录下
在使用到android.os.SystemProperties的module的build.gradlede中添加以下code:
buildscript {
gradle.projectsEvaluated {
tasks.withType(JavaCompile) {
options.compilerArgs.add("-Xbootclasspath/p:${rootDir}/studio_libs/unisoc_framework/framework.jar")
}
}
}
4.XXX\Gallery\NewGallery2_0619\NewGallery2\module_gallerycommon\src\main\java\com\android\fw\OnMediaKeyListener.java:7: 错误: 无法访问KeyEvent
import android.view.KeyEvent;
^
错误的类文件: D:\XXX\Gallery\NewGallery2_0619\NewGallery2\studio_libs\unisoc_framework\framework.jar(android/view/KeyEvent.class)
类文件具有错误的版本 55.0, 应为 52.0
请删除该文件或确保该文件位于正确的类路径子目录中。
修改项目jdk版本为11
5.AAPT: error: unexpected element found in .
升级gradle版本至6.7.1以上
遇到Cannot set the value of read-only property ‘classDirectories’ for task ‘:app_discover:jacocoTestReport’ of type org.gradle.testing.jacoco.tasks.JacocoReport.类似问题时将build.gradle文件中的classDirectories = …改为classDirectories.from =…
6.Cause: compileSdkVersion is not specified. Please add it to build.gradle
修改compileSdkVersion至33
7.2 files found with path ‘lib/armeabi-v7a/libjni_sprd_fv.so’.
注释掉各module build.gradle中类似以下代码:
if (!project.hasProperty("ignoreso")) {
jniLibs.srcDirs = ['libs']
}
8.Execution failed for task ‘:app_go:validateSigningDebug’.
Keystore file ‘D:\XXX\Gallery\NewGallery2_0619\NewGallery2\platform.keystore’ not found for signing config ‘debug’.
将以下代码注释掉,或者使用自己的签名
debug {
storeFile file('../platform.keystore')
storePassword 'android'
keyAlias = 'platform'
keyPassword 'android'
}