React & React Native/오류노트
[RN/오류노트] Solved - Task :@react-native-firebase_analytics:copyReleaseJniLibsProjectAndLocalJars FAILED
adjh54
2023. 10. 23. 11:34
반응형
해당 글에서는 React-native에서 firebase_analytics를 APK 파일을 구성하는 단계에서 발생하는 오류와 해결 방법에 대해 알아봅니다.
1) 문제점
💡 아래와 같은 문제가 발생하였습니다.
- @react-native-firebase_analytics:copyReleaseJniLibsProjectAndLocalJars
> Task :@react-native-firebase_analytics:copyReleaseJniLibsProjectAndLocalJars FAILED
FAILURE: Build failed with an exception.
* What went wrong:
A problem was found with the configuration of task ':@react-native-firebase_analytics:copyReleaseJniLibsProjectAndLocalJars' (type 'LibraryJniLibsTask').
- Gradle detected a problem with the following location: '/Users/lee/Desktop/workspace/tugboat/tugboat-mobile/node_modules/@react-native-firebase/analytics/android/build/intermediates/stripped_native_libs/release/out'.
Reason: Task ':@react-native-firebase_analytics:copyReleaseJniLibsProjectAndLocalJars' uses this output of task ':react-native-firebase_analytics:stripReleaseDebugSymbols' without declaring an explicit or implicit dependency. This can lead to incorrect results being produced, depending on what order the tasks are executed.
Possible solutions:
1. Declare task ':react-native-firebase_analytics:stripReleaseDebugSymbols' as an input of ':@react-native-firebase_analytics:copyReleaseJniLibsProjectAndLocalJars'.
2. Declare an explicit dependency on ':react-native-firebase_analytics:stripReleaseDebugSymbols' from ':@react-native-firebase_analytics:copyReleaseJniLibsProjectAndLocalJars' using Task#dependsOn.
3. Declare an explicit dependency on ':react-native-firebase_analytics:stripReleaseDebugSymbols' from ':@react-native-firebase_analytics:copyReleaseJniLibsProjectAndLocalJars' using Task#mustRunAfter.
Please refer to <https://docs.gradle.org/8.0.1/userguide/validation_problems.html#implicit_dependency> for more details about this problem.
* 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>
Deprecated Gradle features were used in this build, making it incompatible with Gradle 9.0.
You can use '--warning-mode all' to show the individual deprecation warnings and determine if they come from your own scripts or plugins.
See <https://docs.gradle.org/8.0.1/userguide/command_line_interface.html#sec:command_line_warnings>
반응형
2) 해결방법
💡 아래와 같은 환경에서 구성을 하였습니다. 또한 아래의 글에 따라 구성을 하면 문제가 없음을 확인하였습니다.
개발환경 | 버전 |
react-native | 0.72.4 |
@react-native-community/cli | 9.3.4 |
💡 저는 아래와 같이 setting.gradle 파일 내에 include ':@react-native-firebase_analytics'가 추가되어 있어서 발생하는 문제였습니다.
apply from: file("../node_modules/@react-native-community/cli-platform-android/native_modules.gradle"); applyNativeModulesSettingsGradle(settings)
include ':app'
includeBuild('../node_modules/@react-native/gradle-plugin')
include ':react-native-fs'
project(':react-native-fs').projectDir = new File(settingsDir, '../node_modules/react-native-fs/android')
// include ':@react-native-firebase_analytics'
// project(':@react-native-firebase_analytics').projectDir = new File(rootProject.projectDir, './../node_modules/@react-native-firebase/analytics/android')
apply from: new File(["node", "--print", "require.resolve('expo/package.json')"].execute(null, rootDir).text.trim(), "../scripts/autolinking.gradle")
useExpoModules()
💡 react-native 버전에 따라 사용할 수 있는 상황이 다른것 같습니다 아래의 글을 참고하시면 도움이 될 것 같습니다.
반응형