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

[🐛] Gradle Build failed firebase_perf:generateDebugRFile - with react native version 0.63.4 , gradleversion : gradle-7.0.2-all #6460

Closed chetan-housing closed 2 years ago

chetan-housing commented 2 years ago

Issue

On running npm run install:android script which calls cd android && ./gradlew installDebug

gradle fails with message

* What went wrong:
Execution failed for task ':react-native-firebase_perf:generateDebugRFile'.
> A failure occurred while executing com.android.build.gradle.internal.res.GenerateLibraryRFileTask$GenerateLibRFileRunnable
   > /Users/chetangupta/Desktop/chetan/housing/housing-app/node_modules/@react-native-firebase/app/android/build/intermediates/symbol_list_with_package_name/debug/package-aware-r.txt

package.json:

"dependencies": {
    "@babel/preset-typescript": "^7.16.7",
    "@gorhom/bottom-sheet": "4.1.5",
    "@ptomasroos/react-native-multi-slider": "1.0.0",
    "@react-native-async-storage/async-storage": "1.13.2",
    "@react-native-community/cli": "2.9.0",
    "@react-native-community/cli-platform-android": "^8.0.2",
    "@react-native-community/cli-platform-ios": "4.13.0",
    "@react-native-community/masked-view": "0.1.10",
    "@react-native-community/netinfo": "4.1.4",
    "@react-native-community/viewpager": "3.3.0",
    "@react-native-firebase/analytics": "7.6.8",
    "@react-native-firebase/app": "8.4.6",
    "@react-native-firebase/crashlytics": "8.4.10",
    "@react-native-firebase/dynamic-links": "7.5.10",
    "@react-native-firebase/messaging": "7.9.1",
    "@react-native-firebase/perf": "7.4.9",
    "@react-native-firebase/remote-config": "9.0.11",
    "@react-navigation/bottom-tabs": "5.5.2",
    "@react-navigation/material-top-tabs": "5.2.11",
    "@react-navigation/native": "5.6.1",
    "@react-navigation/stack": "5.5.1",
    "@sentry/react-native": "3.4.2",
    "@skele/components": "1.0.0-alpha.30",
    "amplitude-js": "7.4.1",
    "buffer": "5.2.1",
    "bugsnag-react-native": "2.23.10",
    "capitalize": "1.0.0",
    "crypto-js": "3.1.9-1",
    "events": "3.0.0",
    "flux-standard-action": "1.1.0",
    "hermes-engine": "^0.5.2-rc1",
    "hoist-non-react-statics": "1.2.0",
    "i": "^0.3.7",
    "immutable": "3.8.1",
    "jsc-android": "241213.x.x",
    "jssha": "2.3.1",
    "lottie-ios": "3.2.3",
    "lottie-react-native": "5.1.3",
    "moti": "0.17.1",
    "npm": "^8.12.0",
    "patch-package": "^6.4.7",
    "prop-types": "15.6.1",
    "quickblox-react-native-sdk": "^0.5.19-beta",
    "ramda": "0.24.0",
    "react": "16.13.1",
    "react-mixin": "2.0.2",
    "react-native": "0.63.4",
    "react-native-branch": "5.2.1",
    "react-native-calendars": "1.17.6",
    "react-native-code-push": "6.4.0",
    "react-native-cookies": "3.3.0",
    "react-native-date-picker": "3.2.10",
    "react-native-device-info": "8.4.8",
    "react-native-fast-image": "8.3.2",
    "react-native-fbsdk": "3.0.0",
    "react-native-fcm": "16.2.4",
    "react-native-fs": "2.16.6",
    "react-native-geolocation-service": "5.1.1",
    "react-native-gesture-handler": "1.6.1",
    "react-native-google-analytics-bridge": "7.0.0",
    "react-native-google-signin": "2.0.0",
    "react-native-htmlview": "0.13.0",
    "react-native-image-picker": "3.8.1",
    "react-native-keyboard-aware-scroll-view": "0.8.0",
    "react-native-linear-gradient": "2.5.6",
    "react-native-loader": "1.2.1",
    "react-native-modal": "6.5.0",
    "react-native-moengage": "7.3.0",
    "react-native-parallax-scroll-view": "0.20.1",
    "react-native-razorpay": "2.2.2",
    "react-native-reanimated": "2.4.1",
    "react-native-render-html": "^6.3.1",
    "react-native-root-siblings": "2.2.0",
    "react-native-root-toast": "2.2.1",
    "react-native-safe-area-context": "3.0.5",
    "react-native-screens": "2.10.1",
    "react-native-scrollable-tab-view": "1.0.0",
    "react-native-section-list-get-item-layout": "2.2.3",
    "react-native-select-contact": "1.3.2",
    "react-native-share": "4.1.0",
    "react-native-snackbar": "1.0.2",
    "react-native-snap-carousel": "2.4.0",
    "react-native-sound": "0.11.0",
    "react-native-tab-view": "2.15.0",
    "react-native-ux-cam": "5.1.15",
    "react-native-v8": "0.59.10-patch.4",
    "react-native-webp": "git+https://github.com/dbasedow/react-native-webp.git",
    "react-native-webview": "11.2.1",
    "react-native-youtube-iframe": "^2.1.2",
    "react-redux": "7.1.3",
    "react-swipeable-views-native": "0.11.1",
    "react-swipeable-views-utils": "0.11.1",
    "react-timer-mixin": "0.13.3",
    "recyclerlistview": "3.0.5",
    "redux": "4.0.1",
    "redux-actions": "1.2.1",
    "redux-observable": "0.14.1",
    "redux-persist": "5.10.0",
    "redux-persist-migrate": "4.1.0",
    "redux-thunk": "2.3.0",
    "rxjs": "5.0.3",
    "stacktrace-parser": "0.1.4",
    "truncate-html": "1.0.1",
    "url": "0.11.0"
  },

firebase.json for react-native-firebase v6:

# N/A

Android

Click To Expand Unable to build apk. Firebase android SDK version ``` project.ext { set('react-native', [ versions: [ android : [ minSdk : 22, targetSdk : 31, compileSdk: 31, buildTools: "31.0.0", ndkVersion :"21.4.7075529" ], firebase: [ **bom : "25.12.0"** ], ], ]) } ``` ```gradle * What went wrong: Execution failed for task ':react-native-firebase_perf:generateDebugRFile'. > A failure occurred while executing com.android.build.gradle.internal.res.GenerateLibraryRFileTask$GenerateLibRFileRunnable > /Users/chetangupta/Desktop/chetan/housing/housing-app/node_modules/@react-native-firebase/app/android/build/intermediates/symbol_list_with_package_name/debug/package-aware-r.txt ```

#### Have you converted to AndroidX? - [ ] my application is an AndroidX application? - [x] I am using `android/gradle.settings` `jetifier=true` for Android compatibility? - [x] I am using the NPM package `jetifier` for react-native compatibility? #### `android/app/build.gradle`: ```groovy buildscript { ext.kotlin_version = "1.5.20" ext.supportLibVersion = "25.3.0" repositories { jcenter() google() mavenCentral() maven { url 'https://maven.google.com/' name 'Google' } } dependencies { classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:1.5.20" classpath "org.jetbrains.kotlin:kotlin-android-extensions:1.5.20" classpath 'com.android.tools.build:gradle:7.0.4' classpath 'com.google.gms:google-services:4.3.3' classpath 'com.google.firebase:perf-plugin:1.3.1' classpath 'com.google.firebase:firebase-crashlytics-gradle:2.3.0' } } ``` #### `android/settings.gradle`: ```groovy include ':@react-native-firebase_dynamic-links' project(':@react-native-firebase_dynamic-links').projectDir = new File(rootProject.projectDir, '../node_modules/@react-native-firebase/dynamic-links/android') include ':@react-native-firebase_remote-config' project(':@react-native-firebase_remote-config').projectDir = new File(rootProject.projectDir, '../node_modules/@react-native-firebase/remote-config/android') include ':@react-native-firebase_perf' project(':@react-native-firebase_perf').projectDir = new File(rootProject.projectDir, '../node_modules/@react-native-firebase/perf/android') include ':@react-native-firebase_messaging' project(':@react-native-firebase_messaging').projectDir = new File(rootProject.projectDir, '../node_modules/@react-native-firebase/messaging/android') include ':@react-native-firebase_crashlytics' project(':@react-native-firebase_crashlytics').projectDir = new File(rootProject.projectDir, '../node_modules/@react-native-firebase/crashlytics/android') 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') ``` #### `MainApplication.java`: ```java public class MainApplication extends MultiDexApplication implements ReactApplication { .... @Override protected List getPackages() { return Arrays.asList( new MainReactPackage(), ... new ReactNativeFirebaseDynamicLinksPackage(), new ReactNativeFirebaseConfigPackage(), new ReactNativeFirebasePerfPackage(), new ReactNativeFirebaseMessagingPackage(), new ReactNativeFirebaseCrashlyticsPackage(), new ReactNativeFirebaseAnalyticsPackage(), new ReactNativeFirebaseAppPackage(), ... ); } ... } ``` #### `AndroidManifest.xml`: ```xml ... android:resource="@string/asset_statements" /> ... ```


kshitijGulati93 commented 2 years ago

getting the same issue. "build fails with package-aware-r.txt error". Any help anyone?

mikehardy commented 2 years ago

I expect this may be a problem with old toolchain (gradle / gradle plugin) versions or Java (8 vs 11) versions but I can't be sure as I can't reproduce it to then try upgrading them.

All I know is that it definitely works with the set of tools in use in our CI now, you can see all dependencies / versions of tools in use in our CI runs for android E2E and the related code in the tests directory here

Somewhere in the difference between what we have in tests//build.gradle + tests/gradle files + JDK11 and what is in use in your project is the problem

In general, when dealing with code bases that are built on really outdated software (like react-native 0.63) I try to update the basic software / dependencies and then see if I can reproduce. That's important because any fix you need is probably already in the newer software (like, react-native using updated gradle dependencies etc) https://react-native-community.github.io/upgrade-helper/

mikehardy commented 2 years ago

I don't reproduce this and react-native 0.63 is more than 2 years old, I'm going to close this as not actionable

2sem commented 1 year ago

14.12.0 works for me. I am using rn 0.63.4.

alepmustaqim03 commented 2 months ago

i have same issue

here my Package.json:

"dependencies": {
    "@kanelloc/react-native-animated-header-scroll-view": "^1.0.0",
    "@react-native-community/async-storage": "^1.5.0",
    "@react-native-community/blur": "^3.6.0",
    "@react-native-community/cameraroll": "^1.3.0",
    "@react-native-community/clipboard": "^1.5.1",
    "@react-native-community/masked-view": "^0.1.11",
    "@react-native-community/netinfo": "^3.2.1",
    "@react-native-community/push-notification-ios": "^1.8.0",
    "@react-native-firebase/analytics": "19.2.0",
    "@react-native-firebase/app": "19.2.0",
    "@react-native-firebase/crashlytics": "19.2.0",
    "@react-native-firebase/messaging": "19.2.0",
    "@react-navigation/bottom-tabs": "^6.5.9",
    "@react-navigation/material-bottom-tabs": "^6.2.17",
    "@terrylinla/react-native-sketch-canvas": "^0.8.0",
    "@twotalltotems/react-native-otp-input": "^1.3.11",
    "add": "^2.0.6",
    "crypto-js": "^3.1.9-1",
    "js-base64": "^3.7.5",
    "locutus": "^2.0.16",
    "moment": "^2.24.0",
    "opentok-react-native": "^0.20.3",
    "react": "^18.3.1",
    "react-native": "0.68.0",
    "react-native-actionsheet": "^2.4.2",
    "react-native-add-calendar-event": "^4.2.2",
    "react-native-animatable": "^1.3.3",
    "react-native-app-link": "^1.0.0",
    "react-native-banner-carousel": "^1.0.3",
    "react-native-calendars": "^1.212.0",
    "react-native-callkeep": "^4.3.12",
    "react-native-country-picker-modal": "^1.11.0",
    "react-native-dash": "0.0.11",
    "react-native-deep-linking": "^2.2.0",
    "react-native-device-info": "^11.1.0",
    "react-native-dialog-input": "^1.0.8",
    "react-native-elements": "^3.4.2",
    "react-native-fs": "^2.13.2",
    "react-native-gesture-handler": "1.10.3",
    "react-native-image-cache-hoc": "^2.0.0",
    "react-native-image-header-scroll-view": "^0.10.3",
    "react-native-image-marker": "^0.5.2",
    "react-native-image-picker": "4.0.6",
    "react-native-image-resizer": "1.1.0",
    "react-native-image-zoom-viewer": "^2.2.26",
    "react-native-keyboard-aware-scroll-view": "^0.8.0",
    "react-native-linear-gradient": "^2.5.6",
    "react-native-modal-datetime-picker": "^7.4.2",
    "react-native-network-bandwith-speed": "^3.0.0",
    "react-native-orientation-locker": "^1.1.6",
    "react-native-paper": "^5.10.6",
    "react-native-parallax-scroll-view": "^0.21.3",
    "react-native-passcode-auth": "^1.0.0",
    "react-native-pdf": "^5.1.0",
    "react-native-picker-select": "^6.2.0",
    "react-native-print": "^0.11.0",
    "react-native-progress-bar-animated": "^1.0.6",
    "react-native-push-notification": "^8.1.1",
    "react-native-qrcode-svg": "^6.1.2",
    "react-native-quick-actions": "^0.3.13",
    "react-native-reanimated": "2.6.0",
    "react-native-render-html": "^4.1.2",
    "react-native-safe-area-context": "^3.4.0",
    "react-native-safearea-height": "^1.0.6",
    "react-native-segmented-control-tab": "^4.0.0",
    "react-native-shapes": "^0.1.0",
    "react-native-share": "1.2.1",
    "react-native-signature-canvas": "^4.5.0",
    "react-native-signature-pad": "^0.1.0",
    "react-native-sqlite-storage": "^3.3.10",
    "react-native-status-bar-height": "^2.6.0",
    "react-native-svg": "12.1.0",
    "react-native-swipeout": "^2.3.6",
    "react-native-swiper": "^1.6.0",
    "react-native-toast-message": "^2.2.0",
    "react-native-touch-id": "^4.4.1",
    "react-native-vector-icons": "^9.1.0",
    "react-native-view-shot": "^3.3.0",
    "react-native-view-transformer": "0.0.28",
    "react-native-voip-push-notification": "^3.3.0",
    "react-native-webview": "^13.10.3",
    "react-navigation": "^4.4.4",
    "react-navigation-drawer": "^1.4.0",
    "react-navigation-stack": "^1.7.3",
    "react-navigation-tabs": "^2.11.2",
    "rn-fetch-blob": "^0.12.0",
    "yarn": "^1.22.22"
  },
rnarang-goauto commented 1 month ago

I am facing the similar issue with react-native version 0.69.12 and react-native-firebase_analytics version 17.4.2 Was it resolved ?