android 是什么导致了React Native app build.gradle文件中的“compileSdkVersion is not specified”错误?

egdjgwm8  于 2023-05-27  发布在  Android
关注(0)|答案(1)|浏览(212)
$ npx react-native run-android
info Starting JS server...
info Installing the app...
5 actionable tasks: 5 up-to-date
                                                                                                                                  
FAILURE: Build completed with 2 failures.                                                                                         

1: Task failed with an exception.
-----------
* Where:
Build file 'C:\Users\prami\OneDrive\Desktop\Gps_Tracker\node_modules\react-native-safe-area-context\android\build.gradle' line: 26

* What went wrong:
A problem occurred evaluating project ':react-native-safe-area-context'.
> Could not initialize class org.jetbrains.kotlin.gradle.plugin.KotlinGradleBuildServices

* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.
==============================================================================

2: Task failed with an exception.
-----------
* What went wrong:
A problem occurred configuring project ':react-native-safe-area-context'.
> compileSdkVersion is not specified. Please add it to build.gradle

* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.
==============================================================================

* Get more help at https://help.gradle.org

我面临的问题,从过去三天仍然无法解决任何人可以帮助我解决这个问题。
我检查了build.gradle文件中的compileSdkVersion,一切都很好,但仍然出现错误?

0qx6xfy6

0qx6xfy61#

嘿你试过清理项目了吗?在命令行上运行以下命令

cd android &&./gradlew clean

相关问题