我正在创建一个 React 原生项目。但是当我输入 npx react-native run-android
命令时,出现以下错误。
> Task :app:compileDebugJavaWithJavac FAILED
18 actionable tasks: 18 executed
/Users/Cans/Desktop/react-egitimi/introduction/loginPageProject/android/app/src/main/java/com/loginapp/MainApplication.java:19: error: cannot find symbol
return BuildConfig.DEBUG;
^
symbol: variable BuildConfig
Note: /Users/Cans/Desktop/react-egitimi/introduction/loginPageProject/android/app/src/debug/java/com/loginpageproject/ReactNativeFlipper.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
1 error
FAILURE: Build failed with an exception.
* Get more help at https://help.gradle.org
BUİLD FAILED in 18s
error Failed to install the app. Make sure you have the Android development environment set up: https://reactnative.dev/docs/environment-setup.
Error: Command failed: ./gradlew app:installDebug -PreactNativeDevServerPort=8081
/Users/Cans/Desktop/react-egitimi/introduction/loginPageProject/android/app/src/main/java/com/loginapp/MainApplication.java:19: error: cannot find symbol
return BuildConfig.DEBUG;
^
symbol: variable BuildConfig
Note: /Users/Cans/Desktop/react-egitimi/introduction/loginPageProject/android/app/src/debug/java/com/loginpageproject/ReactNativeFlipper.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
1 error
FAILURE: Build failed with an exception.
我尝试删除 gradle 但它再次给出相同的结果。有什么解决办法?