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

Execution failed for task ':app:transformClassesWithMultidexlistForDebug'. #5476

Closed Maharshi01 closed 3 years ago

Maharshi01 commented 3 years ago

Issue

Hi @mikehardy,

Suddenly, today out of the blue I'm facing the following issue when I run react-native-run-android, earlier this used to not happen. As the issue is pointing to the FirebasePerformancePlugin folder, I thought it could be related to firebase. So, posting the issue here, can you please help to solve this. This is the issue I'm facing :

/Users/**/Desktop/***/android/app/build/intermediates/transforms/FirebasePerformancePlugin/debug/49/module-info.class: D8: Unsupported source file type

FAILURE: Build failed with an exception.

Screenshot 2021-07-03 at 9 32 36 PM

Project Files

Javascript

Click To Expand

#### `package.json`: { "name": "MyUMobile", "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 .", "build:ios": "react-native bundle --entry-file='index.js' --bundle-output='./ios/main.jsbundle' --dev=false --platform='ios' --assets-dest='./ios'", "build:android": "react-native bundle --platform android --dev false --entry-file index.js --bundle-output android/app/src/main/assets/index.android.bundle --assets-dest android/app/src/main/res", "android:clean": "rm -rf ./android/app/src/main/res/drawable-mdpi/ && rm -rf ./android/app/src/main/res/raw/", "clean": "watchman watch-del-all && rm -rf $TMPDIR/react-native-packager-cache-* && rm -rf $TMPDIR/metro-bundler-cache-*" }, "dependencies": { "@el173/react-native-hms": "^1.2.1", "@react-native-community/async-storage": "^1.6.2", "@react-native-community/netinfo": "^4.4.0", "@react-native-community/viewpager": "^3.3.0", "@react-native-firebase/analytics": "^7.6.7", "@react-native-firebase/app": "^8.4.5", "@react-native-firebase/crashlytics": "^8.4.9", "@react-native-firebase/dynamic-links": "^7.5.9", "@react-native-firebase/messaging": "^7.9.0", "axios": "^0.19.0", "crypto-js": "^3.1.9-1", "jetifier": "^1.6.5", "lottie-ios": "^3.1.3", "lottie-react-native": "^3.2.1", "moment": "^2.24.0", "react": "16.9.0", "react-native": "0.61.2", "react-native-animatable": "^1.3.3", "react-native-collapsible": "^1.5.1", "react-native-config": "^0.11.7", "react-native-contacts-chooser": "^1.0.0-alpha.2", "react-native-dash": "0.0.11", "react-native-device-info": "^2.1.3", "react-native-elements": "^1.2.6", "react-native-fast-image": "^7.0.2", "react-native-fbsdk": "^2.0.0", "react-native-geocoding": "^0.4.0", "react-native-geolocation-service": "^5.0.0", "react-native-gesture-handler": "^1.5.2", "react-native-google-places-autocomplete": "^2.0.3", "react-native-image-crop-picker": "^0.26.0", "react-native-image-resizer": "^1.2.1", "react-native-keyboard-manager": "^4.0.13-15", "react-native-linear-gradient": "^2.5.6", "react-native-localization": "^2.1.6", "react-native-maps": "0.26.1", "react-native-masked-text": "^1.13.0", "react-native-modal-datetime-picker": "^7.6.0", "react-native-picker-select": "^6.3.3", "react-native-progress": "^3.6.0", "react-native-raw-bottom-sheet": "^2.0.5", "react-native-reanimated": "^1.4.0", "react-native-render-html": "^4.1.2", "react-native-screens": "^2.0.0-alpha.4", "react-native-select-contact": "^1.2.1", "react-native-snap-carousel": "^3.8.2", "react-native-splash-screen": "^3.2.0", "react-native-ssl-pinning": "^1.4.5", "react-native-touch-id": "^4.4.1", "react-native-vector-icons": "^6.6.0", "react-native-view-pdf": "^0.10.1", "react-native-walkthrough-tooltip": "^1.1.7", "react-native-webview": "^7.4.2", "react-navigation": "^4.0.10", "react-navigation-drawer": "^2.3.3", "react-navigation-stack": "^1.9.4", "react-navigation-tabs": "^2.5.6", "react-redux": "^7.1.1", "react-timer-mixin": "^0.13.4", "redux": "^4.0.4", "redux-persist": "^6.0.0", "redux-thunk": "^2.3.0", "rn-fetch-blob": "^0.11.2", "yup": "^0.27.0" }, "devDependencies": { "@babel/core": "7.6.4", "@babel/runtime": "7.6.3", "@react-native-community/eslint-config": "0.0.3", "babel-jest": "24.9.0", "eslint": "6.5.1", "jest": "24.9.0", "metro-react-native-babel-preset": "0.51.1", "react-test-renderer": "16.9.0", "redux-devtools": "^3.5.0" }, "peerDependencies": { "prop-types": ">=15.7.2" }, "jest": { "preset": "react-native" } } #### `firebase.json` for react-native-firebase v6: ```json # N/A ```

iOS

Click To Expand

#### `ios/Podfile`: - [ ] I'm not using Pods - [x] I'm using Pods and my Podfile looks like: ```ruby # N/A ``` #### `AppDelegate.m`: ```objc // N/A ```


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`: // Top-level build file where you can add configuration options common to all sub-projects/modules. buildscript { ext { buildToolsVersion = "28.0.3" minSdkVersion = 19 compileSdkVersion = 29 targetSdkVersion = 29 supportLibVersion = "28.0.0" } repositories { google() jcenter() //Huawei Maven repository address for the AppGallery Connect SDK. maven {url 'https://developer.huawei.com/repo/'} //To download the facebook SDK from the Maven Central Repository. mavenCentral() } dependencies { classpath 'com.android.tools.build:gradle:3.4.3' classpath 'com.google.gms:google-services:4.3.4' classpath 'com.google.firebase:firebase-crashlytics-gradle:2.2.0' //AppGallery Connect plug-in address. classpath 'com.huawei.agconnect:agcp:1.3.2.301' classpath 'com.google.firebase:perf-plugin:1.3.1' // 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://maven.google.com' } maven { url "https://jitpack.io" } //Huawei Maven repository address for the AppGallery Connect SDK. maven {url 'https://developer.huawei.com/repo/'} } } #### `android/app/build.gradle`: apply plugin: "com.android.application" apply plugin: 'com.google.firebase.firebase-perf' apply from: project(':react-native-config').projectDir.getPath() + "/dotenv.gradle" 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", * * // https://facebook.github.io/react-native/docs/performance#enable-the-ram-format * bundleCommand: "ram-bundle", * * // 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", enableHermes: true, // clean and rebuild if changing // bundleInDebug: true bundleInRelease: true ] 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 /** * The preferred build flavor of JavaScriptCore. * * 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:+' /** * Whether to enable the Hermes VM. * * This should be set on project.ext.react and mirrored here. If it is not set * on project.ext.react, JavaScript will not be compiled to Hermes Bytecode * and the benefits of using Hermes will therefore be sharply reduced. */ def enableHermes = project.ext.react.get("enableHermes", false) android { compileSdkVersion rootProject.ext.compileSdkVersion aaptOptions.cruncherEnabled = false aaptOptions.useNewCruncher = false compileOptions { sourceCompatibility JavaVersion.VERSION_1_8 targetCompatibility JavaVersion.VERSION_1_8 } defaultConfig { applicationId "com.omesti.myumobile" minSdkVersion rootProject.ext.minSdkVersion targetSdkVersion rootProject.ext.targetSdkVersion versionCode 199 versionName "3.6.3" multiDexEnabled true } splits { abi { reset() enable enableSeparateBuildPerCPUArchitecture universalApk false // If true, also generate a universal APK include "armeabi-v7a", "x86", "arm64-v8a", "x86_64" } } signingConfigs { release { if (project.hasProperty('MYAPP_UPLOAD_STORE_FILE')) { storeFile file(MYAPP_UPLOAD_STORE_FILE) storePassword MYAPP_UPLOAD_STORE_PASSWORD keyAlias MYAPP_UPLOAD_KEY_ALIAS keyPassword MYAPP_UPLOAD_KEY_PASSWORD } } } buildTypes { // debug { // signingConfig signingConfigs.debug // } release { // Caution! In production, you need to generate your own keystore file. // see https://facebook.github.io/react-native/docs/signed-apk-android. signingConfig signingConfigs.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: // https://developer.android.com/studio/build/configure-apk-splits.html 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 } } } dexOptions { javaMaxHeapSize "4g" } } dependencies { implementation project(':react-native-fbsdk') implementation project(':el173_react-native-hms') implementation project(':react-native-maps') implementation 'com.android.support:support-v4:19.0.0' implementation project(':react-native-device-info') implementation project(':react-native-contacts-chooser') implementation project(':react-native-reanimated') implementation project(':react-native-gesture-handler') implementation fileTree(dir: "libs", include: ["*.jar"]) implementation "com.facebook.react:react-native:0.20.1" // From node_modules implementation 'com.facebook.fresco:animated-base-support:1.3.0' //############## Manually installed dependencies START ############## // Firebase dependencies implementation "com.google.firebase:firebase-messaging:20.0.0" implementation 'me.leolin:ShortcutBadger:1.1.22@aar' implementation "com.google.android.gms:play-services-base:17.1.0" implementation "com.google.firebase:firebase-core:17.2.0" implementation 'com.google.firebase:firebase-analytics:17.2.0' implementation 'com.google.firebase:firebase-perf:17.0.2' implementation "com.google.firebase:firebase-invites:17.0.0" implementation 'androidx.appcompat:appcompat:1.1.0' implementation 'androidx.swiperefreshlayout:swiperefreshlayout:1.1.0-alpha03' // Appoxee implementation 'com.google.dagger:dagger:2.23.1' implementation "com.google.dagger:dagger-android-support:2.23.1" implementation 'com.google.code.gson:gson:2.8.5' implementation project(':Mapp_Android_SDK_virginia-5.1.3') //Huawei dependencies implementation 'com.huawei.agconnect:agconnect-core:1.3.2.301' implementation 'com.huawei.agconnect:agconnect-crash:1.3.2.301' implementation 'com.huawei.hms:hianalytics:5.0.1.300' implementation 'com.huawei.hms:push:5.0.1.300' //Facebook SDK dependencies implementation 'com.facebook.android:facebook-android-sdk:[5,6)' implementation 'com.facebook.android:facebook-core:[5,6)' implementation 'com.facebook.android:facebook-applinks:[5,6)' //############## Manually installed dependencies END ############## implementation 'com.huawei.hms:location:4.0.4.300' //############## Manually installed dependencies END ############## if (enableHermes) { def hermesPath = "../../node_modules/hermes-engine/android/" debugImplementation files(hermesPath + "hermes-debug.aar") releaseImplementation files(hermesPath + "hermes-release.aar") } else { implementation jscFlavor } } // 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 from: file("../../node_modules/@react-native-community/cli-platform-android/native_modules.gradle"); applyNativeModulesAppBuildGradle(project) apply plugin: 'com.google.gms.google-services' apply plugin: 'com.google.firebase.crashlytics' //Huawei Plugin Address apply plugin: 'com.huawei.agconnect' #### `android/settings.gradle`: rootProject.name = 'MyUMobile' include ':react-native-fbsdk' project(':react-native-fbsdk').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-fbsdk/android') include ':el173_react-native-hms' project(':el173_react-native-hms').projectDir = new File(rootProject.projectDir, '../node_modules/@el173/react-native-hms/android') include ':react-native-select-contact' project(':react-native-select-contact').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-select-contact/android') include ':react-native-maps' project(':react-native-maps').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-maps/lib/android') include ':react-native-device-info' project(':react-native-device-info').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-device-info/android') include ':react-native-contacts-chooser' project(':react-native-contacts-chooser').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-contacts-chooser/android') include ':react-native-reanimated', ':Mapp_Android_SDK_virginia-5.1.3' 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') apply from: file("../node_modules/@react-native-community/cli-platform-android/native_modules.gradle"); applyNativeModulesSettingsGradle(settings) include ':app' #### `MainApplication.java`: package com.omesti.myumobile; import android.app.Application; import android.content.Context; import android.util.Log; import android.webkit.WebView; import androidx.appcompat.app.AppCompatDelegate; import com.appoxee.Appoxee; import com.appoxee.AppoxeeOptions; import com.appoxee.push.NotificationMode; import com.el173.map.HMSMapsPackage; import com.omesti.myumobile.mapp.RNMappPackage; import com.omesti.myumobile.gpsalert.RNGPSPackage; import com.omesti.myumobile.fbapplink.FBAppLinkPackage; import com.omesti.myumobile.hmsalert.RNHMSPackage; import com.omesti.myumobile.hmslocation.RNHMSLocationPackage; import com.facebook.react.PackageList; import com.facebook.react.ReactApplication; import com.facebook.reactnative.androidsdk.FBSDKPackage; import com.el173.HMSPackage; import com.airbnb.android.react.maps.MapsPackage; import com.learnium.RNDeviceInfo.RNDeviceInfo; import com.bluebamboostudios.RNContactsPickerPackage; import com.omesti.myumobile.share.ShareFilePackage; import com.swmansion.reanimated.ReanimatedPackage; import com.facebook.react.ReactNativeHost; import com.facebook.react.ReactPackage; import com.facebook.soloader.SoLoader; import com.google.firebase.analytics.FirebaseAnalytics; import com.omesti.myumobile.gpsalert.RNGPSPackage; import com.omesti.myumobile.hmsalert.RNHMSPackage; import com.omesti.myumobile.hmslocation.RNHMSLocationPackage; import com.omesti.myumobile.mapp.RNMappPackage; import com.omesti.myumobile.share.ShareFilePackage; import java.lang.reflect.InvocationTargetException; import java.util.ArrayList; import java.util.List; public class MainApplication extends Application implements ReactApplication { private FirebaseAnalytics mFirebaseAnalytics; private final ReactNativeHost mReactNativeHost = new ReactNativeHost(this) { @Override public boolean getUseDeveloperSupport() { return BuildConfig.DEBUG; } @Override protected List getPackages() { ArrayList packages = new PackageList(this).getPackages(); // Manually added packages packages.add(new RNMappPackage()); packages.add(new RNGPSPackage()); packages.add(new FBAppLinkPackage()); packages.add(new ShareFilePackage()); packages.add(new RNHMSPackage()); packages.add(new RNHMSLocationPackage()); packages.add(new HMSMapsPackage()); return packages; } @Override protected String getJSMainModuleName() { return "index"; } }; @Override public ReactNativeHost getReactNativeHost() { return mReactNativeHost; } @Override public void onCreate() { super.onCreate(); SoLoader.init(this, false); initializeFlipper(this); WebView.setWebContentsDebuggingEnabled(true); //exclude resources AppCompatDelegate.setCompatVectorFromResourcesEnabled(false); // Obtain the FirebaseAnalytics instance. mFirebaseAnalytics = FirebaseAnalytics.getInstance(this); AppoxeeOptions appoxeeOptions = new AppoxeeOptions(); appoxeeOptions.sdkKey = "5dee67615545b5.96939880"; appoxeeOptions.googleProjectId = "772828048877"; appoxeeOptions.cepURL = "https://jamie.h.shortest-route.com"; appoxeeOptions.appID = "109880"; appoxeeOptions.tenantID = "60145"; appoxeeOptions.notificationMode = NotificationMode.BACKGROUND_AND_FOREGROUND; // appoxeeOptions.server = AppoxeeOptions.Server.EMC_US; Appoxee.engage(this, appoxeeOptions); Log.d("Appoxee", "engage()"); } private static void initializeFlipper(Context context) { if (BuildConfig.DEBUG) { try { Class aClass = Class.forName("com.facebook.flipper.ReactNativeFlipper"); aClass.getMethod("initializeFlipper", Context.class).invoke(null, context); } catch (ClassNotFoundException | NoSuchMethodException | IllegalAccessException | InvocationTargetException e) { e.printStackTrace(); } } } } #### `AndroidManifest.xml`:


Environment

Click To Expand

**`react-native info` output:** ``` System: OS: macOS 10.15.7 CPU: (4) x64 Intel(R) Core(TM) i5-3210M CPU @ 2.50GHz Memory: 19.45 MB / 8.00 GB Shell: 3.2.57 - /bin/bash Binaries: Node: 14.15.1 - /usr/local/bin/node Yarn: 1.13.0 - /usr/local/bin/yarn npm: 6.14.8 - /usr/local/bin/npm Watchman: 4.9.0 - /usr/local/bin/watchman SDKs: iOS SDK: Platforms: iOS 14.4, DriverKit 20.2, macOS 11.1, tvOS 14.3, watchOS 7.2 IDEs: Android Studio: 4.2 AI-202.7660.26.42.7486908 Xcode: 12.4/12D4e - /usr/bin/xcodebuild npmPackages: react: 16.9.0 => 16.9.0 react-native: 0.61.2 => 0.61.2 npmGlobalPackages: react-native-cli: 2.0.1``` - **Platform that you're experiencing the issue on**: - [X ] iOS - [ ] Android - [X] **iOS** but have not tested behavior on Android - [X] **Android** but have not tested behavior on iOS - [X] Both - **`react-native-firebase` version you're using that has this issue:** - "@react-native-firebase/analytics": "^7.6.7", "@react-native-firebase/app": "^8.4.5", "@react-native-firebase/crashlytics": "^8.4.9", "@react-native-firebase/dynamic-links": "^7.5.9", "@react-native-firebase/messaging": "^7.9.0", - **`Firebase` module(s) you're using that has the issue:** - `e.g. Instance ID` - **Are you using `TypeScript`?** - `Y/N` & `VERSION`


mikehardy commented 3 years ago

Hey @Maharshi01 - if you can demonstrate a reproduction of this (https://stackoverflow.com/help/minimal-reproducible-example) after you update your packages to current stable, I can take a look - these are too old to spend any time on:


"@react-native-firebase/analytics": "^7.6.7",
"@react-native-firebase/app": "^8.4.5",
"@react-native-firebase/crashlytics": "^8.4.9",
"@react-native-firebase/dynamic-links": "^7.5.9",
"@react-native-firebase/messaging": "^7.9.0",

https://github.com/mikehardy/rnfbdemo/blob/master/make-demo.sh is an example of current versions and it all works as does my work project

Maharshi01 commented 3 years ago

Okay @mikehardy.