Closed santoshachari closed 1 year ago
You need to install the alpha
package. We're updating the docs at the moment as this is something which a few people are hitting.
yarn add @react-native-firebase/analytics@alpha
Thanks, Elliot @Ehesp! On installing the package, this Firebase app import was referenced wrongly:
import io.invertase.firebase.ReactNativeFirebaseAppPackage;
in MainApplication.java, instead of
import io.invertase.firebase.app.ReactNativeFirebaseAppPackage;
how to fix this problem im still getting this
@rambo006mm I saw your other issue, my best advice is use v5 - it's the branch to use unless you are interested in testing and able to bust through problems on your own and provide solutions like santoshachari did for the v6 branch
./node_module/@react-native-firebase/analytics/android/build.gradle line 58
replace slash with underscore like this
api project(':@react-native-firebase/app')
=>
api project(':@react-native-firebase_app')
I also faced this problem How to fix it.
Thank you in advance
For me this problem arise when i run react native link after beating my head i resolve it by making my app build. Gradle msin build.gradle main application java and seeting.gradle to its previous version before react native link by pressing ctrl z its basically naive solution but it can work
If it dont work remove node modules and package. Json and install all modules again
My solution
android/settings.gradle:
include ':@react-native-firebase_app'
project(':@react-native-firebase_app').projectDir = new File(rootProject.proj
@ddman can you please write again your solution? It seems it is truncated..
@cemo
include ':@react-native-firebase_app'
project(':@react-native-firebase_app').projectDir = new File(rootProject.projectDir, '../node_modules/@react-native-firebase/app/android')
@vstukanov thanks. My problem was that I need to define "firebase.json" in the android folder. It solved it.
@cemo Hello,
what do you mean by "define firebase.json" in the android folder?
Thanks !
I'm also facing exactly the same problem with the Auth module.
1: Task failed with an exception.
-----------
* Where:
Build file 'C:\Sanbitt\globalescape-mobile\node_modules\@react-native-firebase\auth\android\build.gradle' line: 54
* What went wrong:
A problem occurred evaluating project ':@react-native-firebase_auth'.
> Project with path ':@react-native-firebase_app' could not be found in project ':@react-native-firebase_auth'.
* 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.
==============================================================================
2: Task failed with an exception.
-----------
* What went wrong:
A problem occurred configuring project ':@react-native-firebase_auth'.
> compileSdkVersion is not specified.
Is this the same issue? The compileSdkVersion is not specified.
may indicate something different though.
I'm also facing exactly the same problem with the Auth module.
1: Task failed with an exception. ----------- * Where: Build file 'C:\Sanbitt\globalescape-mobile\node_modules\@react-native-firebase\auth\android\build.gradle' line: 54 * What went wrong: A problem occurred evaluating project ':@react-native-firebase_auth'. > Project with path ':@react-native-firebase_app' could not be found in project ':@react-native-firebase_auth'. * 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. ============================================================================== 2: Task failed with an exception. ----------- * What went wrong: A problem occurred configuring project ':@react-native-firebase_auth'. > compileSdkVersion is not specified.
Is this the same issue? The
compileSdkVersion is not specified.
may indicate something different though.
I had the same problem, because I was installing with "npm", I uninstalled from "npm" and installed via "yarn" and it worked.
yarn add @react-native-firebase/app yarn add @react-native-firebase/auth
At "npm" the auto-link was not happening.
@MahbbRah this is a closed issue, it will probably be best to open a new issue with complete details - and please post text not images, so they are searchable and quotable etc, and work well while mobile
``* What went wrong: A problem occurred configuring project ':@react-native-firebase_auth'.
compileSdkVersion is not specified.
I was having similar issue. this is probably because of you do not have installed the @react-native-firebase/app
Please check your package.json
and make sure this is included and installed by yarn otherwise it will throw error like above
This firebase becoming so messed up.. Like how it can have so many bugs in every release..
@losheredos any and all PRs fixing bugs are happily accepted, open source requires contributions from everyone, right? In reviewing your github activity I see only issues created, no PRs, no reviews :thinking: :man_shrugging: it's a big API surface area that moves quickly, help us make it better and it will be better
@mikehardy of course but I mean even opening issues are kinda contributing dont you think so? Or whenever we have a solution we just share and write it. But to directly work in bugs in open source projects, I dont know how people find time for that, especially if its without being paid?..
@losheredos note that this module specifically pays contributors! https://opencollective.com/react-native-firebase
Opening issues is at least a first step, and sharing solutions is huge - the userbase here is pretty good at that.
Other projects, yeah unless it provides personal educational value or direct benefit to a work project hard to argue it's easy to find time, but PRs are what makes open source work, however they are justified.
And you must realize how this
This firebase becoming so messed up.. Like how it can have so many bugs in every release..
sounds to those justifying the work as "makes me feel good to improve quality" ? Doesn't seem like the effect you'd want, on reflection
@mikehardy Well its like a expression of boredom, since I already opened issue about previous versions in firebase.. Like everytime some package is updated you expect it to have less bugs then before right? But in this case it reveals unexpected bugs, so I just wanted to ask how it can happen this way very often? Plus not everyone have enough knowledge to be able to help in development of huge libraries.
I think we should have a "right" to complain sometimes about these kind of a bit weird situations and maybe you should be enough kind to understand these kind of comments and critics.
Complaining is a right in an open source world, sure. Just doesn't seem useful - or more to the point might be counterproductive - to me thus my press for defense of same.
Based on everything I read about the transition from v5 to v6 here I had no expectation it would have fewer issues out of the gate. I do believe it's converging stability though as more people have adopted it and most modules have been sussed out so far.
In the meantime, v5 does still exist.
I'm also facing exactly the same problem with the Auth module.
1: Task failed with an exception. ----------- * Where: Build file 'C:\Sanbitt\globalescape-mobile\node_modules\@react-native-firebase\auth\android\build.gradle' line: 54 * What went wrong: A problem occurred evaluating project ':@react-native-firebase_auth'. > Project with path ':@react-native-firebase_app' could not be found in project ':@react-native-firebase_auth'. * 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. ============================================================================== 2: Task failed with an exception. ----------- * What went wrong: A problem occurred configuring project ':@react-native-firebase_auth'. > compileSdkVersion is not specified.
Is this the same issue? The
compileSdkVersion is not specified.
may indicate something different though.I had the same problem, because I was installing with "npm", I uninstalled from "npm" and installed via "yarn" and it worked.
yarn add @react-native-firebase/app yarn add @react-native-firebase/auth
At "npm" the auto-link was not happening.
This fixed the exact same issue for me! Thanks!
How to fix this ??
Unsupported Modules Detected: Compilation is not supported for following modules: android-@react-native-firebase_firestore, android-@react-native-firebase_app, @react-native-firebase_firestore, @react-native-firebase_app, android-react-native-maps, android-react-native-linear-gradient, android-react-native-gesture-handler, android-react-native-reanimated, android-react-native-webview, android-react-native-vector-icons, app-android-@react-native-firebase_app, firestore-android-@react-native-firebase_firestore, lib-android-react-native-maps, react-native-gesture-handler, react-native-gesture-handler-android-react-native-gesture-handler, react-native-linear-gradient, react-native-linear-gradient-android-react-native-linear-gradient, react-native-maps, react-native-reanimated, react-native-reanimated-android-react-native-reanimated, react-native-webview, react-native-vector-icons-android-react-native-vector-icons, react-native-vector-icons, react-native-webview-android-react-native-webview. Unfortunately you can't have... (show balloon)
@Bongroth Hello! this is an unrelated issue and by my count 16 people received notifications about your unrelated issue. It is also contains almost none of the information someone would need to troubleshoot it. However guessing at your problem: I think Android Studio just doesn't like the way auto-linking works in react-native 0.60+, and if you run a ./gradlew assembleDebug
from the command line in the android folder before you open Android Studio will help, and if not, this would be a general react-native issue and you could ask there
Updating RN from 0.60.4 to 0.60.5 fixed the issue for me
@cemo
include ':@react-native-firebase_app' project(':@react-native-firebase_app').projectDir = new File(rootProject.projectDir, '../node_modules/@react-native-firebase/app/android')
This workaround works. But why is still needed? This actually wasn't needed until I ran a yarn upgrade and pod update, while STAYING on RN 0.61.5.
@fungilation there is a new / separate issue with react-native-community/cli altering how it links scoped packages, and it is the source of your problem I believe: #3206 - workaround is to pin CLI at 3.0.3 as mentioned in that issue, until this is sorted out (should be quite soon)
We've made a patch for RNFirebase (#3215) that should work around this change now - it'll be released later today, thank you
Confirmed no more need for workarounds with RNFB 6.3.4. Thanks for the quick fix!
@fungilation I am facing the same issue even after trying @cemo solution . I dint get @cemo solution as to what difference it makes...any suggestions ..?
Solved problem. Upgrade to 6.3.4. Maybe 'npx react-native-clean-project'
@mikehardy can u plz give the command to upgrade
Depends on your package manager, you'll have to study up on managing packages sorry
Thank you so much
On Wed, 19 Feb 2020, 4:41 pm Mike Hardy, notifications@github.com wrote:
Depends on your package manager, you'll have to study up on managing packages sorry
— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/invertase/react-native-firebase/issues/2149?email_source=notifications&email_token=AC5CNGHCM5MS3SU5CI2RVY3RDUHWRA5CNFSM4HOLJHOKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEMHLQNY#issuecomment-588167223, or unsubscribe https://github.com/notifications/unsubscribe-auth/AC5CNGCXD77EL4PQDRCSTDDRDUHWRANCNFSM4HOLJHOA .
Even after upgrading tp 6.3.4 firebase_analytics doesn't work......I am getting below even after trying all solutions...
Show Details Affected Modules: app
ERROR: Unable to resolve dependency for ':app@debugAndroidTest/compileClasspath': Could not resolve project :@react-native-firebase_analytics. Show Details Affected Modules: app
ERROR: Unable to resolve dependency for ':app@debugUnitTest/compileClasspath': Could not resolve project :@react-native-firebase_analytics. Show Details Affected Modules: app
ERROR: Unable to resolve dependency for ':app@release/compileClasspath': Could not resolve project :@react-native-firebase_analytics. Show Details Affected Modules: app
ERROR: Unable to resolve dependency for ':app@releaseUnitTest/compileClasspath': Could not resolve project :@react-native-firebase_analytics. Show Details Affected Modules: app**
Stale yarn.lock or package-lock.json I bet, plus something else cached. This was definitely fixed and works - as I test it regularly
react-native-clean-project might help too?
https://github.com/invertase/react-native-firebase/commit/b4eaa39ea8022535696d28e6eacb5c3e3ce9578f was definitely merged before the last release.
react-native-clean-project i already tried... I tried other solutions also.... still the same error...very hard to figure out what’s wrong...
you have to install/add both of the packages.
yarn add @react-native-firebase/app
yarn add @react-native-firebase/auth
Updating RN from 0.60.4 to 0.60.5 fixed the issue for me
Fix for me
I'm also facing exactly the same problem with the Auth module.
1: Task failed with an exception. ----------- * Where: Build file 'C:\Sanbitt\globalescape-mobile\node_modules\@react-native-firebase\auth\android\build.gradle' line: 54 * What went wrong: A problem occurred evaluating project ':@react-native-firebase_auth'. > Project with path ':@react-native-firebase_app' could not be found in project ':@react-native-firebase_auth'. * 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. ============================================================================== 2: Task failed with an exception. ----------- * What went wrong: A problem occurred configuring project ':@react-native-firebase_auth'. > compileSdkVersion is not specified.
Is this the same issue? The
compileSdkVersion is not specified.
may indicate something different though.I had the same problem, because I was installing with "npm", I uninstalled from "npm" and installed via "yarn" and it worked.
yarn add @react-native-firebase/app yarn add @react-native-firebase/auth
At "npm" the auto-link was not happening.
thanks bro.
Upgrade firebase/app fixed for me
@ramonpenteado thanks!
Upgrading firebase and /android/gradlew clean
worked for me
After adding @react-native-firebase/messaging": "^7.8.6, I was getting:
A problem occurred configuring project ':@react-native-firebase_messaging'.
> compileSdkVersion is not specified.
updating react-native-firebase/app with this fixed it for me:
yarn add @react-native-firebase/app
@Jean-baptisteColette as a general habit, unless you have a reason to stay behind on versions, update them all. They are independently versioned, which means we don't always release all the packages when we just change one package, but when we do change a package, you probably want the change, and sometimes they are co-dependent, with the 'app' module bumping it's peerDependencies so you should get a warning even if you don't upgrade the other packages.
reinstall firebase/app dependency. Solved for me yarn add @react-native-firebase/app
I have tried all the above but still getting issues. Please someone help me.
installed via yarn Manually linked the project Cleaned the gradle
Still getting error.
Deprecated Gradle features were used in this build, making it incompatible with Gradle 7.0. Use '--warning-mode all' to show the individual deprecation warnings. See https://docs.gradle.org/6.5/userguide/command_line_interface.html#sec:command_line_warnings FAILURE: Build failed with an exception.
- Where: Script 'D:\mobile\NilamhutApp\node_modules\@react-native-community\cli-platform-android\native_modules.gradle' line: 108
- What went wrong: A problem occurred evaluating project ':app'. Project with path ':react-native-firebase_app' could not be found in project ':app'.
"react-native": "0.62.2",
"@react-native-firebase/app": "^8.4.6",
"@react-native-firebase/messaging": "^7.9.1",
Issue
Thank you for the awesome package!
I was successfully able to install and build in android studio with package'@react-native-firebase/app'.
However, when I follow steps here: https://invertase.io/oss/react-native-firebase/v6/analytics/quick-start,
The sync fails with:
The file, i.e. build.gradle in
@react-native-firebase_analytics
:Describe your issue here
Project Files
#
Android
Click To Expand
#### `android/build.gradle`: ```groovy // Top-level build file where you can add configuration options common to all sub-projects/modules. buildscript { ext { buildToolsVersion = "28.0.3" minSdkVersion = 16 compileSdkVersion = 28 targetSdkVersion = 28 supportLibVersion = "28.0.0" } repositories { google() jcenter() } dependencies { classpath 'com.android.tools.build:gradle:3.4.0' // NOTE: Do not place your application dependencies here; they belong // in the individual module build.gradle files classpath 'com.google.gms:google-services:4.2.0' } } allprojects { repositories { mavenLocal() google() jcenter() maven { // All of React Native (JS, Obj-C sources, Android binaries) is installed from npm url "$rootDir/../node_modules/react-native/android" } } } ``` #### `android/app/build.gradle`: ```groovy apply plugin: "com.android.application" import com.android.build.OutputFile /** * The react.gradle file registers a task for each build variant (e.g. bundleDebugJsAndAssets * and bundleReleaseJsAndAssets). * These basically call `react-native bundle` with the correct arguments during the Android build * cycle. By default, bundleDebugJsAndAssets is skipped, as in debug/dev mode we prefer to load the * bundle directly from the development server. Below you can see all the possible configurations * and their defaults. If you decide to add a configuration block, make sure to add it before the * `apply from: "../../node_modules/react-native/react.gradle"` line. * * project.ext.react = [ * // the name of the generated asset file containing your JS bundle * bundleAssetName: "index.android.bundle", * * // the entry file for bundle generation * entryFile: "index.android.js", * * // whether to bundle JS and assets in debug mode * bundleInDebug: false, * * // whether to bundle JS and assets in release mode * bundleInRelease: true, * * // whether to bundle JS and assets in another build variant (if configured). * // See http://tools.android.com/tech-docs/new-build-system/user-guide#TOC-Build-Variants * // The configuration property can be in the following formats * // 'bundleIn${productFlavor}${buildType}' * // 'bundleIn${buildType}' * // bundleInFreeDebug: true, * // bundleInPaidRelease: true, * // bundleInBeta: true, * * // whether to disable dev mode in custom build variants (by default only disabled in release) * // for example: to disable dev mode in the staging build type (if configured) * devDisabledInStaging: true, * // The configuration property can be in the following formats * // 'devDisabledIn${productFlavor}${buildType}' * // 'devDisabledIn${buildType}' * * // the root of your project, i.e. where "package.json" lives * root: "../../", * * // where to put the JS bundle asset in debug mode * jsBundleDirDebug: "$buildDir/intermediates/assets/debug", * * // where to put the JS bundle asset in release mode * jsBundleDirRelease: "$buildDir/intermediates/assets/release", * * // where to put drawable resources / React Native assets, e.g. the ones you use via * // require('./image.png')), in debug mode * resourcesDirDebug: "$buildDir/intermediates/res/merged/debug", * * // where to put drawable resources / React Native assets, e.g. the ones you use via * // require('./image.png')), in release mode * resourcesDirRelease: "$buildDir/intermediates/res/merged/release", * * // by default the gradle tasks are skipped if none of the JS files or assets change; this means * // that we don't look at files in android/ or ios/ to determine whether the tasks are up to * // date; if you have any other folders that you want to ignore for performance reasons (gradle * // indexes the entire tree), add them here. Alternatively, if you have JS files in android/ * // for example, you might want to remove it from here. * inputExcludes: ["android/**", "ios/**"], * * // override which node gets called and with what additional arguments * nodeExecutableAndArgs: ["node"], * * // supply additional arguments to the packager * extraPackagerArgs: [] * ] */ project.ext.react = [ entryFile: "index.js" ] apply from: "../../node_modules/react-native/react.gradle" /** * Set this to true to create two separate APKs instead of one: * - An APK that only works on ARM devices * - An APK that only works on x86 devices * The advantage is the size of the APK is reduced by about 4MB. * Upload all the APKs to the Play Store and people will download * the correct one based on the CPU architecture of their device. */ def enableSeparateBuildPerCPUArchitecture = false /** * Run Proguard to shrink the Java bytecode in release builds. */ def enableProguardInReleaseBuilds = false android { compileSdkVersion rootProject.ext.compileSdkVersion compileOptions { sourceCompatibility JavaVersion.VERSION_1_8 targetCompatibility JavaVersion.VERSION_1_8 } defaultConfig { applicationId "com.awesomeproject" minSdkVersion rootProject.ext.minSdkVersion targetSdkVersion rootProject.ext.targetSdkVersion versionCode 1 versionName "1.0" } splits { abi { reset() enable enableSeparateBuildPerCPUArchitecture universalApk false // If true, also generate a universal APK include "armeabi-v7a", "x86", "arm64-v8a", "x86_64" } } buildTypes { release { minifyEnabled enableProguardInReleaseBuilds proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro" } } // applicationVariants are e.g. debug, release applicationVariants.all { variant -> variant.outputs.each { output -> // For each separate APK per architecture, set a unique version code as described here: // http://tools.android.com/tech-docs/new-build-system/user-guide/apk-splits def versionCodes = ["armeabi-v7a":1, "x86":2, "arm64-v8a": 3, "x86_64": 4] def abi = output.getFilter(OutputFile.ABI) if (abi != null) { // null for the universal-debug, universal-release variants output.versionCodeOverride = versionCodes.get(abi) * 1048576 + defaultConfig.versionCode } } } } dependencies { implementation project(':@react-native-firebase_analytics') implementation project(':@react-native-firebase_app') implementation fileTree(dir: "libs", include: ["*.jar"]) implementation "com.android.support:appcompat-v7:${rootProject.ext.supportLibVersion}" implementation "com.facebook.react:react-native:+" // From node_modules implementation 'com.google.firebase:firebase-core:16.0.9' } // Run this once to be able to run the application with BUCK // puts all compile dependencies into folder libs for BUCK to use task copyDownloadableDepsToLibs(type: Copy) { from configurations.compile into 'libs' } apply plugin: 'com.google.gms.google-services' ``` #### `android/settings.gradle`: ```groovy rootProject.name = 'AwesomeProject' include ':@react-native-firebase_analytics' project(':@react-native-firebase_analytics').projectDir = new File(rootProject.projectDir, '../node_modules/@react-native-firebase/analytics/android') include ':@react-native-firebase_app' project(':@react-native-firebase_app').projectDir = new File(rootProject.projectDir, '../node_modules/@react-native-firebase/app/android') include ':app' ``` #### `MainApplication.java`: ```java package com.awesomeproject; import android.app.Application; import com.facebook.react.ReactApplication; import io.invertase.firebase.analytics.ReactNativeFirebaseAnalyticsPackage; import io.invertase.firebase.modules.app.ReactNativeFirebaseAppPackage; import com.facebook.react.ReactNativeHost; import com.facebook.react.ReactPackage; import com.facebook.react.shell.MainReactPackage; import com.facebook.soloader.SoLoader; import java.util.Arrays; import java.util.List; public class MainApplication extends Application implements ReactApplication { private final ReactNativeHost mReactNativeHost = new ReactNativeHost(this) { @Override public boolean getUseDeveloperSupport() { return BuildConfig.DEBUG; } @Override protected List getPackages() {
return Arrays.asList(
new MainReactPackage(),
new ReactNativeFirebaseAnalyticsPackage(),
new ReactNativeFirebaseAppPackage()
);
}
@Override
protected String getJSMainModuleName() {
return "index";
}
};
@Override
public ReactNativeHost getReactNativeHost() {
return mReactNativeHost;
}
@Override
public void onCreate() {
super.onCreate();
SoLoader.init(this, /* native exopackage */ false);
}
}
```
#### `AndroidManifest.xml`:
```xml
```
Environment
Click To Expand
**`react-native info` output:** ``` React Native Environment Info: System: OS: macOS 10.14.4 CPU: (8) x64 Intel(R) Core(TM) i7-4870HQ CPU @ 2.50GHz Memory: 30.21 MB / 16.00 GB Shell: 3.2.57 - /bin/bash Binaries: Node: 10.15.1 - /usr/local/bin/node Yarn: 1.3.2 - /usr/local/bin/yarn npm: 6.4.1 - /usr/local/bin/npm Watchman: 4.9.0 - /usr/local/bin/watchman SDKs: Android SDK: API Levels: 23, 26, 27, 28 Build Tools: 23.0.1, 23.0.3, 26.0.2, 27.0.0, 27.0.1, 27.0.3, 28.0.3 System Images: android-23 | Intel x86 Atom_64, android-23 | Google APIs Intel x86 Atom, android-23 | Google APIs Intel x86 Atom_64, android-27 | Google APIs Intel x86 Atom, android-28 | Google APIs Intel x86 Atom IDEs: Android Studio: 3.4 AI-183.6156.11.34.5522156 Xcode: /undefined - /usr/bin/xcodebuild npmPackages: react: 16.8.3 => 16.8.3 react-native: 0.59.8 => 0.59.8 npmGlobalPackages: create-react-native-app: 1.0.0 react-native-cli: 2.0.1 ``` - **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 - **Analytics** - `e.g. Instance ID` - **Are you using `TypeScript`?** - `N`
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]React Native Firebase
andInvertase
on Twitter for updates on the library.