Android2024.2.1升级错误

提示 Gradle 版本不兼容,升级后就报错了 。

1.gradle安装包镜像

//distributionUrl=https\://services.gradle.org/distributions/gradle-8.5-bin.zip

distributionUrl=https://mirrors.cloud.tencent.com/gradle/gradle-8.5-bin.zip //镜像

2. Build报错:A failure occurred while executing com.android.build.gradle.internal.dexing.DexWorkAction

Gradle 8.5 Release Notes:Gradle8.5全面支持Java21

distributionUrl=https://services.gradle.org/distributions/gradle-8.5-bin.zip

classpath 'com.android.tools.build:gradle:8.3.0'

3.Namespace not specified. Specify a namespace in the module's build file.

app/build.gradle

apply plugin: 'com.android.application'

android {

namespace "com.hty.browser" //新增

compileSdkVersion 26

defaultConfig {

applicationId "com.hty.browser"

minSdkVersion 19

targetSdkVersion 26

}

}

4.Android Studio:case 错误: 需要常量表达式

https://blog.csdn.net/wchinaw/article/details/7325641

http://tools.android.com/tips/non-constant-fields

case 变量,不再支持,使用 if 代替。

快捷键:选中switch后,按alt+enter,选择replace为if..else

相关推荐
-SOLO-19 小时前
解决VMware 显示比例被重置的问题
android
alexhilton19 小时前
探究Android Views、Flutter和Compose如何渲染你的UI
android·kotlin·android jetpack
Lesile1 天前
Android:Hilt框架入门 · 在ViewUI和ComposeUI下的应用
android·android jetpack
用户423816229071 天前
Android 16 WebView 页面顶部挖孔/通知栏不能显示UI问题排查
android
weixin_727535621 天前
Loop 已死,Graph 新生:AI 工作流的范式革命
android·人工智能·rxjava
严同学正在努力1 天前
从备份到恢复:我用 30 分钟恢复了误删的核心业务表
android·java·数据库·ai
梦想三三1 天前
LangChain Output Parser 实战:从字符串到结构化数据的完整指南
android·服务器·langchain·github·uv
爱笑鱼1 天前
Binder(八):远端进程死了,BinderProxy 为什么还能收到通知?
android
Android-Flutter1 天前
Kotlin 冷流与热流详解
android·kotlin
zhangphil1 天前
Android ContentProvider/ContentResolver读图片,跨进程 IPC慢
android