我目前正在尝试构建一个社交媒体应用程序,并且正在设置导航。现在,当我添加一些包(例如 react-native-screens 和 react-native-reanimate)时,我的项目无法构建。代码中甚至没有提到这些包,因为我在开始编写任何东西之前安装了所需的包。这些是我得到的错误
反应原生屏幕:
info Running jetifier to migrate libraries to AndroidX. You can disable it using "--no-jetifier" flag.
Jetifier found 944 file(s) to forward-jetify. Using 16 workers...
info JS server already running.
info Installing the app...
> Configure project :@react-native-firebase_app
:@react-native-firebase_app package.json found at C:\Users\xavie\talks_react_native\node_modules\@react-native-firebase\app\package.json
:@react-native-firebase_app:firebase.bom using default value: 29.0.0
:@react-native-firebase_app:play.play-services-auth using default value: 19.2.0
:@react-native-firebase_app package.json found at C:\Users\xavie\talks_react_native\node_modules\@react-native-firebase\app\package.json
:@react-native-firebase_app:version set from package.json: 13.0.0 (13,0,0 - 13000000)
:@react-native-firebase_app:android.compileSdk using custom value: 29
:@react-native-firebase_app:android.targetSdk using custom value: 29
:@react-native-firebase_app:android.minSdk using custom value: 16
:@react-native-firebase_app:reactNativeAndroidDir C:\Users\xavie\talks_react_native\node_modules\react-native\android
> Task :react-native-screens:compileDebugKotlin FAILED
56 actionable tasks: 47 executed, 9 up-to-date
e: C:\Users\xavie\talks_react_native\node_modules\react-native-screens\android\src\main\java\com\swmansion\rnscreens\ScreenStackHeaderConfig.kt: (20, 38): Unresolved reference: ReactTypefaceUtils
e: C:\Users\xavie\talks_react_native\node_modules\react-native-screens\android\src\main\java\com\swmansion\rnscreens\ScreenStackHeaderConfig.kt: (206, 37): Unresolved reference: ReactTypefaceUtils
e: C:\Users\xavie\talks_react_native\node_modules\react-native-screens\android\src\main\java\com\swmansion\rnscreens\ScreenStackHeaderConfig.kt: (325, 28): Unresolved reference: ReactTypefaceUtils
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':react-native-screens:compileDebugKotlin'.
> Compilation error. See log for more details
* 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 FAILED in 6s
error Failed to install the app. Make sure you have the Android development environment set up: https://facebook.github.io/react-native/docs/getting-started.html#android-development-environment. Run CLI with --verbose flag for more details.
Error: Command failed: gradlew.bat app:installDebug -PreactNativeDevServerPort=8081
e: C:\Users\xavie\talks_react_native\node_modules\react-native-screens\android\src\main\java\com\swmansion\rnscreens\ScreenStackHeaderConfig.kt: (20, 38): Unresolved reference: ReactTypefaceUtils
e: C:\Users\xavie\talks_react_native\node_modules\react-native-screens\android\src\main\java\com\swmansion\rnscreens\ScreenStackHeaderConfig.kt: (206, 37): Unresolved reference: ReactTypefaceUtils
e: C:\Users\xavie\talks_react_native\node_modules\react-native-screens\android\src\main\java\com\swmansion\rnscreens\ScreenStackHeaderConfig.kt: (325, 28): Unresolved reference: ReactTypefaceUtils
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':react-native-screens:compileDebugKotlin'.
> Compilation error. See log for more details
* 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 FAILED in 6s
at checkExecSyncError (child_process.js:760:11)
at execFileSync (child_process.js:797:15)
at runOnAllDevices (C:\Users\xavie\talks_react_native\node_modules\react-native\node_modules\@react-native-community\cli-platform-android\build\commands\runAndroid\runOnAllDevices.js:94:39)
at buildAndRun (C:\Users\xavie\talks_react_native\node_modules\react-native\node_modules\@react-native-community\cli-platform-android\build\commands\runAndroid\index.js:179:41)
at C:\Users\xavie\talks_react_native\node_modules\react-native\node_modules\@react-native-community\cli-platform-android\build\commands\runAndroid\index.js:133:12
at processTicksAndRejections (internal/process/task_queues.js:95:5)
at async Command.handleAction (C:\Users\xavie\talks_react_native\node_modules\react-native\node_modules\@react-native-community\cli\build\index.js:182:9)
反应原生复活:
> Task :app:mergeDebugResources FAILED
15 actionable tasks: 11 executed, 4 up-to-date
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:mergeDebugResources'.
> Could not resolve all files for configuration ':app:debugRuntimeClasspath'.
> Failed to transform react-native-reanimated-61-jsc.aar (project :react-native-reanimated) to match attributes {artifactType=android-res}.
> Execution failed for JetifyTransform: C:\Users\xavie\talks_react_native\node_modules\react-native-reanimated\android\react-native-reanimated-61-jsc.aar.
> Transform's input file does not exist: C:\Users\xavie\talks_react_native\node_modules\react-native-reanimated\android\react-native-reanimated-61-jsc.aar. (See https://issuetracker.google.com/issues/158753935)
* 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 FAILED in 2s
error Failed to install the app. Make sure you have the Android development environment set up: https://facebook.github.io/react-native/docs/getting-started.html#android-development-environment. Run CLI with --verbose flag for more details.
Error: Command failed: gradlew.bat app:installDebug -PreactNativeDevServerPort=8081
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:mergeDebugResources'.
> Could not resolve all files for configuration ':app:debugRuntimeClasspath'.
> Failed to transform react-native-reanimated-61-jsc.aar (project :react-native-reanimated) to match attributes {artifactType=android-res}.
> Execution failed for JetifyTransform: C:\Users\xavie\talks_react_native\node_modules\react-native-reanimated\android\react-native-reanimated-61-jsc.aar.
> Transform's input file does not exist: C:\Users\xavie\talks_react_native\node_modules\react-native-reanimated\android\react-native-reanimated-61-jsc.aar. (See https://issuetracker.google.com/issues/158753935)
* 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 FAILED in 2s
at checkExecSyncError (child_process.js:760:11)
at execFileSync (child_process.js:797:15)
at runOnAllDevices (C:\Users\xavie\talks_react_native\node_modules\react-native\node_modules\@react-native-community\cli-platform-android\build\commands\runAndroid\runOnAllDevices.js:94:39)
at buildAndRun (C:\Users\xavie\talks_react_native\node_modules\react-native\node_modules\@react-native-community\cli-platform-android\build\commands\runAndroid\index.js:179:41)
at C:\Users\xavie\talks_react_native\node_modules\react-native\node_modules\@react-native-community\cli-platform-android\build\commands\runAndroid\index.js:133:12
at processTicksAndRejections (internal/process/task_queues.js:95:5)
at async Command.handleAction (C:\Users\xavie\talks_react_native\node_modules\react-native\node_modules\@react-native-community\cli\build\index.js:182:9)
为什么会这样????