android 适配 api 35(android 15) 遇到的问题

server/2025/2/7 13:10:04/

 首先升级 targetSdkVersion 和 compileSdkVersion 到 35,升级后发生的报错

一、

解决方案:   升级gradle 和gradle 插件版本

com.android.tools.build:gradle -> 8.3.0-alpha02

gradle-wrapper.properties : distributionUrl -> gradle-8.6-bin.zip

https\://services.gradle.org/distributions/gradle-8.6-bin.zip

二、The project is using an incompatible version (AGP 8.3.0-alpha02) of the Android Gradle plugin. Latest supported version is AGP 7.3.1 See Android Studio & AGP compatibility options.

解决方案:升级as 解决报错  ,根据官网要求as升级到可兼容的AGP 版本

https://developer.android.com/studio/releases?hl=zh-cn#android_gradle_plugin_and_android_studio_compatibility

三、项目升级AGP到8.0+同步项目,遇到以下 2 个错误:

错误一: Namespace not specified. Specify a namespace in the module's build file. See https://d.android.com/r/tools/upgrade-assistant/set-namespace for information about setting the namespace.

If you've specified the package attribute in the source AndroidManifest.xml, you can use the AGP Upgrade Assistant to migrate to the namespace value in the build file. Refer to https://d.android.com/r/tools/upgrade-assistant/agp-upgrade-assistant for general information about using the AGP Upgrade Assistant.

解决方案:需要在app—> build.gradle 设置命名空间解决

https://developer.android.com/build/configure-app-module?hl=zh-cn#groovy

在每一个模块中,都有一个build.gradle文件和AndroidManifest.xml,现在需要做的就是把AndroidManifest.xml中package="com.aaa.bbb"包名添加到模块对应的build.gradle中。每一个模块都是这样,包括主App模块。

假设AndroidManifest.xml -> package=“com.aaa.bbb”

android {

        namespace "com.aaa.bbb"

}

错误二:Cause: com/android/tools/lint/model/LintModelSeverity has been compiled by a more recent version of the Java Runtime (class file version 61.0), this version of the Java Runtime only recognizes class file versions up to 55.0

java 类文件版本号 61.0,对应的是java 17

解决方案:升级 jdk 版本到  java 17


http://www.ppmy.cn/server/165683.html

相关文章

【LeetCode】5. 贪心算法:买卖股票时机

太久没更了,抽空学习下。 看一道简单题。 class Solution:def maxProfit(self, prices: List[int]) -> int:cost -1profit 0for i in prices:if cost -1:cost icontinueprofit_ i - costif profit_ > profit:profit profit_if cost > i:cost iret…

C#面试常考随笔12:游戏开发中常用的设计模式【C#面试题(中级篇)补充】

C#面试题(中级篇),详细讲解,帮助你深刻理解,拒绝背话术!-CSDN博客 简单工厂模式 优点: 根据条件有工厂类直接创建具体的产品 客户端无需知道具体的对象名字,可以通过配置文件创建…

基于Typescript,使用Vite构建融合Vue.js的Babylon.js开发环境

一、创建Vite项目 使用Vite初始化一个VueTypeScript项目: npm create vitelatest my-babylon-app -- --template vue-ts cd my-babylon-app npm create vitelatest my-babylon-app -- --template vue-ts 命令用于快速创建一个基于 Vite 的 Vue TypeScript 项目。…

Python分享10个Excel自动化脚本

在数据处理和分析的过程中,Excel文件是我们日常工作中常见的格式。通过Python,我们可以实现对Excel文件的各种自动化操作,提高工作效率。 本文将再次分享10个实用的Excel自动化脚本,以帮助新手小白更轻松地掌握这些技能。 1. Exc…

vue3新建组件库项目并上传到私库

创建vue3项目,步骤省略 # nexus配置 访问 http://192.168.0.9:8081/ 账号密码 admin Yanfabu01! 参考网址 https://www.jb51.net/javascript/3178205jj.htm # 项目满足的条件 [tsconfig.json]中 添加"baseUrl": "." [package.json]中 添加 &…

C++实现状态模式

首先上代码&#xff1a; #include <iostream> #include <memory>class Context;class State { public:virtual void Handle(Context * context) 0; //纯虚函数virtual ~State() default; //虚析构函数 };//创建状态A class ConcreateStateA : public State{…

【C++】STL——list的使用

目录 &#x1f495;1.带头双向链表List &#x1f495;2.list用法介绍 &#x1f495;3.list的初始化 &#x1f495;4.size函数与resize函数 &#x1f495;5.empty函数 &#x1f495;6.front函数与back函数 &#x1f495;7.push_front,push_back,pop_front,pop_back函数…

Linux 内核模块 | 加载 / 添加 / 删除 / 优先级

注&#xff1a;本文为 “Linux 内核模块加载 / 添加 / 删除 / 优先级” 相关文章合辑。 机翻&#xff0c;未校。 未整理去重。 How Linux Kernel Boots? Linux 内核如何启动&#xff1f; Last Updated: 26 Apr, 2023 Many processes are running in the background when …