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.7k stars 2.22k forks source link

multiple D8 warnings when minifying Android app #2517

Closed xfyre closed 4 years ago

xfyre commented 5 years ago

:fire:

Issue

When compiling Android app, multiple warnings are issued as follows:

/Users/xfire/Documents/works/dvp/dance.event/dcnet-app/node_modules/react-native-firebase/android/build/intermediates/runtime_library_classes/debug/classes.jar: D8: Type `com.google.firebase.firestore.DocumentChange$Type` was not found, it is required for default or static interface methods desugaring of `void io.invertase.firebase.firestore.FirestoreSerialize$1.<clinit>()`
/Users/xfire/Documents/works/dvp/dance.event/dcnet-app/node_modules/react-native-firebase/android/build/intermediates/runtime_library_classes/debug/classes.jar: D8: Type `com.google.android.gms.ads.MobileAds` was not found, it is required for default or static interface methods desugaring of `void io.invertase.firebase.admob.RNFirebaseAdMobRewardedVideo.<init>(java.lang.String, io.invertase.firebase.admob.RNFirebaseAdMob)`
/Users/xfire/Documents/works/dvp/dance.event/dcnet-app/node_modules/react-native-firebase/android/build/intermediates/runtime_library_classes/debug/classes.jar: D8: Type `com.google.firebase.firestore.FirebaseFirestore` was not found, it is required for default or static interface methods desugaring of `com.google.firebase.firestore.FirebaseFirestore io.invertase.firebase.firestore.RNFirebaseFirestore.getFirestoreForApp(java.lang.String)`
/Users/xfire/Documents/works/dvp/dance.event/dcnet-app/node_modules/react-native-firebase/android/build/intermediates/runtime_library_classes/debug/classes.jar: D8: Type `com.google.firebase.firestore.SetOptions` was not found, it is required for default or static interface methods desugaring of `void io.invertase.firebase.firestore.RNFirebaseFirestore.documentBatch(java.lang.String, com.facebook.react.bridge.ReadableArray, com.facebook.react.bridge.Promise)`
/Users/xfire/Documents/works/dvp/dance.event/dcnet-app/node_modules/react-native-firebase/android/build/intermediates/runtime_library_classes/debug/classes.jar: D8: Type `com.google.firebase.firestore.FieldValue` was not found, it is required for default or static interface methods desugaring of `java.util.Map io.invertase.firebase.firestore.RNFirebaseFirestore.getConstants()`
/Users/xfire/Documents/works/dvp/dance.event/dcnet-app/node_modules/react-native-firebase/android/build/intermediates/runtime_library_classes/debug/classes.jar: D8: Type `com.google.android.gms.ads.MobileAds` was not found, it is required for default or static interface methods desugaring of `void io.invertase.firebase.admob.RNFirebaseAdMob.initialize(java.lang.String)`
/Users/xfire/Documents/works/dvp/dance.event/dcnet-app/node_modules/react-native-firebase/android/build/intermediates/runtime_library_classes/debug/classes.jar: D8: Type `com.google.firebase.remoteconfig.FirebaseRemoteConfig` was not found, it is required for default or static interface methods desugaring of `void io.invertase.firebase.config.RNFirebaseRemoteConfig.fetchInternal(com.facebook.react.bridge.Promise, java.lang.Boolean, long)`
/Users/xfire/Documents/works/dvp/dance.event/dcnet-app/node_modules/react-native-firebase/android/build/intermediates/runtime_library_classes/debug/classes.jar: D8: Type `me.leolin.shortcutbadger.ShortcutBadger` was not found, it is required for default or static interface methods desugaring of `void io.invertase.firebase.notifications.RNFirebaseNotifications.setBadge(int, com.facebook.react.bridge.Promise)`
/Users/xfire/Documents/works/dvp/dance.event/dcnet-app/node_modules/react-native-firebase/android/build/intermediates/runtime_library_classes/debug/classes.jar: D8: Type `com.crashlytics.android.Crashlytics` was not found, it is required for default or static interface methods desugaring of `void io.invertase.firebase.fabric.crashlytics.RNFirebaseCrashlytics.crash()`
/Users/xfire/Documents/works/dvp/dance.event/dcnet-app/node_modules/react-native-firebase/android/build/intermediates/runtime_library_classes/debug/classes.jar: D8: Type `io.fabric.sdk.android.Fabric` was not found, it is required for default or static interface methods desugaring of `void io.invertase.firebase.fabric.crashlytics.RNFirebaseCrashlytics.enableCrashlyticsCollection()`
/Users/xfire/Documents/works/dvp/dance.event/dcnet-app/node_modules/react-native-firebase/android/build/intermediates/runtime_library_classes/debug/classes.jar: D8: Type `com.google.firebase.functions.FirebaseFunctions` was not found, it is required for default or static interface methods desugaring of `void io.invertase.firebase.functions.RNFirebaseFunctions.useFunctionsEmulator(java.lang.String, java.lang.String, java.lang.String, com.facebook.react.bridge.Promise)`
/Users/xfire/Documents/works/dvp/dance.event/dcnet-app/node_modules/react-native-firebase/android/build/intermediates/runtime_library_classes/debug/classes.jar: D8: Type `com.google.firebase.appinvite.FirebaseAppInvite` was not found, it is required for default or static interface methods desugaring of `boolean io.invertase.firebase.links.RNFirebaseLinks.isInvitation(com.google.firebase.dynamiclinks.PendingDynamicLinkData)`
/Users/xfire/Documents/works/dvp/dance.event/dcnet-app/node_modules/react-native-firebase/android/build/intermediates/runtime_library_classes/debug/classes.jar: D8: Type `com.google.firebase.dynamiclinks.FirebaseDynamicLinks` was not found, it is required for default or static interface methods desugaring of `com.google.firebase.dynamiclinks.DynamicLink$Builder io.invertase.firebase.links.RNFirebaseLinks.getDynamicLinkBuilder(com.facebook.react.bridge.ReadableMap)`
/Users/xfire/Documents/works/dvp/dance.event/dcnet-app/node_modules/react-native-firebase/android/build/intermediates/runtime_library_classes/debug/classes.jar: D8: Type `com.google.firebase.auth.PhoneAuthProvider$OnVerificationStateChangedCallbacks` was not found, it is required for default or static interface methods desugaring of `void io.invertase.firebase.auth.RNFirebaseAuth$23.onCodeAutoRetrievalTimeOut(java.lang.String)`
/Users/xfire/Documents/works/dvp/dance.event/dcnet-app/node_modules/react-native-firebase/android/build/intermediates/runtime_library_classes/debug/classes.jar: D8: Type `com.google.firebase.database.Transaction` was not found, it is required for default or static interface methods desugaring of `com.google.firebase.database.Transaction$Result io.invertase.firebase.database.RNFirebaseDatabase$1$1.doTransaction(com.google.firebase.database.MutableData)`
/Users/xfire/Documents/works/dvp/dance.event/dcnet-app/node_modules/react-native-firebase/android/build/intermediates/runtime_library_classes/debug/classes.jar: D8: Type `com.google.firebase.firestore.FieldPath` was not found, it is required for default or static interface methods desugaring of `com.google.firebase.firestore.Query io.invertase.firebase.firestore.RNFirebaseFirestoreCollectionReference.applyFilters(com.google.firebase.firestore.FirebaseFirestore, com.google.firebase.firestore.Query)`
/Users/xfire/Documents/works/dvp/dance.event/dcnet-app/node_modules/react-native-firebase/android/build/intermediates/runtime_library_classes/debug/classes.jar: D8: Type `com.google.firebase.storage.FirebaseStorage` was not found, it is required for default or static interface methods desugaring of `com.google.firebase.storage.StorageReference io.invertase.firebase.storage.RNFirebaseStorage.getReference(java.lang.String, java.lang.String)`
/Users/xfire/Documents/works/dvp/dance.event/dcnet-app/node_modules/react-native-firebase/android/build/intermediates/runtime_library_classes/debug/classes.jar: D8: Type `com.google.firebase.firestore.Query$Direction` was not found, it is required for default or static interface methods desugaring of `com.google.firebase.firestore.Query io.invertase.firebase.firestore.RNFirebaseFirestoreCollectionReference.applyOrders(com.google.firebase.firestore.Query)`
/Users/xfire/Documents/works/dvp/dance.event/dcnet-app/node_modules/react-native-firebase/android/build/intermediates/runtime_library_classes/debug/classes.jar: D8: Type `com.google.firebase.firestore.SetOptions` was not found, it is required for default or static interface methods desugaring of `java.lang.Void io.invertase.firebase.firestore.RNFirebaseFirestore$4$3.apply(com.google.firebase.firestore.Transaction)`
/Users/xfire/Documents/works/dvp/dance.event/dcnet-app/node_modules/react-native-firebase/android/build/intermediates/runtime_library_classes/debug/classes.jar: D8: Type `com.google.firebase.auth.FirebaseAuth` was not found, it is required for default or static interface methods desugaring of `void io.invertase.firebase.auth.RNFirebaseAuth.signInAnonymously(java.lang.String, com.facebook.react.bridge.Promise)`
/Users/xfire/Documents/works/dvp/dance.event/dcnet-app/node_modules/react-native-firebase/android/build/intermediates/runtime_library_classes/debug/classes.jar: D8: Type `com.google.firebase.auth.FacebookAuthProvider` was not found, it is required for default or static interface methods desugaring of `com.google.firebase.auth.AuthCredential io.invertase.firebase.auth.RNFirebaseAuth.getCredentialForProvider(java.lang.String, java.lang.String, java.lang.String)`
/Users/xfire/Documents/works/dvp/dance.event/dcnet-app/node_modules/react-native-firebase/android/build/intermediates/runtime_library_classes/debug/classes.jar: D8: Type `com.google.firebase.auth.GoogleAuthProvider` was not found, it is required for default or static interface methods desugaring of `com.google.firebase.auth.AuthCredential io.invertase.firebase.auth.RNFirebaseAuth.getCredentialForProvider(java.lang.String, java.lang.String, java.lang.String)`
/Users/xfire/Documents/works/dvp/dance.event/dcnet-app/node_modules/react-native-firebase/android/build/intermediates/runtime_library_classes/debug/classes.jar: D8: Type `com.google.firebase.auth.TwitterAuthProvider` was not found, it is required for default or static interface methods desugaring of `com.google.firebase.auth.AuthCredential io.invertase.firebase.auth.RNFirebaseAuth.getCredentialForProvider(java.lang.String, java.lang.String, java.lang.String)`
/Users/xfire/Documents/works/dvp/dance.event/dcnet-app/node_modules/react-native-firebase/android/build/intermediates/runtime_library_classes/debug/classes.jar: D8: Type `com.google.firebase.auth.GithubAuthProvider` was not found, it is required for default or static interface methods desugaring of `com.google.firebase.auth.AuthCredential io.invertase.firebase.auth.RNFirebaseAuth.getCredentialForProvider(java.lang.String, java.lang.String, java.lang.String)`
/Users/xfire/Documents/works/dvp/dance.event/dcnet-app/node_modules/react-native-firebase/android/build/intermediates/runtime_library_classes/debug/classes.jar: D8: Type `com.google.firebase.auth.OAuthProvider` was not found, it is required for default or static interface methods desugaring of `com.google.firebase.auth.AuthCredential io.invertase.firebase.auth.RNFirebaseAuth.getCredentialForProvider(java.lang.String, java.lang.String, java.lang.String)`
/Users/xfire/Documents/works/dvp/dance.event/dcnet-app/node_modules/react-native-firebase/android/build/intermediates/runtime_library_classes/debug/classes.jar: D8: Type `com.google.firebase.auth.EmailAuthProvider` was not found, it is required for default or static interface methods desugaring of `com.google.firebase.auth.AuthCredential io.invertase.firebase.auth.RNFirebaseAuth.getCredentialForProvider(java.lang.String, java.lang.String, java.lang.String)`
/Users/xfire/Documents/works/dvp/dance.event/dcnet-app/node_modules/react-native-firebase/android/build/intermediates/runtime_library_classes/debug/classes.jar: D8: Type `com.google.firebase.auth.PhoneAuthProvider` was not found, it is required for default or static interface methods desugaring of `com.google.firebase.auth.PhoneAuthCredential io.invertase.firebase.auth.RNFirebaseAuth.getPhoneAuthCredential(java.lang.String, java.lang.String)`
/Users/xfire/Documents/works/dvp/dance.event/dcnet-app/node_modules/react-native-firebase/android/build/intermediates/runtime_library_classes/debug/classes.jar: D8: Type `com.google.firebase.firestore.Blob` was not found, it is required for default or static interface methods desugaring of `java.lang.Object io.invertase.firebase.firestore.FirestoreSerialize.parseTypeMap(com.google.firebase.firestore.FirebaseFirestore, com.facebook.react.bridge.ReadableMap)`
/Users/xfire/Documents/works/dvp/dance.event/dcnet-app/node_modules/react-native-firebase/android/build/intermediates/runtime_library_classes/debug/classes.jar: D8: Type `com.google.firebase.firestore.FieldValue` was not found, it is required for default or static interface methods desugaring of `java.lang.Object io.invertase.firebase.firestore.FirestoreSerialize.parseTypeMap(com.google.firebase.firestore.FirebaseFirestore, com.facebook.react.bridge.ReadableMap)`
/Users/xfire/Documents/works/dvp/dance.event/dcnet-app/node_modules/react-native-firebase/android/build/intermediates/runtime_library_classes/debug/classes.jar: D8: Type `com.google.firebase.auth.ActionCodeSettings` was not found, it is required for default or static interface methods desugaring of `com.google.firebase.auth.ActionCodeSettings io.invertase.firebase.auth.RNFirebaseAuth.buildActionCodeSettings(com.facebook.react.bridge.ReadableMap)`
/Users/xfire/Documents/works/dvp/dance.event/dcnet-app/node_modules/react-native-firebase/android/build/intermediates/runtime_library_classes/debug/classes.jar: D8: Type `com.google.firebase.perf.FirebasePerformance` was not found, it is required for default or static interface methods desugaring of `com.google.firebase.perf.metrics.Trace io.invertase.firebase.perf.RNFirebasePerformance.getOrCreateTrace(java.lang.String)`
/Users/xfire/Documents/works/dvp/dance.event/dcnet-app/node_modules/react-native-firebase/android/build/intermediates/runtime_library_classes/debug/classes.jar: D8: Type `com.google.firebase.firestore.FirebaseFirestoreException$Code` was not found, it is required for default or static interface methods desugaring of `void io.invertase.firebase.firestore.RNFirebaseFirestore$5.<clinit>()`
/Users/xfire/Documents/works/dvp/dance.event/dcnet-app/node_modules/react-native-firebase/android/build/intermediates/runtime_library_classes/debug/classes.jar: D8: Interface `com.google.firebase.database.DatabaseReference$CompletionListener` not found. It's needed to make sure desugaring of `io.invertase.firebase.database.RNFirebaseDatabase$3` is correct. Desugaring will assume that this interface has no default method.
/Users/xfire/Documents/works/dvp/dance.event/dcnet-app/node_modules/react-native-firebase/android/build/intermediates/runtime_library_classes/debug/classes.jar: D8: Interface `com.google.android.gms.ads.reward.RewardedVideoAdListener` not found. It's needed to make sure desugaring of `io.invertase.firebase.admob.RNFirebaseAdMobRewardedVideo` is correct. Desugaring will assume that this interface has no default method.
/Users/xfire/Documents/works/dvp/dance.event/dcnet-app/node_modules/react-native-firebase/android/build/intermediates/runtime_library_classes/debug/classes.jar: D8: Interface `com.google.firebase.database.ValueEventListener` not found. It's needed to make sure desugaring of `io.invertase.firebase.database.RNFirebaseDatabaseReference$2` is correct. Desugaring will assume that this interface has no default method.
/Users/xfire/Documents/works/dvp/dance.event/dcnet-app/node_modules/react-native-firebase/android/build/intermediates/runtime_library_classes/debug/classes.jar: D8: Interface `com.google.firebase.database.ChildEventListener` not found. It's needed to make sure desugaring of `io.invertase.firebase.database.RNFirebaseDatabaseReference$4` is correct. Desugaring will assume that this interface has no default method.
/Users/xfire/Documents/works/dvp/dance.event/dcnet-app/node_modules/react-native-firebase/android/build/intermediates/runtime_library_classes/debug/classes.jar: D8: Interface `com.google.firebase.storage.OnPausedListener` not found. It's needed to make sure desugaring of `io.invertase.firebase.storage.RNFirebaseStorage$14` is correct. Desugaring will assume that this interface has no default method.
/Users/xfire/Documents/works/dvp/dance.event/dcnet-app/node_modules/react-native-firebase/android/build/intermediates/runtime_library_classes/debug/classes.jar: D8: Interface `com.google.firebase.storage.OnProgressListener` not found. It's needed to make sure desugaring of `io.invertase.firebase.storage.RNFirebaseStorage$12` is correct. Desugaring will assume that this interface has no default method.
/Users/xfire/Documents/works/dvp/dance.event/dcnet-app/node_modules/react-native-firebase/android/build/intermediates/runtime_library_classes/debug/classes.jar: D8: Interface `com.google.firebase.firestore.Transaction$Function` not found. It's needed to make sure desugaring of `io.invertase.firebase.firestore.RNFirebaseFirestore$4$3` is correct. Desugaring will assume that this interface has no default method.
/Users/xfire/Documents/works/dvp/dance.event/dcnet-app/node_modules/react-native-firebase/android/build/intermediates/runtime_library_classes/debug/classes.jar: D8: Interface `com.google.firebase.auth.FirebaseAuth$AuthStateListener` not found. It's needed to make sure desugaring of `io.invertase.firebase.auth.RNFirebaseAuth$1` is correct. Desugaring will assume that this interface has no default method.
/Users/xfire/Documents/works/dvp/dance.event/dcnet-app/node_modules/react-native-firebase/android/build/intermediates/runtime_library_classes/debug/classes.jar: D8: Type `com.google.firebase.database.FirebaseDatabase` was not found, it is required for default or static interface methods desugaring of `com.google.firebase.database.FirebaseDatabase io.invertase.firebase.database.RNFirebaseDatabase.getDatabaseForApp(java.lang.String, java.lang.String)`
/Users/xfire/Documents/works/dvp/dance.event/dcnet-app/node_modules/react-native-firebase/android/build/intermediates/runtime_library_classes/debug/classes.jar: D8: Interface `com.google.firebase.storage.StreamDownloadTask$StreamProcessor` not found. It's needed to make sure desugaring of `io.invertase.firebase.storage.RNFirebaseStorage$13` is correct. Desugaring will assume that this interface has no default method.
/Users/xfire/Documents/works/dvp/dance.event/dcnet-app/node_modules/react-native-firebase/android/build/intermediates/runtime_library_classes/debug/classes.jar: D8: Interface `com.google.firebase.firestore.EventListener` not found. It's needed to make sure desugaring of `io.invertase.firebase.firestore.RNFirebaseFirestoreDocumentReference$4` is correct. Desugaring will assume that this interface has no default method.
/Users/xfire/Documents/works/dvp/dance.event/dcnet-app/node_modules/react-native-firebase/android/build/intermediates/runtime_library_classes/debug/classes.jar: D8: Interface `com.google.firebase.database.DatabaseReference$CompletionListener` not found. It's needed to make sure desugaring of `io.invertase.firebase.database.RNFirebaseDatabase$4` is correct. Desugaring will assume that this interface has no default method.
/Users/xfire/Documents/works/dvp/dance.event/dcnet-app/node_modules/react-native-firebase/android/build/intermediates/runtime_library_classes/debug/classes.jar: D8: Interface `com.google.firebase.database.ValueEventListener` not found. It's needed to make sure desugaring of `io.invertase.firebase.database.RNFirebaseDatabaseReference$5` is correct. Desugaring will assume that this interface has no default method.
/Users/xfire/Documents/works/dvp/dance.event/dcnet-app/node_modules/react-native-firebase/android/build/intermediates/runtime_library_classes/debug/classes.jar: D8: Interface `com.google.firebase.storage.OnProgressListener` not found. It's needed to make sure desugaring of `io.invertase.firebase.storage.RNFirebaseStorage$15` is correct. Desugaring will assume that this interface has no default method.
/Users/xfire/Documents/works/dvp/dance.event/dcnet-app/node_modules/react-native-firebase/android/build/intermediates/runtime_library_classes/debug/classes.jar: D8: Interface `com.google.firebase.storage.OnPausedListener` not found. It's needed to make sure desugaring of `io.invertase.firebase.storage.RNFirebaseStorage$11` is correct. Desugaring will assume that this interface has no default method.
/Users/xfire/Documents/works/dvp/dance.event/dcnet-app/node_modules/react-native-firebase/android/build/intermediates/runtime_library_classes/debug/classes.jar: D8: Interface `com.google.firebase.database.Transaction$Handler` not found. It's needed to make sure desugaring of `io.invertase.firebase.database.RNFirebaseDatabase$1$1` is correct. Desugaring will assume that this interface has no default method.
/Users/xfire/Documents/works/dvp/dance.event/dcnet-app/node_modules/react-native-firebase/android/build/intermediates/runtime_library_classes/debug/classes.jar: D8: Interface `com.google.firebase.auth.FirebaseAuth$IdTokenListener` not found. It's needed to make sure desugaring of `io.invertase.firebase.auth.RNFirebaseAuth$2` is correct. Desugaring will assume that this interface has no default method.
/Users/xfire/Documents/works/dvp/dance.event/dcnet-app/node_modules/react-native-firebase/android/build/intermediates/runtime_library_classes/debug/classes.jar: D8: Interface `com.google.firebase.database.ChildEventListener` not found. It's needed to make sure desugaring of `io.invertase.firebase.database.RNFirebaseDatabaseReference$3` is correct. Desugaring will assume that this interface has no default method.

Project Files

Android

Click To Expand

#### Have you converted to AndroidX? - [ ] my application is an AndroidX application? - [ ] 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`: ```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.2' 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 { 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 = [ nodeExecutableAndArgs: ["node", "--max_old_space_size=4096"] ] apply from: "../../node_modules/react-native/react.gradle" apply from: "../../node_modules/react-native-vector-icons/fonts.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.dcnetapp" minSdkVersion rootProject.ext.minSdkVersion targetSdkVersion rootProject.ext.targetSdkVersion missingDimensionStrategy 'react-native-camera', 'general' versionCode 21 versionName "2.0.0" ndk { abiFilters "armeabi-v7a", "x86", "arm64-v8a", "x86_64" } } signingConfigs { release { if (project.hasProperty('DCNETAPP_RELEASE_STORE_FILE')) { storeFile file(DCNETAPP_RELEASE_STORE_FILE) storePassword DCNETAPP_RELEASE_STORE_PASSWORD keyAlias DCNETAPP_RELEASE_KEY_ALIAS keyPassword DCNETAPP_RELEASE_KEY_PASSWORD } } } 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 signingConfig signingConfigs.release 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') implementation project(':react-native-screens') implementation project(':@react-native-community_async-storage') implementation project(':react-native-square-pos') implementation project(':react-native-camera') implementation project(':react-native-gesture-handler') implementation project(':react-native-vector-icons') implementation fileTree(dir: "libs", include: ["*.jar"]) //noinspection GradleDynamicVersion implementation 'com.squareup.sdk:point-of-sale-sdk:2.+' implementation "com.android.support:appcompat-v7:${rootProject.ext.supportLibVersion}" //noinspection GradleDynamicVersion implementation "com.facebook.react:react-native:+" // From node_modules implementation "com.google.firebase:firebase-core:16.0.9" implementation "com.google.firebase:firebase-messaging:18.0.0" } // 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 = 'DcnetApp' include ':react-native-firebase' project(':react-native-firebase').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-firebase/android') include ':react-native-screens' project(':react-native-screens').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-screens/android') include ':@react-native-community_async-storage' project(':@react-native-community_async-storage').projectDir = new File(rootProject.projectDir, '../node_modules/@react-native-community/async-storage/android') include ':react-native-square-pos' project(':react-native-square-pos').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-square-pos/android') include ':react-native-camera' project(':react-native-camera').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-camera/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-vector-icons' project(':react-native-vector-icons').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-vector-icons/android') include ':app' ``` #### `MainApplication.java`: ```java package com.dcnetapp; import android.app.Application; import com.facebook.react.ReactApplication; import io.invertase.firebase.RNFirebasePackage; import io.invertase.firebase.messaging.RNFirebaseMessagingPackage; import io.invertase.firebase.notifications.RNFirebaseNotificationsPackage; import com.swmansion.rnscreens.RNScreensPackage; import com.reactnativecommunity.asyncstorage.AsyncStoragePackage; import io.matix.RNSquarePosPackage; import org.reactnative.camera.RNCameraPackage; import com.swmansion.gesturehandler.react.RNGestureHandlerPackage; import com.facebook.react.ReactNativeHost; import com.facebook.react.ReactPackage; import com.facebook.react.shell.MainReactPackage; import com.facebook.soloader.SoLoader; import com.oblador.vectoricons.VectorIconsPackage; 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 RNFirebasePackage(), new RNFirebaseMessagingPackage(), new RNFirebaseNotificationsPackage(), new RNScreensPackage(), new AsyncStoragePackage(), new RNSquarePosPackage(), new RNCameraPackage(), new RNGestureHandlerPackage(), new VectorIconsPackage() ); } }; @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:** ``` info React Native Environment Info: System: OS: macOS 10.14.6 CPU: (4) x64 Intel(R) Core(TM) i7-7567U CPU @ 3.50GHz Memory: 2.04 GB / 16.00 GB Shell: 3.2.57 - /bin/bash Binaries: Node: 12.5.0 - /usr/local/bin/node npm: 6.10.2 - /usr/local/bin/npm Watchman: 4.9.0 - /usr/local/bin/watchman SDKs: iOS SDK: Platforms: iOS 12.4, macOS 10.14, tvOS 12.4, watchOS 5.3 Android SDK: API Levels: 27, 28 Build Tools: 27.0.3, 28.0.3 System Images: android-22 | Google APIs Intel x86 Atom, android-25 | Google APIs Intel x86 Atom, android-27 | Google Play Intel x86 Atom IDEs: Xcode: 10.3/10G8 - /usr/bin/xcodebuild npmPackages: react: ^16.8.3 => 16.8.6 react-native: ^0.59.10 => 0.59.10 npmGlobalPackages: react-native-git-upgrade: 0.2.7 react-native: 0.59.0 ``` - **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-firebase` version you're using that has this issue:** - `5.5.6` - **`Firebase` module(s) you're using that has the issue:** - `Cloud Messaging` - **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]

xfyre commented 5 years ago

Note: same problem was already reported in #2284, but was closed for not following the issue template.

mikehardy commented 5 years ago

I can confirm with D8 and even most recent gradle plugin 3.5.0 I get lots of warnings like this

I think the proguard rules might need some investigation

I tagged it with Build error since that's the closes label we have but please note that it is just a warning, and I have had no problems with the app functioning

en-archx commented 5 years ago

Hi I got same issue with this D8: Type and im suspecting this was the reason for me have an error:

Exception in HostObject::get(propName:RNFirebase): 
    java.lang.NoClassDefFoundError: Failed resolution of: 
    Lcom/google/firebase/FirebaseApp
mikehardy commented 5 years ago

I want to be reiterate that I see the warnings but I have no problems with the app functioning. I don't believe the warnings as described in this issue are actually a high priority error at the moment. Two thoughts @en-archx - you may have a multidex issue (you didn't say what API you have a problem with) - https://github.com/mikehardy/rnfbdemo/blob/master/make-demo.sh#L123 - or you have maybe not included the proguard directives during react-native-firebase install? https://rnfirebase.io/docs/v5.x.x/installation/android#Using-with-Proguard-enabled

If it's not that, then that NoClassDefFoundError is definitely unexpected - I don't reproduce it in my projects or in rnfbdemo

kumbhar-ketan commented 5 years ago

@mikehardy I have done like what you said. But still i'm getting those warnings.

mikehardy commented 5 years ago

I still get them too. I test app functionality and everything works, so to me it is a problem but not a high priority, PRs welcome

ghost commented 5 years ago

Hi, our firebase not working in the compile version, i think this might be related to this

mikehardy commented 5 years ago

@robert589 do you mean release version? So you have tested it with minify/proguard enabled and it fails and disabled it works? Then you've done some basic things like enable it again but set wide-ranging 'keep' directives and it works again?

lucidvision commented 5 years ago

Hi everyone!

I just created a fresh react-native project and configured Auth, Firestore, Messaging and Crashanalytics and it crashes on launch on Android. It works on the first build, but subsequent rebuilds crash.

mikehardy commented 5 years ago

that sounds like a fully separate issue @lucidvision - can you reproduce this with https://github.com/mikehardy/rnfbdemo/blob/master/make-demo.sh (a cloneable demo that should "just work" if put the google json / plist in the right spot) ?

I will be able to troubleshoot if you can reproduce it there

lucidvision commented 5 years ago

Your script is working on Android. I'm not sure what I did wrong in configuration. I'm pretty sure I followed the documentation closely and kept it to the basics on a fresh react-native install.

I got this error when running your script:

Screen Shot 2019-09-27 at 12 49 21 PM

Building in iOS causes this error:

Screen Shot 2019-09-27 at 12 56 28 PM

Do you mind letting me know how to resolve? Thank you very much for your help! @mikehardy

mikehardy commented 5 years ago

I made that demo just because it's so fiendish to get correct and I wanted a fully automated reproducible thing I could use myself and show others. Frequently it's a matter order of operations even.

I actually haven't run this since react-native 0.61.x (on 0.61.1 now) came out, so the ios failure must be a difference between those two but I'm not sure what. I can say I have 0.61.1 working in my project at least. If you took the demo and pinned it to 0.60.6 react-native version it should work until I get a chance to diagnose

lucidvision commented 5 years ago

Hi Mike!

Just wanted to report that updating the pod file to match the pod file for 0.61.1 as shown in rn-diff fixes the issue:

https://raw.githubusercontent.com/react-native-community/rn-diff-purge/release/0.61.1/RnDiffApp/ios/Podfile

Thanks again for your help and this script you wrote! It's very helpful. @mikehardy

mikehardy commented 5 years ago

Ah thanks! That makes sense, I really should do the Podfile dynamically as well so that isn't so fragile between upgrades either, the Podfile did change quite a bit between RN60-61

stale[bot] commented 5 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.

lgh06 commented 4 years ago

Maybe the bug is caused by, you forgot to open your android emulator then run react-native run-android. open android emulator first.


also try upgrade gradle version in android/gradle/wrapper/gradle-wrapper.properties

see also https://stackoverflow.com/questions/52783212/how-to-resolve-multiple-d8-warnings-class-x-was-not-found-it-is-required-for


https://developer.android.com/studio/releases/gradle-plugin#3-4-0
notice R8 enabled by default

https://developer.android.com/studio/releases/gradle-plugin#3-1-0
notice android.enableIncrementalDesugaring=false

byteab commented 4 years ago

when I enable the proguard it throw these error. an app crash on startup

/Users/x/Desktop/y/node_modules/react-native-firebase/android/build/intermediates/runtime_library_classes/release/classes.jar: D8
: Interface `com.google.firebase.database.Transaction$Handler` not found. It's needed to make sure desugaring of `io.invertase.firebase.databas
e.RNFirebaseDatabase$1$1` is correct. Desugaring will assume that this interface has no default method.

other wise it work correctly I think the problem is with proguard rules

mikehardy commented 4 years ago

@EhsanSarshar this issue has been closed, and the app does not crash for others. Please create a new issue, ideally with a reproducible example, and the information requested in the template (most importantly gradle items)

byteab commented 4 years ago

@mikehardy I think I should forget about proguard and build my app without it. I don't think enabling proguard is such a big deal.

mikehardy commented 4 years ago

I have no problem running R8 (note, proguard is actually not used anymore in the Android world) and am not aware of anyone else having problems as well. react-native-firebase works fine with release mode code shrinking.

I requested more data multiple times because that would help isolate the problem. We don't even know if you are on react-native-firebase v5 or v6 at this point.

The results of using a shrinker can be dramatic, and your users would likely appreciate it if your app footprint was smaller, but, your choice.