React Native/React Native_error

[React Native - android] react-native-firebase_app:compileDebugJavaWithJavac FAILED

bocoder
728x90
반응형

* react-native 버전을 [0.61.5 -> 0.63.4] 로 변경 후 빌드 중 발생한 에러

 

> Task :react-native-firebase_app:compileDebugJavaWithJavac FAILED

...

/node_modules/@react-native-firebase/app/android/src/reactnative/java/io/invertase/firebase/app/ReactNativeFirebaseAppInitProvider.java:25: error: cannot find symbol
    BuildConfig.APPLICATION_ID + ".reactnativefirebaseappinitprovider";
               ^
  symbol:   variable APPLICATION_ID
  location: class BuildConfig
Note: /node_modules/@react-native-firebase/app/android/src/reactnative/java/io/invertase/firebase/utils/ReactNativeFirebaseUtilsModule.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
1 error

FAILURE: Build failed with an exception.



* What went wrong:
Execution failed for task ':react-native-firebase_app:compileDebugJavaWithJavac'.
> Compilation failed; see the compiler error output for 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

 

/app/android/src/reactnative/java/io/invertase/firebase/app/ReactNativeFirebaseAppInitProvider.java

상기 위치에 있는  APPLICATION_ID -->  LIBRARY_PACKAGE_NAME 로 바꾸면 된다고 한다.

* 참고 : https://github.com/invertase/react-native-firebase/issues/3254

 

 

결론은 react-native-firebase/ 관련 라이브러리의 버전이 6.7.1 낮아서 발생한 에러로 깔끔하게 최신 버전으로 변경함

npm i --save @react-native-firebase/app@latest @react-native-firebase/dynamic-links@latest @react-native-firebase/messaging@latest
// 변경 전

  "@react-native-firebase/app": "^6.7.1",
  "@react-native-firebase/dynamic-links": "^6.7.1",
  "@react-native-firebase/messaging": "^6.7.1",


// 변경 후

  "@react-native-firebase/app": "^12.1.0",
  "@react-native-firebase/dynamic-links": "^12.1.0",
  "@react-native-firebase/messaging": "^12.1.0",
728x90
반응형