Skip to content

cannot find symbol BuildConfig.APPLICATION_ID #3254

@ParitoshVaidya

Description

@ParitoshVaidya

Issue

Describe your issue here

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
1 error

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':@react-native-firebase_app:compileDebugJavaWithJavac'.

Project Files

Javascript

Click To Expand

package.json:

# N/A
{
  "name": "appname_mobile",
  "version": "0.0.1",
  "private": true,
  "scripts": {
    "android": "react-native run-android",
    "ios": "react-native run-ios",
    "start": "react-native start",
    "test": "jest",
    "lint": "eslint .",
    "postinstall": "npx rn-nodeify --install \"fs, util, path, tls, stream,buffer,global,process\" --hack  \"node ./android-release-gradle-fix.js\"",
    "build:ios": "react-native bundle --entry-file='index.js' --bundle-output='./ios/main.jsbundle' --dev=false --platform='ios'"
  },
  "dependencies": {
    "@react-native-community/async-storage": "1.7.1",
    "@react-native-firebase/analytics": "^6.3.4",
    "@react-native-firebase/app": "^6.3.4",
    "@react-native-firebase/crashlytics": "^6.3.4",
    "asyncstorage-down": "^4.2.0",
    "aws-iot-device-sdk": "^2.2.1",
    "aws-sdk": "^2.601.0",
    "axios": "0.19.0",
    "buffer": "^4.9.1",
    "events": "^3.1.0",
    "native-base": "^2.13.8",
    "path-browserify": "0.0.0",
    "process": "^0.11.10",
    "react": "16.9.0",
    "react-native": "0.61.5",
    "react-native-appearance": "0.3.1",
    "react-native-check-box": "^2.1.7",
    "react-native-config": "^0.12.0",
    "react-native-confirmation-code-input": "1.0.4",
    "react-native-dashed-progress": "^1.0.1",
    "react-native-fs": "^2.16.6",
    "react-native-gesture-handler": "^1.5.2",
    "react-native-level-fs": "^3.0.1",
    "react-native-localization": "2.1.6",
    "react-native-logs": "^2.0.0",
    "react-native-modal": "^11.5.3",
    "react-native-paper": "^3.5.1",
    "react-native-reanimated": "^1.4.0",
    "react-native-slider": "^0.11.0",
    "react-native-splash-screen": "^3.2.0",
    "react-native-tab-view": "^2.11.0",
    "react-native-uuid": "^1.4.9",
    "react-native-vector-icons": "^6.6.0",
    "react-navigation": "4.0.10",
    "react-navigation-stack": "1.10.3",
    "react-navigation-tabs": "2.6.2",
    "react-redux": "^7.1.3",
    "readable-stream": "^1.0.33",
    "redux": "^4.0.5",
    "redux-thunk": "^2.3.0",
    "reselect": "^4.0.0",
    "rn-nodeify": "^10.2.0",
    "stream-browserify": "^1.0.0",
    "util": "^0.10.4"
  },
  "devDependencies": {
    "@babel/core": "^7.7.4",
    "@babel/runtime": "^7.7.4",
    "@react-native-community/eslint-config": "^0.0.5",
    "babel-jest": "^24.9.0",
    "eslint": "^6.7.2",
    "jest": "^24.9.0",
    "metro-react-native-babel-preset": "^0.57.0",
    "react-test-renderer": "16.9.0"
  },
  "jest": {
    "preset": "react-native"
  },
  "react-native": {
    "path": "path-browserify",
    "fs": "react-native-level-fs",
    "_stream_transform": "readable-stream/transform",
    "_stream_readable": "readable-stream/readable",
    "_stream_writable": "readable-stream/writable",
    "_stream_duplex": "readable-stream/duplex",
    "_stream_passthrough": "readable-stream/passthrough",
    "stream": "stream-browserify",
    "tls": false
  },
  "browser": {
    "path": "path-browserify",
    "fs": "react-native-level-fs",
    "_stream_transform": "readable-stream/transform",
    "_stream_readable": "readable-stream/readable",
    "_stream_writable": "readable-stream/writable",
    "_stream_duplex": "readable-stream/duplex",
    "_stream_passthrough": "readable-stream/passthrough",
    "stream": "stream-browserify",
    "tls": false
  }
}

firebase.json for react-native-firebase v6:

# N/A

iOS

Click To Expand

ios/Podfile:

  • I'm not using Pods
  • I'm using Pods and my Podfile looks like:
# N/A

AppDelegate.m:

// N/A


Android

Click To Expand

Have you converted to AndroidX?

  • [x ] my application is an AndroidX application?
  • [x ] I am using android/gradle.settings jetifier=true for Android compatibility?
  • I am using the NPM package jetifier for react-native compatibility?

android/build.gradle:

apply plugin: "com.android.application"
apply from: project(':react-native-config').projectDir.getPath() + "/dotenv.gradle"
apply from: "../../node_modules/react-native-vector-icons/fonts.gradle"
apply plugin: 'com.google.gms.google-services'
apply plugin: 'com.google.firebase.crashlytics'
.
.
.
dependencies {
    implementation project(':react-native-splash-screen')
    implementation project(path: ":@react-native-firebase_app")
    implementation fileTree(dir: "libs", include: ["*.jar"])
    implementation "com.facebook.react:react-native:+"  // From node_modules

    implementation 'com.google.firebase:firebase-analytics:17.2.2'
    implementation 'com.google.firebase:firebase-crashlytics:17.0.0-beta01'


    if (enableHermes) {
        def hermesPath = "../../node_modules/hermes-engine/android/";
        debugImplementation files(hermesPath + "hermes-debug.aar")
        releaseImplementation files(hermesPath + "hermes-release.aar")
    } else {
        implementation jscFlavor
    }
}

android/app/build.gradle:

buildscript {
    ext {
        buildToolsVersion = "28.0.3"
        minSdkVersion = 16
        compileSdkVersion = 28
        targetSdkVersion = 28
    }
    repositories {
        google()
        jcenter()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:4.0.0-alpha09'
        classpath 'com.google.gms:google-services:4.3.3'
        classpath 'com.google.firebase:firebase-crashlytics-gradle:2.0.0-beta02'

        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}

allprojects {
    repositories {
        mavenLocal()
        maven {
            // All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
            url("$rootDir/../node_modules/react-native/android")
        }
        maven {
            // Android JSC is installed from npm
            url("$rootDir/../node_modules/jsc-android/dist")
        }

        google()
        jcenter()
        maven { url 'https://jitpack.io' }
    }
}

android/settings.gradle:

// N/A

MainApplication.java:

// N/A

AndroidManifest.xml:

<!-- N/A -->


Environment

Click To Expand

react-native info output:

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
D:\<path to project>\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
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.
  • Platform that you're experiencing the issue on:
    • iOS
    • Android
    • iOS but have not tested behavior on Android
    • Android but have not tested behavior on iOS
    • Both
  • react-native-firebase version you're using that has this issue:
    • 6.3.4
  • Firebase module(s) you're using that has the issue:
    • e.g. Instance ID
  • Are you using TypeScript?
    • N & VERSION


Think react-native-firebase is great? Please consider supporting all of the project maintainers and contributors by donating via our Open Collective where all contributors can submit expenses. [Learn More]

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions