invertase / react-native-firebase

🔥 A well-tested feature-rich modular Firebase implementation for React Native. Supports both iOS & Android platforms for all Firebase services.
https://rnfirebase.io
Other
11.63k stars 2.2k forks source link

Unable to find a matching configuration of project :@react-native-firebase_auth #3093

Closed Uttu316 closed 4 years ago

Uttu316 commented 4 years ago

Issue

After building the released apk. I am not able to build it again. It gives me an error every time I try. I have already tried every possible solution available on the internet.

FAILURE: Build failed with an exception.

Project Files

Javascript

Click To Expand

#### `package.json`: { "scripts": { "start": "react-native start", "android": "react-native run-android", "ios": "react-native run-ios", "web": "expo start --web", "postinstall": "jetify" }, "dependencies": { "@react-native-firebase/app": "^6.2.0", "@twotalltotems/react-native-otp-input": "^1.1.4", "expo": "^35.0.1", "expo-cli": "^3.10.2", "firebase": "^7.6.1", "react": "16.8.3", "react-addons-update": "^15.6.2", "react-dom": "16.8.3", "react-native": "0.59.10", "react-native-actionsheet": "^2.4.2", "react-native-carousel-view": "^0.5.1", "react-native-datepicker": "^1.7.2", "react-native-elements": "^1.2.7", "react-native-firebase": "5.6.0", "react-native-gesture-handler": "~1.3.0", "react-native-maps": "^0.26.1", "react-native-material-dropdown": "^0.11.1", "react-native-paper": "^3.2.1", "react-native-push-notification": "^3.1.9", "react-native-reanimated": "~1.3.0", "react-native-screens": "1.0.0-alpha.23", "react-native-snackbar-component": "^1.1.2", "react-native-unimodules": "0.6.0", "react-native-vector-icons": "^6.6.0", "react-native-web": "^0.11.7", "react-navigation": "^4.0.10", "react-navigation-drawer": "^2.3.3", "react-navigation-material-bottom-tabs": "^2.1.5", "react-navigation-stack": "^1.10.3", "react-navigation-tabs": "^2.6.2", "react-redux": "^7.1.3", "redux": "^4.0.4" }, "devDependencies": { "@babel/core": "^7.6.0", "babel-jest": "24.9.0", "jest": "24.9.0", "jetifier": "^1.6.4", "metro-react-native-babel-preset": "0.56.0", "react-test-renderer": "16.9.0", "babel-preset-expo": "^7.1.0" }, "private": true } ### Android

Click To Expand

#### `android/build.gradle`: // Top-level build file where you can add configuration options common to all sub-projects/modules. buildscript { ext { buildToolsVersion = "28.0.3" minSdkVersion = 21 compileSdkVersion = 28 targetSdkVersion = 27 supportLibVersion = "28.0.0" androidMapsUtilsVersion = "0.5+" googlePlayServicesVersion = "15.0.1" } repositories { google() jcenter() } dependencies { classpath 'com.android.tools.build:gradle:3.5.0' classpath 'com.google.gms:google-services:4.2.0' // NOTE: Do not place your application dependencies here; they belong // in the individual module build.gradle files } } allprojects { repositories { google() mavenLocal() jcenter() maven { // All of React Native (JS, Obj-C sources, Android binaries) is installed from npm url "$rootDir/../node_modules/react-native/android" } } } wrapper { gradleVersion = '4.7' distributionUrl = distributionUrl.replace("bin", "all") } #### `android/app/build.gradle`: apply plugin: "com.android.application" import com.android.build.OutputFile project.ext.react = [ entryFile: "index.js" ] apply from: '../../node_modules/react-native-unimodules/gradle.groovy' apply from: "../../node_modules/react-native/react.gradle" def enableSeparateBuildPerCPUArchitecture = true def enableProguardInReleaseBuilds = true android { compileSdkVersion rootProject.ext.compileSdkVersion buildToolsVersion rootProject.ext.buildToolsVersion defaultConfig { applicationId "com.reactprojects" minSdkVersion rootProject.ext.minSdkVersion targetSdkVersion rootProject.ext.targetSdkVersion versionCode 1 versionName "1.0" } splits { abi { reset() enable enableSeparateBuildPerCPUArchitecture universalApk true // 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 } } } compileOptions { sourceCompatibility JavaVersion.VERSION_1_8 targetCompatibility JavaVersion.VERSION_1_8 } } dependencies { implementation project(':react-native-vector-icons') implementation project(':react-native-firebase') implementation project(path: ":@react-native-firebase_auth") implementation project(':react-native-screens') implementation project(':react-native-reanimated') implementation project(':react-native-gesture-handler') 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.android.gms:play-services-base:17.1.0" implementation 'com.google.firebase:firebase-core:17.2.1' implementation 'com.google.firebase:firebase-auth:19.2.0' implementation project(':react-native-maps') addUnimodulesDependencies() } // 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`: apply from: '../node_modules/react-native-unimodules/gradle.groovy' include ':react-native-vector-icons' project(':react-native-vector-icons').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-vector-icons/android') include ':react-native-push-notification' project(':react-native-push-notification').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-push-notification/android') include ':@react-native-firebase_app' project(':@react-native-firebase_app').projectDir = new File(rootProject.projectDir, './../node_modules/@react-native-firebase/app/android') include ':react-native-firebase' project(':react-native-firebase').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-firebase/android') include ':@react-native-firebase_auth' project(':@react-native-firebase_auth').projectDir = new File(rootProject.projectDir, '../node_modules/@react-native-firebase/auth/android') include ':react-native-screens' project(':react-native-screens').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-screens/android') include ':react-native-reanimated' project(':react-native-reanimated').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-reanimated/android') include ':react-native-gesture-handler' project(':react-native-gesture-handler').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-gesture-handler/android') include ':react-native-maps' project(':react-native-maps').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-maps/lib/android') includeUnimodulesProjects() rootProject.name = 'ReactProjects' include ':app' #### `MainApplication.java`: package com.reactprojects; import android.app.Application; import com.facebook.react.ReactApplication; import io.invertase.firebase.auth.ReactNativeFirebaseAuthPackage; import com.oblador.vectoricons.VectorIconsPackage; import io.invertase.firebase.auth.RNFirebaseAuthPackage; import io.invertase.firebase.RNFirebasePackage; import com.facebook.react.ReactNativeHost; import com.facebook.react.ReactPackage; import com.facebook.react.shell.MainReactPackage; import com.facebook.soloader.SoLoader; import com.reactprojects.generated.BasePackageList; import com.swmansion.reanimated.ReanimatedPackage; import com.swmansion.rnscreens.RNScreensPackage; import com.swmansion.gesturehandler.react.RNGestureHandlerPackage; import io.invertase.firebase.ReactNativeFirebaseAppPackage; import org.unimodules.adapters.react.ReactAdapterPackage; import org.unimodules.adapters.react.ModuleRegistryAdapter; import org.unimodules.adapters.react.ReactModuleRegistryProvider; import org.unimodules.core.interfaces.Package; import org.unimodules.core.interfaces.SingletonModule; import expo.modules.constants.ConstantsPackage; import expo.modules.permissions.PermissionsPackage; import expo.modules.filesystem.FileSystemPackage; import com.airbnb.android.react.maps.MapsPackage; import java.util.Arrays; import java.util.List; public class MainApplication extends Application implements ReactApplication { private final ReactModuleRegistryProvider mModuleRegistryProvider = new ReactModuleRegistryProvider( new BasePackageList().getPackageList(), Arrays.asList() ); private final ReactNativeHost mReactNativeHost = new ReactNativeHost(this) { @Override public boolean getUseDeveloperSupport() { return BuildConfig.DEBUG; } @Override protected List getPackages() { return Arrays.asList( new MainReactPackage(), new ReactNativeFirebaseAuthPackage(), new VectorIconsPackage(), new RNFirebasePackage(), new ReanimatedPackage(), new RNGestureHandlerPackage(), new RNScreensPackage(), new MapsPackage(), new RNFirebaseAuthPackage(), new ModuleRegistryAdapter(mModuleRegistryProvider) ); } @Override protected String getJSMainModuleName() { return "index"; } }; @Override public ReactNativeHost getReactNativeHost() { return mReactNativeHost; } @Override public void onCreate() { super.onCreate(); SoLoader.init(this, /* native exopackage */ false); } }

mikehardy commented 4 years ago

It can take quite a while to figure out how each individual project has integration problems with this module, with varied success. What I can assert 100% is that it works though, so this is a project problem, not a problem with react-native-firebase, and I can point you to this repo which you can clone and run this script to prove it runs: https://github.com/mikehardy/rnfbdemo/blob/master/make-demo-v6.sh

The results of running that can be used to compare with your project to see where things went wrong?

Uttu316 commented 4 years ago

Thanks, I'll definitely look into this.

stale[bot] commented 4 years ago

Hello 👋, to help manage issues we automatically close stale issues. This issue has been automatically marked as stale because it has not had activity for quite some time. Has this issue been fixed, or does it still require the community's attention?

This issue will be closed in 15 days if no further activity occurs. Thank you for your contributions.

stale[bot] commented 4 years ago

Closing this issue after a prolonged period of inactivity. If this is still present in the latest release, please feel free to create a new issue with up-to-date information.