android开发中遇到的问题和注意点
(1)放在drawble下的图片资源名称不能大写
(2)ScrollView只能容纳一个子视图
(3)报错:Algorithm HmacPBESHA256 not available。
解决:设置 => 构建、执行、部署 => 构建工具 => gradle,修改gradle JVM的版本为更高版本(比如jbr17)
(4)报错:Dependency 'androidx.lifecycle:lifecycle-viewmodel:2.6.2' requires libraries and applications that depend on it to compile against version 33 or later of the Android APIs.
解决:修改build.gradle文件相关属性为:compileSdk 33,targetSdk 33(或更高版本)
(5)报错:Duplicate class kotlin.collections.jdk8.CollectionsJDK8Kt found in modules kotlin-stdlib-1.8.22 (org.jetbrains.kotlin:kotlin-stdlib:1.8.22) and kotlin-stdlib-jdk8-1.7.21 (org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.7.21)
解决:在Gradle Scripts => build.gradle.kts => dependencies里添加:implementation(platform("org.jetbrains.kotlin:kotlin-bom:1.8.0"))