You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[馃悰] A problem occurred evaluating project ':react-native-firebase_app'. It is too late to set namespace It has already been read to configure this project.
#7801
Closed
2 of 10 tasks
RobertSavage opened this issue
May 20, 2024
· 1 comment
What went wrong:
A problem occurred evaluating project ':react-native-firebase_app'.
It is too late to set namespace
It has already been read to configure this project.
Consider either moving this call to be during evaluation,
or using the variant API.
apply plugin: "com.android.application"
apply plugin: "org.jetbrains.kotlin.android"
apply plugin: "com.facebook.react"/** * This is the configuration block to customize your React Native Android app. * By default you don't need to apply any configuration, just uncomment the lines you need.*/
react {
/* Folders */// The root of your project, i.e. where "package.json" lives. Default is '..'// root = file("../")// The folder where the react-native NPM package is. Default is ../node_modules/react-native// reactNativeDir = file("../node_modules/react-native")// The folder where the react-native Codegen package is. Default is ../node_modules/@react-native/codegen// codegenDir = file("../node_modules/@react-native/codegen")// The cli.js file which is the React Native CLI entrypoint. Default is ../node_modules/react-native/cli.js// cliFile = file("../node_modules/react-native/cli.js")/* Variants */// The list of variants to that are debuggable. For those we're going to// skip the bundling of the JS bundle and the assets. By default is just 'debug'.// If you add flavors like lite, prod, etc. you'll have to list your debuggableVariants.// debuggableVariants = ["liteDebug", "prodDebug"]/* Bundling */// A list containing the node command and its flags. Default is just 'node'.// nodeExecutableAndArgs = ["node"]//// The command to run when bundling. By default is 'bundle'// bundleCommand = "ram-bundle"//// The path to the CLI configuration file. Default is empty.// bundleConfig = file(../rn-cli.config.js)//// The name of the generated asset file containing your JS bundle// bundleAssetName = "MyApplication.android.bundle"//// The entry file for bundle generation. Default is 'index.android.js' or 'index.js'// entryFile = file("../js/MyApplication.android.js")//// A list of extra flags to pass to the 'bundle' commands.// See https://github.com/react-native-community/cli/blob/main/docs/commands.md#bundle// extraPackagerArgs = []/* Hermes Commands */// The hermes compiler command to run. By default it is 'hermesc'// hermesCommand = "$rootDir/my-custom-hermesc/bin/hermesc"//// The list of flags to pass to the Hermes compiler. By default is "-O", "-output-source-map"// hermesFlags = ["-O", "-output-source-map"]
}
/** * Set this to true to Run Proguard on Release builds to minify the Java bytecode.*/def enableProguardInReleaseBuilds =false/** * The preferred build flavor of JavaScriptCore (JSC) * * For example, to use the international variant, you can use: * `def jscFlavor = 'org.webkit:android-jsc-intl:+'` * * The international variant includes ICU i18n library and necessary data * allowing to use e.g. `Date.toLocaleString` and `String.localeCompare` that * give correct results when using with locales other than en-US. Note that * this variant is about 6MiB larger per architecture than default.*/def jscFlavor ='org.webkit:android-jsc:+'
android {
ndkVersion rootProject.ext.ndkVersion
buildToolsVersion rootProject.ext.buildToolsVersion
compileSdk rootProject.ext.compileSdkVersion
namespace "com.copiareactnativeapp"
defaultConfig {
applicationId "com.copiareactnativeapp"
minSdkVersion rootProject.ext.minSdkVersion
targetSdkVersion rootProject.ext.targetSdkVersion
versionCode 1
versionName "1.0"
}
signingConfigs {
debug {
storeFile file('debug.keystore')
storePassword 'android'
keyAlias 'androiddebugkey'
keyPassword 'android'
}
}
buildTypes {
debug {
signingConfig signingConfigs.debug
}
release {
// Caution! In production, you need to generate your own keystore file.// see https://reactnative.dev/docs/signed-apk-android.
signingConfig signingConfigs.debug
minifyEnabled enableProguardInReleaseBuilds
proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro"
}
}
}
dependencies {
// The version of react-native is set by the React Native Gradle Plugin
implementation("com.facebook.react:react-android")
implementation("com.facebook.react:flipper-integration")
if (hermesEnabled.toBoolean()) {
implementation("com.facebook.react:hermes-android")
} else {
implementation jscFlavor
}
}
apply from: file("../../node_modules/@react-native-community/cli-platform-android/native_modules.gradle"); applyNativeModulesAppBuildGradle(project)
apply from: file("../../node_modules/react-native-vector-icons/fonts.gradle")
android/settings.gradle:
rootProject.name ='copiaReactnativeApp'
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 ':app', ':react-native-firebase_app'
MainApplication.java:
packagecom.copiareactnativeappimportandroid.app.Applicationimportcom.facebook.react.PackageListimportcom.facebook.react.ReactApplicationimportcom.facebook.react.ReactHostimportcom.facebook.react.ReactNativeHostimportcom.facebook.react.ReactPackageimportcom.facebook.react.defaults.DefaultNewArchitectureEntryPoint.loadimportcom.facebook.react.defaults.DefaultReactHost.getDefaultReactHostimportcom.facebook.react.defaults.DefaultReactNativeHostimportcom.facebook.react.flipper.ReactNativeFlipperimportcom.facebook.soloader.SoLoaderimportio.invertase.firebase.messaging.ReactNativeFirebaseMessagingPackage;
classMainApplication : Application(), ReactApplication {
overridevalreactNativeHost: ReactNativeHost =
object : DefaultReactNativeHost(this) {
overridefungetPackages(): List<ReactPackage> =
PackageList(this).packages.apply {
// Packages that cannot be autolinked yet can be added manually here, for example:// add(MyReactNativePackage())
}
overridefungetJSMainModuleName(): String = "index"overridefungetUseDeveloperSupport(): Boolean = BuildConfig.DEBUGoverridevalisNewArchEnabled: Boolean = BuildConfig.IS_NEW_ARCHITECTURE_ENABLEDoverridevalisHermesEnabled: Boolean = BuildConfig.IS_HERMES_ENABLED
}
overridevalreactHost: ReactHostget() = getDefaultReactHost(this.applicationContext, reactNativeHost)
overridefunonCreate() {
super.onCreate()
SoLoader.init(this, false)
if (BuildConfig.IS_NEW_ARCHITECTURE_ENABLED) {
// If you opted-in for the New Architecture, we load the native entry point for this app.load()
}
ReactNativeFlipper.initializeFlipper(this, reactNativeHost.reactInstanceManager)
}
}
RobertSavage
changed the title
[馃悰] Bug Report Title - A problem occurred evaluating project ':react-native-firebase_app'. It is too late to set namespace It has already been read to configure this project.
[馃悰] A problem occurred evaluating project ':react-native-firebase_app'. It is too late to set namespace It has already been read to configure this project.
May 20, 2024
Issue
Describe your issue here
Any time I try to build, sync, or clean gradle I get this error.
Error:
Where:
Build file '/Users/robertsavage/Documents/GitHub/copia-react-native-app/node_modules/@react-native-firebase/app/android/build.gradle' line: 65
What went wrong:
A problem occurred evaluating project ':react-native-firebase_app'.
Gradle Properties: https://services.gradle.org/distributions/gradle-8.6-bin.zip
Kotlin: kotlinVersion = "1.8.0" J
ava: java 19.0.2 2023-01-17
dependencies "com.android.tools.build:gradle:7.6.0-alpha01" "com.google.gms:google-services:4.4.0" "com.facebook.react:react-native-gradle-plugin:+"
Project Files
Javascript
Click To Expand
package.json
:firebase.json
for react-native-firebase v6:# N/A
iOS
Click To Expand
ios/Podfile
:# N/A
AppDelegate.m
:// N/A
Android
Click To Expand
Have you converted to AndroidX?
android/gradle.settings
jetifier=true
for Android compatibility?jetifier
for react-native compatibility?android/build.gradle
:android/app/build.gradle
:android/settings.gradle
:MainApplication.java
:AndroidManifest.xml
:Environment
Click To Expand
react-native info
output:react-native-firebase
version you're using that has this issue:10.8.0
Firebase
module(s) you're using that has the issue:e.g. Instance ID
TypeScript
?No
React Native Firebase
andInvertase
on Twitter for updates on the library.The text was updated successfully, but these errors were encountered: