展锐NewGallery2移植AndroidStudio指南(2024)

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'
        }
  • 5
    点赞
  • 10
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值