[🐛] Android building FAILED with Execution failed for task ':app:compileDebugKotlin' with react-native 0.73.1
Issue
Describe your issue here
Hi, dear firebase community There is a problem with firebase after I updated react-native from version 0.72.6 to 0.73.1
Why am I sure that problem because of connecting firebase? Because I created the clear project using react-native and It was working. Once I set up firebase for it. The application is crashing
Here is a repository to reproduce it
Project Files
Javascript
Click To Expand
package.json:
# N/A
firebase.json for react-native-firebase v6:
# N/A
iOS
Click To Expand
ios/Podfile:
- [ ] I'm not using Pods
- [x] I'm using Pods and my Podfile looks like:
# N/A
AppDelegate.m:
// N/A
Android
Click To Expand
Have you converted to AndroidX?
- [ ] my application is an AndroidX application?
- [ ] I am using
android/gradle.settingsjetifier=truefor Android compatibility? - [ ] I am using the NPM package
jetifierfor react-native compatibility?
android/build.gradle:
// N/A
android/app/build.gradle:
// N/A
android/settings.gradle:
// N/A
MainApplication.java:
// N/A
AndroidManifest.xml:
<!-- N/A -->
Environment
Click To Expand
react-native info output:
System:
OS: macOS 14.1.1
CPU: (10) arm64 Apple M1 Pro
Memory: 122.02 MB / 16.00 GB
Shell:
version: "5.9"
path: /bin/zsh
Binaries:
Node:
version: 18.12.0
path: ~/.nvm/versions/node/v18.12.0/bin/node
Yarn:
version: 1.22.19
path: /usr/local/bin/yarn
npm:
version: 8.19.2
path: ~/.nvm/versions/node/v18.12.0/bin/npm
Watchman:
version: 2023.09.04.00
path: /opt/homebrew/bin/watchman
Managers:
CocoaPods:
version: 1.14.3
path: /Users/apotapov/.rvm/gems/ruby-3.0.0/bin/pod
SDKs:
iOS SDK:
Platforms:
- DriverKit 23.2
- iOS 17.2
- macOS 14.2
- tvOS 17.2
- watchOS 10.2
Android SDK: Not Found
IDEs:
Android Studio: 2021.2 AI-212.5712.43.2112.8609683
Xcode:
version: 15.1/15C65
path: /usr/bin/xcodebuild
Languages:
Java:
version: 17.0.9
path: /usr/bin/javac
Ruby:
version: 3.0.0
path: /Users/apotapov/.rvm/rubies/ruby-3.0.0/bin/ruby
npmPackages:
"@react-native-community/cli": Not Found
react:
installed: 18.2.0
wanted: 18.2.0
react-native:
installed: 0.73.1
wanted: 0.73.1
react-native-macos: Not Found
npmGlobalPackages:
"*react-native*": Not Found
Android:
hermesEnabled: true
newArchEnabled: false
iOS:
hermesEnabled: Not found
newArchEnabled: false
- Platform that you're experiencing the issue on:
- [ ] iOS
- [x] Android
- [ ] iOS but have not tested behavior on Android
- [ ] Android but have not tested behavior on iOS
- [ ] Both
react-native-firebaseversion you're using that has this issue:18.7.3
Firebasemodule(s) you're using that has the issue:e.g. Instance ID
- Are you using
TypeScript?Y/N&VERSION
- 👉 Check out
React Native FirebaseandInvertaseon Twitter for updates on the library.
Please could you paste the actual error message you are seeing in here? The repo link doesn't have the message and there is no example of it here. Put it in triple-backticks so it's formatted well like
Paste from the command line session where you tried your build and there was an error message, including the entire error message
@mikehardy thanks for your response
Here is error stack trace
Starting a Gradle Daemon (subsequent builds will be faster)
> Task :gradle-plugin:pluginDescriptors
> Task :gradle-plugin:processResources
> Task :gradle-plugin:compileKotlin
> Task :gradle-plugin:compileJava NO-SOURCE
> Task :gradle-plugin:classes
> Task :gradle-plugin:jar
> Task :gradle-plugin:inspectClassesForKotlinIC
> Configure project :react-native-firebase_app
:react-native-firebase_app package.json found at /Users/apotapov/Desktop/DEVELOPMENT/react-native-firebase-error/node_modules/@react-native-firebase/app/package.json
:react-native-firebase_app:firebase.bom using default value: 32.7.0
:react-native-firebase_app:play.play-services-auth using default value: 20.7.0
:react-native-firebase_app package.json found at /Users/apotapov/Desktop/DEVELOPMENT/react-native-firebase-error/node_modules/@react-native-firebase/app/package.json
:react-native-firebase_app:version set from package.json: 18.7.3 (18,7,3 - 18007003)
:react-native-firebase_app:android.compileSdk using custom value: 34
:react-native-firebase_app:android.targetSdk using custom value: 34
:react-native-firebase_app:android.minSdk using custom value: 21
:react-native-firebase_app:reactNativeAndroidDir /Users/apotapov/Desktop/DEVELOPMENT/react-native-firebase-error/node_modules/react-native/android
> Task :app:generateCodegenSchemaFromJavaScript SKIPPED
> Task :app:generateCodegenArtifactsFromSchema SKIPPED
> Task :app:generatePackageList
> Task :app:preBuild
> Task :app:preDebugBuild
> Task :app:generateDebugBuildConfig
> Task :react-native-firebase_app:preBuild UP-TO-DATE
> Task :react-native-firebase_app:preDebugBuild UP-TO-DATE
> Task :react-native-firebase_app:writeDebugAarMetadata
> Task :app:generateDebugResValues
> Task :app:processDebugGoogleServices
> Task :react-native-firebase_app:generateDebugResValues
> Task :react-native-firebase_app:generateDebugResources
> Task :app:checkDebugAarMetadata
> Task :react-native-firebase_app:packageDebugResources
> Task :app:mapDebugSourceSetPaths
> Task :app:generateDebugResources
> Task :app:packageDebugResources
> Task :app:createDebugCompatibleScreenManifests
> Task :app:extractDeepLinksDebug
> Task :react-native-firebase_app:extractDeepLinksDebug
> Task :react-native-firebase_app:compileDebugLibraryResources
> Task :react-native-firebase_app:generateDebugBuildConfig
> Task :app:mergeDebugResources
> Task :react-native-firebase_app:javaPreCompileDebug
> Task :app:javaPreCompileDebug
> Task :react-native-firebase_app:parseDebugLocalResources
> Task :app:mergeDebugShaders
> Task :app:compileDebugShaders NO-SOURCE
> Task :app:generateDebugAssets UP-TO-DATE
> Task :react-native-firebase_app:mergeDebugShaders
> Task :react-native-firebase_app:compileDebugShaders NO-SOURCE
> Task :react-native-firebase_app:generateDebugAssets UP-TO-DATE
> Task :app:parseDebugLocalResources
> Task :react-native-firebase_app:packageDebugAssets
> Task :react-native-firebase_app:processDebugManifest
package="io.invertase.firebase" found in source AndroidManifest.xml: /Users/apotapov/Desktop/DEVELOPMENT/react-native-firebase-error/node_modules/@react-native-firebase/app/android/src/main/AndroidManifest.xml.
Setting the namespace via the package attribute in the source AndroidManifest.xml is no longer supported, and the value is ignored.
Recommendation: remove package="io.invertase.firebase" from the source AndroidManifest.xml: /Users/apotapov/Desktop/DEVELOPMENT/react-native-firebase-error/node_modules/@react-native-firebase/app/android/src/main/AndroidManifest.xml.
> Task :app:mergeDebugAssets
> Task :app:processDebugMainManifest
> Task :app:processDebugManifest
> Task :app:compressDebugAssets
> Task :react-native-firebase_app:generateDebugRFile
> Task :app:desugarDebugFileDependencies
> Task :react-native-firebase_app:compileDebugJavaWithJavac
> Task :react-native-firebase_app:processDebugJavaRes NO-SOURCE
> Task :react-native-firebase_app:bundleLibRuntimeToJarDebug
> Task :react-native-firebase_app:bundleLibCompileToJarDebug
> Task :app:mergeDebugJniLibFolders
> Task :react-native-firebase_app:mergeDebugJniLibFolders
> Task :react-native-firebase_app:mergeDebugNativeLibs NO-SOURCE
> Task :app:validateSigningDebug
> Task :react-native-firebase_app:copyDebugJniLibsProjectOnly
> Task :app:writeDebugAppMetadata
> Task :app:checkDebugDuplicateClasses
> Task :app:writeDebugSigningConfigVersions
> Task :app:processDebugManifestForPackage
> Task :app:processDebugResources
> Task :app:mergeDebugNativeLibs
> Task :app:compileDebugKotlin FAILED
> Task :app:mergeLibDexDebug
> Task :app:stripDebugDebugSymbols
> Task :app:mergeExtDexDebug
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.
For more on this, please refer to https://docs.gradle.org/8.3/userguide/command_line_interface.html#sec:command_line_warnings in the Gradle documentation.
52 actionable tasks: 52 executed
info 💡 Tip: Make sure that you have set up your development environment correctly, by running npx react-native doctor. To read more about doctor command visit: https://github.com/react-native-community/cli/blob/main/packages/cli-doctor/README.md#doctor
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
e: file:///Users/apotapov/Desktop/DEVELOPMENT/react-native-firebase-error/android/app/src/main/java/com/awesomeproject/MainApplication.kt:27:58 Unresolved reference: BuildConfig
e: file:///Users/apotapov/Desktop/DEVELOPMENT/react-native-firebase-error/android/app/src/main/java/com/awesomeproject/MainApplication.kt:29:50 Unresolved reference: BuildConfig
e: file:///Users/apotapov/Desktop/DEVELOPMENT/react-native-firebase-error/android/app/src/main/java/com/awesomeproject/MainApplication.kt:30:49 Unresolved reference: BuildConfig
e: file:///Users/apotapov/Desktop/DEVELOPMENT/react-native-firebase-error/android/app/src/main/java/com/awesomeproject/MainApplication.kt:39:9 Unresolved reference: BuildConfig
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:compileDebugKotlin'.
> A failure occurred while executing org.jetbrains.kotlin.compilerRunner.GradleCompilerRunnerWithWorkers$GradleKotlinCompilerWorkAction
> 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 23s
info Run CLI with --verbose flag for more details.
Please could you paste the actual error message you are seeing in here? The repo link doesn't have the message and there is no example of it here. Put it in triple-backticks so it's formatted well like
Paste from the command line session where you tried your build and there was an error message, including the entire error message
I provided android building logs. Please help to solve this problem. Obviously the problem is with firebase
Obviously the problem is with firebase
Statements like this are so frequently wrong when troubleshooting software they should mentally throw up a red flag for you any time you have the urge to say them.
Very few things are obvious. This is not obviously a problem with firebase. And firebase is a cloud service, an underlying firebase-android-sdk, and react-native-firebase layers. Which is it, if it is "firebase"?
Note: Recompile with -Xlint:deprecation for details.
e: file:///Users/apotapov/Desktop/DEVELOPMENT/react-native-firebase-error/android/app/src/main/java/com/awesomeproject/MainApplication.kt:27:58 Unresolved reference: BuildConfig
e: file:///Users/apotapov/Desktop/DEVELOPMENT/react-native-firebase-error/android/app/src/main/java/com/awesomeproject/MainApplication.kt:29:50 Unresolved reference: BuildConfig
e: file:///Users/apotapov/Desktop/DEVELOPMENT/react-native-firebase-error/android/app/src/main/java/com/awesomeproject/MainApplication.kt:30:49 Unresolved reference: BuildConfig
e: file:///Users/apotapov/Desktop/DEVELOPMENT/react-native-firebase-error/android/app/src/main/java/com/awesomeproject/MainApplication.kt:39:9 Unresolved reference: BuildConfig
https://stackoverflow.com/questions/60942575/unresolved-reference-buildconfig-in-kotlin
So, you have an error message in your application code (note it is referenced in MainApplication.kt, not any react-native-firebase code) and the error message is for the lines using BuildConfig (https://github.com/PotapovALeksey/react-native-firebase-error/blob/cf318b5937f018b1e3caf18d60b2adefccabc186/android/app/src/main/java/com/awesomeproject/MainApplication.kt#L27-L30) that seems odd
Have you tried to enable the gradle buildconfig feature as suggested on the first stackoverflow that comes up for this error?
That'll solve it
Hey, I have encountered the very same issue and it has nothing to do, as @mikehardy mentioned, with Firebase but rather the setup you do.
The issue on my end was that I changed app/build.gradle namespace and applicationId, but didn't change folder structure and package inside MainApplication.kt and MainActivity.kt . This is exactly the same case in reproduction repository.
Leaving this here in case someone happens to encounter the same thing. Nothing has to do with FIrebase.
Hey, I have encountered the very same issue and it has nothing to do, as @mikehardy mentioned, with Firebase but rather the setup you do.
The issue on my end was that I changed app/build.gradle namespace and applicationId, but didn't change folder structure and package inside MainApplication.kt and MainActivity.kt . This is exactly the same case in reproduction repository.
Leaving this here in case someone happens to encounter the same thing. Nothing has to do with FIrebase.
This was exactly my problem. Not sure how you found it, but saved me more headaches. Thank you!!
Hey, I have encountered the very same issue and it has nothing to do, as @mikehardy mentioned, with Firebase but rather the setup you do.
The issue on my end was that I changed app/build.gradle namespace and applicationId, but didn't change folder structure and package inside MainApplication.kt and MainActivity.kt . This is exactly the same case in reproduction repository.
Leaving this here in case someone happens to encounter the same thing. Nothing has to do with FIrebase.
Thank you, checking and modifying the namespace and applicationId has worked for me: "com.app_name" according to the path: \android\app\src\main\java\com\app_name. Thank you very much.
Hey, I have encountered the very same issue and it has nothing to do, as @mikehardy mentioned, with Firebase but rather the setup you do.
The issue on my end was that I changed app/build.gradle namespace and applicationId, but didn't change folder structure and package inside MainApplication.kt and MainActivity.kt . This is exactly the same case in reproduction repository.
Leaving this here in case someone happens to encounter the same thing. Nothing has to do with FIrebase.
I have no idea about your solution, please elaborate more by changing app/build.gralde namespace and applicationId. I am facing the exact same issue
@akuul Thanks it works for me