[英]Internal Error occurred while analyzing this expression error in Android Studio Dolphin 2021.3.1
After updating Android Studio all lines that get resources like String, Drawbles,... show this error:更新 Android Studio 后,所有获取 String、Drawbles 等资源的行都显示此错误:
Internal Error occurred while analyzing this expression
分析此表达式时发生内部错误
What is wrong?怎么了?
Solution 1:解决方案 1:
You can try File -> Invalidate Caches .您可以尝试File -> Invalidate Caches 。
Solution 2:解决方案 2:
If this happened after update to Dolphin 2021.3.1
than better to upgrade Android Gradle Plugin .如果这发生在更新到
Dolphin 2021.3.1
之后,最好升级Android Gradle 插件。 It can be done by click on Upgrade in message Project update recommended.可以通过在消息项目更新建议中单击升级来完成。 Android Gradle Plugin can be upgraded.
Android Gradle 插件可以升级。 which can appear in right bottom corner after project opening.
项目打开后会出现在右下角。 In Upgrade assistant window check the variant Upgrade and click Run selected steps .
在Upgrade assistant window 中选中变体Upgrade并单击Run selected steps 。 Also you can open assistant manually: Tools -> AGP Upgrade Assistant .
您也可以手动打开助手:工具-> AGP 升级助手。
After migration finished also some of your libraries versions will be updated.迁移完成后,您的一些库版本也会更新。 For me the version of
androidx.navigation:navigation-fragment-ktx
changed to 2.4.1
.对我来说,
androidx.navigation:navigation-fragment-ktx
的版本更改为2.4.1
。
The version of com.android.tools.build.gradle
can be updated to 7.3.0
. com.android.tools.build.gradle
版本可以更新到7.3.0
。
dependencies {
classpath 'com.android.tools.build:gradle:7.3.0'
}
Gradle wrapper can be updated to version 7.4
. Gradle wrapper 可以更新到
7.4
版。
distributionBase=GRADLE_USER_HOME
distributionUrl=https\://services.gradle.org/distributions/gradle-7.4-bin.zip
distributionPath=wrapper/dists
zipStorePath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
I also manually updated the version of com.android.tools:desugar_jdk_libs
to 1.1.5
because I was facing error Didn't find class "java.lang.Math8" on path: DexPathList while launching my apps.我还手动将
com.android.tools:desugar_jdk_libs
的版本更新为1.1.5
,因为我在启动应用程序时遇到错误Didn't find class "java.lang.Math8" on path: DexPathList 。
coreLibraryDesugaring 'com.android.tools:desugar_jdk_libs:1.1.5'
Update your android gradle plugin to version 7.3.0.将您的 android gradle 插件更新到版本 7.3.0。 It helped in my case, I had the same issue on 7.0.3 version
它对我有帮助,我在 7.0.3 版本上遇到了同样的问题
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.