Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[🐛] Task :react-native-firebase_app:packageDebugResources FAILE #8114

Closed
nusjeff opened this issue Nov 5, 2024 · 12 comments
Closed

[🐛] Task :react-native-firebase_app:packageDebugResources FAILE #8114

nusjeff opened this issue Nov 5, 2024 · 12 comments
Labels
resolution: needs-repro This issue could not be reproduced or needs a repro provided.

Comments

@nusjeff
Copy link

nusjeff commented Nov 5, 2024

> Task :react-native-firebase_app:packageDebugResources FAILED

Deprecated Gradle features were used in this build, making it incompatible with Gradle 9.0.

You can use '--warning-mode all' to show the individual deprecation warnings and determine if they come from your own scripts or plugins.

For more on this, please refer to https://docs.gradle.org/8.7/userguide/command_line_interface.html#sec:command_line_warnings in the Gradle documentation.
109 actionable tasks: 5 executed, 104 up-to-date

info 💡 Tip: Make sure that you have set up your development environment correctly, by running npx react-native doctor. To read more about doctor command visit: https://github.com/react-native-community/cli/blob/main/packages/cli-doctor/README.md#doctor 


FAILURE: Build failed with an exception.

* What went wrong:
A problem was found with the configuration of task ':react-native-firebase_app:packageDebugResources' (type 'MergeResources').
  - Gradle detected a problem with the following location: '../node_modules/@react-native-firebase/app/android/build/generated/res/resValues/debug'.
    
    Reason: Task ':react-native-firebase_app:packageDebugResources' uses this output of task ':@react-native-firebase_app:generateDebugResValues' without declaring an explicit or implicit dependency. This can lead to incorrect results being produced, depending on what order the tasks are executed.
    
    Possible solutions:
      1. Declare task ':@react-native-firebase_app:generateDebugResValues' as an input of ':react-native-firebase_app:packageDebugResources'.
      2. Declare an explicit dependency on ':@react-native-firebase_app:generateDebugResValues' from ':react-native-firebase_app:packageDebugResources' using Task#dependsOn.
      3. Declare an explicit dependency on ':@react-native-firebase_app:generateDebugResValues' from ':react-native-firebase_app:packageDebugResources' using Task#mustRunAfter.
    
    For more information, please refer to https://docs.gradle.org/8.7/userguide/validation_problems.html#implicit_dependency in the Gradle documentation.

* 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.
> Get more help at https://help.gradle.org.

BUILD FAILED in 5s
error Failed to install the app. Command failed with exit code 1: ./gradlew app:installDebug -PreactNativeDevServerPort=8081 FAILURE: Build failed with an exception. * What went wrong:
A problem was found with the configuration of task ':react-native-firebase_app:packageDebugResources' (type 'MergeResources'). - Gradle detected a problem with the following location: '/Users/kimhung/Desktop/SourceCty/Crew/node_modules/@react-native-firebase/app/android/build/generated/res/resValues/debug'. Reason: Task ':react-native-firebase_app:packageDebugResources' uses this output of task ':@react-native-firebase_app:generateDebugResValues' without declaring an explicit or implicit dependency. This can lead to incorrect results being produced, depending on what order the tasks are executed. Possible solutions: 1. Declare task ':@react-native-firebase_app:generateDebugResValues' as an input of ':react-native-firebase_app:packageDebugResources'. 2. Declare an explicit dependency on ':@react-native-firebase_app:generateDebugResValues' from ':react-native-firebase_app:packageDebugResources' using Task#dependsOn. 3. Declare an explicit dependency on ':@react-native-firebase_app:generateDebugResValues' from ':react-native-firebase_app:packageDebugResources' using Task#mustRunAfter. For more information, please refer to https://docs.gradle.org/8.7/userguide/validation_problems.html#implicit_dependency in the Gradle documentation. * 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.
> Get more help at https://help.gradle.org. BUILD FAILED in 5s.
info Run CLI with --verbose flag for more details.

Describe your issue here

---

## Project Files
    "@react-native-firebase/analytics": "20.0.0",
    "@react-native-firebase/app": "20.0.0",
    "@react-native-firebase/messaging": "20.0.0",
    "react": "18.2.0",
    "react-native": "^0.75.4",
    
## gradle-wrapper
distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-bin.zip

## android/build.gradle
buildscript {
    ext {
        googlePlayServicesVersion = "+"
        androidMapsUtilsVersion = "0.5+"
        firebaseMessagingVersion = "21.1.0"
        googlePlayServicesLocationVersion = "21.0.1"  
        buildToolsVersion = "34.0.0"
        minSdkVersion = 23
        compileSdkVersion = 34
        targetSdkVersion = 34
        appCompatVersion = "1.1.0"
        ndkVersion = "26.1.10909125"
        kotlinVersion = "1.9.24"
    }
    repositories {
        google()
        mavenCentral()
    }
    dependencies {
        classpath("com.android.tools.build:gradle")
        classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVersion")
        classpath("com.facebook.react:react-native-gradle-plugin")
        classpath('com.google.gms:google-services:4.4.2')
    }
}


@nusjeff
Copy link
Author

nusjeff commented Nov 5, 2024

package.json
{
  "version": "0.0.1",
  "private": true,
  "scripts": {
    "android": "react-native run-android",
    "ios": "react-native run-ios",
    "lint": "eslint .",
    "start": "react-native start",
    "test": "jest",
    "postinstall": "patch-package"
  },
  "dependencies": {
    "@gorhom/bottom-sheet": "^5.0.5",
    "@kesha-antonov/react-native-action-cable": "^1.1.5",
    "@react-native-community/async-storage": "^1.12.1",
    "@react-native-community/datetimepicker": "^8.2.0",
    "@react-native-community/geolocation": "^3.4.0",
    "@react-native-community/netinfo": "^11.4.1",
    "@react-native-community/push-notification-ios": "^1.11.0",
    "@react-native-firebase/analytics": "20.0.0",
    "@react-native-firebase/app": "20.0.0",
    "@react-native-firebase/messaging": "20.0.0",
    "@react-native-masked-view/masked-view": "^0.3.1",
    "@react-native-voice/voice": "^3.2.4",
    "@react-navigation/bottom-tabs": "^6.6.1",
    "@react-navigation/drawer": "^6.7.2",
    "@react-navigation/native": "^6.1.18",
    "@react-navigation/native-stack": "^6.11.0",
    "@sentry/react-native": "^6.1.0",
    "axios": "^1.7.7",
    "deprecated-react-native-prop-types": "^5.0.0",
    "formik": "^2.4.6",
    "google-libphonenumber": "^3.2.38",
    "i18n-js": "^3.7.0",
    "lodash": "^4.17.21",
    "moment": "^2.30.1",
    "patch-package": "^8.0.0",
    "postinstall-postinstall": "^2.1.0",
    "qs": "^6.13.0",
    "react": "18.2.0",
    "react-native": "^0.75.4",
    "react-native-actioncable": "^0.0.3",
    "react-native-android-location-enabler": "^2.0.1",
    "react-native-background-fetch": "^4.2.5",
    "react-native-background-geolocation": "^4.17.4",
    "react-native-background-timer": "^2.4.1",
    "react-native-calendars": "^1.1307.0",
    "react-native-cli": "^2.0.1",
    "react-native-country-picker-modal": "^2.0.0",
    "react-native-device-info": "^14.0.0",
    "react-native-dimension": "^1.0.6",
    "react-native-dropdown-picker": "^5.4.6",
    "react-native-element-dropdown": "^2.12.2",
    "react-native-elements": "^3.4.3",
    "react-native-flash-message": "^0.4.2",
    "react-native-fs": "^2.20.0",
    "react-native-gesture-handler": "^2.20.2",
    "react-native-get-random-values": "^1.11.0",
    "react-native-gifted-chat": "^2.6.4",
    "react-native-gradle-plugin": "^0.71.19",
    "react-native-image-picker": "^7.1.2",
    "react-native-iphone-x-helper": "^1.3.1",
    "react-native-keep-awake": "^4.0.0",
    "react-native-keyboard-aware-scroll-view": "^0.9.5",
    "react-native-localize": "^3.2.1",
    "react-native-maps": "^1.18.2",
    "react-native-maps-directions": "^1.9.0",
    "react-native-modal": "^13.0.1",
    "react-native-modal-datetime-picker": "^18.0.0",
    "react-native-modal-selector": "^2.1.2",
    "react-native-permissions": "^5.1.0",
    "react-native-popup-menu": "^0.16.1",
    "react-native-push-notification": "^8.1.1",
    "react-native-reanimated": "^3.16.1",
    "react-native-redash": "^18.1.3",
    "react-native-rename": "^3.2.14",
    "react-native-responsive-screen": "^1.4.2",
    "react-native-restart": "^0.0.27",
    "react-native-safe-area-context": "^4.13.1",
    "react-native-screens": "^3.35.0",
    "react-native-sound": "^0.11.2",
    "react-native-splash-screen": "^3.3.0",
    "react-native-svg": "^15.8.0",
    "react-native-swipeout": "^2.3.6",
    "react-native-swiper-flatlist": "^3.2.5",
    "react-native-tts": "^4.1.1",
    "react-native-vector-icons": "^10.2.0",
    "react-redux": "^7.2.0",
    "redux": "^4.0.5",
    "redux-logger": "^3.0.6",
    "redux-observable": "^1.2.0",
    "redux-persist": "^6.0.0",
    "redux-saga": "^1.1.3",
    "rn-round-checkbox": "^1.0.0",
    "socket.io-client": "^2.3.0",
    "yup": "^1.4.0"
  },
  "devDependencies": {
    "@babel/core": "^7.20.0",
    "@babel/preset-env": "^7.20.0",
    "@babel/runtime": "^7.20.0",
    "@react-native/babel-preset": "0.74.88",
    "@react-native/eslint-config": "0.74.88",
    "@react-native/metro-config": "0.74.88",
    "@react-native/typescript-config": "0.74.88",
    "@types/react": "^18.2.6",
    "@types/react-test-renderer": "^18.0.0",
    "babel-jest": "^29.6.3",
    "babel-plugin-root-import": "^6.6.0",
    "eslint": "^8.19.0",
    "jest": "^29.6.3",
    "prettier": "2.8.8",
    "react-native-svg-transformer": "^1.5.0",
    "react-test-renderer": "18.2.0",
    "typescript": "5.0.4"
  },
  "engines": {
    "node": ">=18"
  }
}

@mikehardy
Copy link
Collaborator


    "@react-native-firebase/analytics": "20.0.0",
    "@react-native-firebase/app": "20.0.0",
    "@react-native-firebase/messaging": "20.0.0",

Please only report issues on current versions

Also note that this is not reproduced in either our e2e environment or my fully automated script build script that I would reproduce this with https://github.com/mikehardy/rnfbdemo/blob/main/make-demo.sh, so we will need a reproduction - closing until reproduction provided as my script is fully automated, can be run by anyone, and shows everything working

https://stackoverflow.com/help/minimal-reproducible-example

Note that if you are having problems with debug res values, you might temporarily return android/app/src/main/res files to their default states from react-native template, you may have something wrong in there causing you problems

https://github.com/facebook/react-native/tree/main/packages/helloworld/android/app/src/main/res/values

@Raghul7S
Copy link

@mikehardy I am facing the same issue. What are the things that you know from my project for the solution ?

@mikehardy
Copy link
Collaborator

@Raghul7S there is no reproduction for this error posted, so I can't say anything definitive. My comments about reproduction above are still the only things I know: I have a reproducer that builds from scratch and works. No one has posted a reproducer that does not work, so we continue with the assumption there is something wrong in people's local projects until there is a reproducer showing otherwise

@Santosh-NPL
Copy link

PS D:\projectFiles\Barber> npm start -- --reset-cache --info --stacktrace --scan --debug
(node:6220) [DEP0040] DeprecationWarning: The punycode module is deprecated. Please use a userland alternative instead.
(Use node --trace-deprecation ... to show where the warning was created)
info Welcome to React Native v0.76
info Starting dev server on port 8081...

                    ▒▒▓▓▓▓▒▒
                 ▒▓▓▓▒▒░░▒▒▓▓▓▒
              ▒▓▓▓▓░░░▒▒▒▒░░░▓▓▓▓▒
             ▓▓▒▒▒▓▓▓▓▓▓▓▓▓▓▓▓▒▒▒▓▓
             ▓▓░░░░░▒▓▓▓▓▓▓▒░░░░░▓▓
             ▓▓░░▓▓▒░░░▒▒░░░▒▓▒░░▓▓
             ▓▓░░▓▓▓▓▓▒▒▒▒▓▓▓▓▒░░▓▓
             ▓▓░░▓▓▓▓▓▓▓▓▓▓▓▓▓▒░░▓▓
             ▓▓▒░░▒▒▓▓▓▓▓▓▓▓▒░░░▒▓▓
              ▒▓▓▓▒░░░▒▓▓▒░░░▒▓▓▓▒
                 ▒▓▓▓▒░░░░▒▓▓▓▒
                    ▒▒▓▓▓▓▒▒


            Welcome to Metro v0.81.0
          Fast - Scalable - Integrated

info Dev server ready

i - run on iOS
a - run on Android
r - reload app
d - open Dev Menu
j - open DevTools

info Opening app on Android...
info A dev server is already running for this project on port 8081.
info Installing the app...

Task :gradle-plugin:settings-plugin:checkKotlinGradlePluginConfigurationErrors
Task :gradle-plugin:shared:checkKotlinGradlePluginConfigurationErrors
Task :gradle-plugin:shared:compileKotlin UP-TO-DATE
Task :gradle-plugin:shared:compileJava NO-SOURCE
Task :gradle-plugin:shared:processResources NO-SOURCE
Task :gradle-plugin:shared:classes UP-TO-DATE
Task :gradle-plugin:shared:jar UP-TO-DATE
Task :gradle-plugin:settings-plugin:compileKotlin UP-TO-DATE
Task :gradle-plugin:settings-plugin:compileJava NO-SOURCE
Task :gradle-plugin:settings-plugin:pluginDescriptors UP-TO-DATE
Task :gradle-plugin:settings-plugin:processResources UP-TO-DATE
Task :gradle-plugin:settings-plugin:classes UP-TO-DATE
Task :gradle-plugin:settings-plugin:jar UP-TO-DATE
Task :gradle-plugin:react-native-gradle-plugin:checkKotlinGradlePluginConfigurationErrors
Task :gradle-plugin:react-native-gradle-plugin:compileKotlin UP-TO-DATE
Task :gradle-plugin:react-native-gradle-plugin:compileJava NO-SOURCE
Task :gradle-plugin:react-native-gradle-plugin:pluginDescriptors UP-TO-DATE
Task :gradle-plugin:react-native-gradle-plugin:processResources UP-TO-DATE
Task :gradle-plugin:react-native-gradle-plugin:classes UP-TO-DATE
Task :gradle-plugin:react-native-gradle-plugin:jar UP-TO-DATE

Configure project :react-native-firebase_app
:react-native-firebase_app package.json found at D:\projectFiles\Barber\node_modules@react-native-firebase\app\package.json
:react-native-firebase_app:firebase.bom using default value: 33.7.0
:react-native-firebase_app:play.play-services-auth using default value: 21.2.0
:react-native-firebase_app package.json found at D:\projectFiles\Barber\node_modules@react-native-firebase\app\package.json
:react-native-firebase_app:version set from package.json: 21.7.1 (21,7,1 - 21007001)
:react-native-firebase_app:android.compileSdk using custom value: 35
:react-native-firebase_app:android.targetSdk using custom value: 34
:react-native-firebase_app:android.minSdk using custom value: 24
:react-native-firebase_app:reactNativeAndroidDir D:\projectFiles\Barber\node_modules\react-native\android

Configure project :@react-native-firebase_app
:@react-native-firebase_app package.json found at D:\projectFiles\Barber\node_modules@react-native-firebase\app\package.json
:@react-native-firebase_app:firebase.bom using default value: 33.7.0
:@react-native-firebase_app:play.play-services-auth using default value: 21.2.0
:@react-native-firebase_app package.json found at D:\projectFiles\Barber\node_modules@react-native-firebase\app\package.json
:@react-native-firebase_app:version set from package.json: 21.7.1 (21,7,1 - 21007001)
:@react-native-firebase_app:android.compileSdk using custom value: 35
:@react-native-firebase_app:android.targetSdk using custom value: 34
:@react-native-firebase_app:android.minSdk using custom value: 24
:@react-native-firebase_app:reactNativeAndroidDir D:\projectFiles\Barber\node_modules\react-native\android

Configure project :react-native-firebase_analytics
:react-native-firebase_analytics package.json found at D:\projectFiles\Barber\node_modules@react-native-firebase\analytics\package.json
:@react-native-firebase_app package.json found at D:\projectFiles\Barber\node_modules@react-native-firebase\app\package.json
:react-native-firebase_analytics:firebase.bom using default value: 33.7.0
:react-native-firebase_analytics package.json found at D:\projectFiles\Barber\node_modules@react-native-firebase\analytics\package.json
:react-native-firebase_analytics:version set from package.json: 21.7.1 (21,7,1 - 21007001)
:react-native-firebase_analytics:android.compileSdk using custom value: 35
:react-native-firebase_analytics:android.targetSdk using custom value: 34
:react-native-firebase_analytics:android.minSdk using custom value: 24
:react-native-firebase_analytics:reactNativeAndroidDir D:\projectFiles\Barber\node_modules\react-native\android

Configure project :react-native-firebase_messaging
:react-native-firebase_messaging package.json found at D:\projectFiles\Barber\node_modules@react-native-firebase\messaging\package.json
:@react-native-firebase_app package.json found at D:\projectFiles\Barber\node_modules@react-native-firebase\app\package.json
:react-native-firebase_messaging:firebase.bom using default value: 33.7.0
:react-native-firebase_messaging package.json found at D:\projectFiles\Barber\node_modules@react-native-firebase\messaging\package.json
:react-native-firebase_messaging:version set from package.json: 21.7.1 (21,7,1 - 21007001)
:react-native-firebase_messaging:android.compileSdk using custom value: 35
:react-native-firebase_messaging:android.targetSdk using custom value: 34
:react-native-firebase_messaging:android.minSdk using custom value: 24
:react-native-firebase_messaging:reactNativeAndroidDir D:\projectFiles\Barber\node_modules\react-native\android

Configure project :react-native-reanimated
Android gradle plugin: 8.6.0
Gradle: 8.10.2

Task :@react-native-firebase_app:preBuild UP-TO-DATE
Task :@react-native-firebase_app:preDebugBuild UP-TO-DATE
Task :@react-native-firebase_app:generateDebugBuildConfig UP-TO-DATE
Task :@react-native-firebase_app:generateDebugResValues UP-TO-DATE
Task :@react-native-firebase_app:generateDebugResources UP-TO-DATE
Task :@react-native-firebase_app:packageDebugResources UP-TO-DATE
Task :@react-native-firebase_app:parseDebugLocalResources UP-TO-DATE
Task :@react-native-firebase_app:generateDebugRFile UP-TO-DATE
Task :@react-native-firebase_app:javaPreCompileDebug UP-TO-DATE
Task :@react-native-firebase_app:compileDebugJavaWithJavac UP-TO-DATE
Task :@react-native-firebase_app:bundleLibCompileToJarDebug UP-TO-DATE
Task :app:checkKotlinGradlePluginConfigurationErrors
Task :app:generateAutolinkingNewArchitectureFiles UP-TO-DATE
Task :app:generateAutolinkingPackageList UP-TO-DATE
Task :app:generateCodegenSchemaFromJavaScript SKIPPED
Task :app:generateCodegenArtifactsFromSchema SKIPPED
Task :app:preBuild UP-TO-DATE
Task :app:preDebugBuild UP-TO-DATE
Task :app:generateDebugBuildConfig UP-TO-DATE
Task :@react-native-firebase_app:compileDebugLibraryResources UP-TO-DATE
Task :@react-native-firebase_app:writeDebugAarMetadata UP-TO-DATE
Task :react-native-async-storage_async-storage:generateCodegenSchemaFromJavaScript UP-TO-DATE
Task :react-native-async-storage_async-storage:generateCodegenArtifactsFromSchema UP-TO-DATE
Task :react-native-async-storage_async-storage:preBuild UP-TO-DATE
Task :react-native-async-storage_async-storage:preDebugBuild UP-TO-DATE
Task :react-native-async-storage_async-storage:writeDebugAarMetadata UP-TO-DATE
Task :react-native-biometrics:preBuild UP-TO-DATE
Task :react-native-biometrics:preDebugBuild UP-TO-DATE
Task :react-native-biometrics:writeDebugAarMetadata UP-TO-DATE
Task :react-native-firebase_analytics:preBuild UP-TO-DATE
Task :react-native-firebase_analytics:preDebugBuild UP-TO-DATE
Task :react-native-firebase_analytics:writeDebugAarMetadata UP-TO-DATE
Task :react-native-firebase_app:preBuild UP-TO-DATE
Task :react-native-firebase_app:preDebugBuild UP-TO-DATE
Task :react-native-firebase_app:writeDebugAarMetadata UP-TO-DATE
Task :react-native-firebase_messaging:preBuild UP-TO-DATE
Task :react-native-firebase_messaging:preDebugBuild UP-TO-DATE
Task :react-native-firebase_messaging:writeDebugAarMetadata UP-TO-DATE
Task :react-native-gesture-handler:generateCodegenSchemaFromJavaScript UP-TO-DATE
Task :react-native-gesture-handler:generateCodegenArtifactsFromSchema UP-TO-DATE
Task :react-native-gesture-handler:preBuild UP-TO-DATE
Task :react-native-gesture-handler:preDebugBuild UP-TO-DATE
Task :react-native-gesture-handler:writeDebugAarMetadata UP-TO-DATE
Task :react-native-localize:generateCodegenSchemaFromJavaScript UP-TO-DATE
Task :react-native-localize:generateCodegenArtifactsFromSchema UP-TO-DATE
Task :react-native-localize:preBuild UP-TO-DATE
Task :react-native-localize:preDebugBuild UP-TO-DATE
Task :react-native-localize:writeDebugAarMetadata UP-TO-DATE
Task :react-native-reanimated:assertLatestReactNativeWithNewArchitectureTask SKIPPED
Task :react-native-reanimated:assertMinimalReactNativeVersionTask SKIPPED
Task :react-native-reanimated:generateCodegenSchemaFromJavaScript UP-TO-DATE
Task :react-native-reanimated:generateCodegenArtifactsFromSchema UP-TO-DATE
Task :react-native-reanimated:prepareReanimatedHeadersForPrefabs UP-TO-DATE
Task :react-native-reanimated:prepareWorkletsHeadersForPrefabs UP-TO-DATE
Task :react-native-reanimated:preBuild UP-TO-DATE
Task :react-native-reanimated:preDebugBuild UP-TO-DATE
Task :react-native-reanimated:writeDebugAarMetadata UP-TO-DATE
Task :react-native-safe-area-context:generateCodegenSchemaFromJavaScript UP-TO-DATE
Task :react-native-safe-area-context:generateCodegenArtifactsFromSchema UP-TO-DATE
Task :react-native-safe-area-context:preBuild UP-TO-DATE
Task :react-native-safe-area-context:preDebugBuild UP-TO-DATE
Task :react-native-safe-area-context:writeDebugAarMetadata UP-TO-DATE
Task :react-native-screens:generateCodegenSchemaFromJavaScript UP-TO-DATE
Task :react-native-screens:generateCodegenArtifactsFromSchema UP-TO-DATE
Task :react-native-screens:preBuild UP-TO-DATE
Task :react-native-screens:preDebugBuild UP-TO-DATE
Task :react-native-screens:writeDebugAarMetadata UP-TO-DATE
Task :react-native-splash-screen:preBuild UP-TO-DATE
Task :react-native-splash-screen:preDebugBuild UP-TO-DATE
Task :react-native-splash-screen:writeDebugAarMetadata UP-TO-DATE
Task :react-native-vector-icons:generateCodegenSchemaFromJavaScript UP-TO-DATE
Task :react-native-vector-icons:generateCodegenArtifactsFromSchema UP-TO-DATE
Task :react-native-vector-icons:preBuild UP-TO-DATE
Task :react-native-vector-icons:preDebugBuild UP-TO-DATE
Task :react-native-vector-icons:writeDebugAarMetadata UP-TO-DATE
Task :app:checkDebugAarMetadata UP-TO-DATE
Task :app:generateDebugResValues UP-TO-DATE
Task :app:processDebugGoogleServices UP-TO-DATE
Task :react-native-async-storage_async-storage:generateDebugResValues UP-TO-DATE
Task :react-native-async-storage_async-storage:generateDebugResources UP-TO-DATE
Task :react-native-async-storage_async-storage:packageDebugResources UP-TO-DATE
Task :react-native-biometrics:generateDebugResValues UP-TO-DATE
Task :react-native-biometrics:generateDebugResources UP-TO-DATE
Task :react-native-biometrics:packageDebugResources UP-TO-DATE
Task :react-native-firebase_analytics:generateDebugResValues UP-TO-DATE
Task :react-native-firebase_analytics:generateDebugResources UP-TO-DATE
Task :react-native-firebase_analytics:packageDebugResources UP-TO-DATE
Task :react-native-firebase_app:generateDebugResValues UP-TO-DATE
Task :react-native-firebase_app:generateDebugResources UP-TO-DATE
Task :react-native-firebase_app:packageDebugResources FAILED
71 actionable tasks: 5 executed, 66 up-to-date

info 💡 Tip: Make sure that you have set up your development environment correctly, by running npx react-native doctor. To read more about doctor command visit: https://github.com/react-native-community/cli/blob/main/packages/cli-doctor/README.md#doctor

FAILURE: Build failed with an exception.

  • What went wrong:
    A problem was found with the configuration of task ':react-native-firebase_app:packageDebugResources' (type 'MergeResources').

    • Gradle detected a problem with the following location: 'D:\projectFiles\Barber\node_modules@react-native-firebase\app\android\build\generated\res\resValues\debug'.

      Reason: Task ':react-native-firebase_app:packageDebugResources' uses this output of task ':@react-native-firebase_app:generateDebugResValues' without declaring an explicit or implicit dependency. This can lead to incorrect results being produced, depending on what order the tasks are executed.

      Possible solutions:

      1. Declare task ':@react-native-firebase_app:generateDebugResValues' as an input of ':react-native-firebase_app:packageDebugResources'.
      2. Declare an explicit dependency on ':@react-native-firebase_app:generateDebugResValues' from ':react-native-firebase_app:packageDebugResources' using Task#dependsOn.
      3. Declare an explicit dependency on ':@react-native-firebase_app:generateDebugResValues' from ':react-native-firebase_app:packageDebugResources' using Task#mustRunAfter.

      For more information, please refer to https://docs.gradle.org/8.10.2/userguide/validation_problems.html#implicit_dependency in the Gradle documentation.

  • 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.
Get more help at https://help.gradle.org.

BUILD FAILED in 17m 53s
info Run CLI with --verbose flag for more details.

package.json

{
"name": "Barber",
"version": "0.0.1",
"private": true,
"scripts": {
"android": "react-native run-android",
"ios": "react-native run-ios",
"lint": "eslint .",
"start": "react-native start",
"test": "jest"
},
"dependencies": {
"@react-native-async-storage/async-storage": "^2.1.0",
"@react-native-firebase/analytics": "^21.7.1",
"@react-native-firebase/app": "^21.7.1",
"@react-native-firebase/messaging": "^21.7.1",
"@react-navigation/bottom-tabs": "^7.2.0",
"@react-navigation/drawer": "^7.1.1",
"@react-navigation/native": "^7.0.14",
"@react-navigation/native-stack": "^7.2.0",
"@react-navigation/stack": "^7.1.1",
"axios": "^1.7.9",
"formik": "^2.4.6",
"i18next": "^24.2.1",
"nativewind": "^4.1.23",
"react": "18.3.1",
"react-i18next": "^15.4.0",
"react-native": "0.76.6",
"react-native-biometrics": "^3.0.1",
"react-native-gesture-handler": "^2.22.0",
"react-native-localize": "^3.4.1",
"react-native-paper": "^5.13.1",
"react-native-reanimated": "^3.16.7",
"react-native-safe-area-context": "^5.1.0",
"react-native-screens": "^4.5.0",
"react-native-splash-screen": "^3.3.0",
"react-native-vector-icons": "^10.2.0",
"yup": "^1.6.1"
},
"devDependencies": {
"@babel/core": "^7.25.2",
"@babel/preset-env": "^7.25.3",
"@babel/runtime": "^7.25.0",
"@react-native-community/cli": "15.0.1",
"@react-native-community/cli-platform-android": "15.0.1",
"@react-native-community/cli-platform-ios": "15.0.1",
"@react-native/babel-preset": "0.76.6",
"@react-native/eslint-config": "0.76.6",
"@react-native/metro-config": "0.76.6",
"@react-native/typescript-config": "0.76.6",
"@types/react": "^18.2.6",
"@types/react-test-renderer": "^18.0.0",
"babel-jest": "^29.6.3",
"eslint": "^8.19.0",
"jest": "^29.6.3",
"prettier": "2.8.8",
"react-test-renderer": "18.3.1",
"tailwindcss": "^3.4.17",
"typescript": "5.0.4"
},
"engines": {
"node": ">=18"
}
}

android/build.gradle

buildscript {
ext {
buildToolsVersion = "35.0.0"
minSdkVersion = 24
compileSdkVersion = 35
targetSdkVersion = 34
ndkVersion = "26.1.10909125"
kotlinVersion = "1.9.24"

}
repositories {
    google()
    mavenCentral()
}
dependencies {
    classpath("com.android.tools.build:gradle")
    classpath("com.facebook.react:react-native-gradle-plugin")
    classpath("org.jetbrains.kotlin:kotlin-gradle-plugin")
    classpath 'com.google.gms:google-services:4.4.2'
}

}

apply plugin: "com.facebook.react.rootproject"

##android/app/build.gradle
apply plugin: "com.android.application"
apply plugin: "org.jetbrains.kotlin.android"
apply plugin: "com.facebook.react"
apply plugin: "com.google.gms.google-services"

// React Native configuration
project.ext.react = [
entryFile: "index.js",
enableHermes: true, // Enable Hermes
]

/**

  • This is the configuration block to customize your React Native Android app.

  • By default you don't need to apply any configuration, just uncomment the lines you need.
    /
    react {
    /
    Folders */
    // The root of your project, i.e. where "package.json" lives. Default is '../..'
    // root = file("../../")
    // The folder where the react-native NPM package is. Default is ../../node_modules/react-native
    // reactNativeDir = file("../../node_modules/react-native")
    // The folder where the react-native Codegen package is. Default is ../../node_modules/@react-native/codegen
    // codegenDir = file("../../node_modules/@react-native/codegen")
    // The cli.js file which is the React Native CLI entrypoint. Default is ../../node_modules/react-native/cli.js
    // cliFile = file("../../node_modules/react-native/cli.js")

    /* Variants */
    // The list of variants to that are debuggable. For those we're going to
    // skip the bundling of the JS bundle and the assets. By default is just 'debug'.
    // If you add flavors like lite, prod, etc. you'll have to list your debuggableVariants.
    // debuggableVariants = ["liteDebug", "prodDebug"]

    /* Bundling */
    // A list containing the node command and its flags. Default is just 'node'.
    // nodeExecutableAndArgs = ["node"]
    //
    // The command to run when bundling. By default is 'bundle'
    // bundleCommand = "ram-bundle"
    //
    // The path to the CLI configuration file. Default is empty.
    // bundleConfig = file(../rn-cli.config.js)
    //
    // The name of the generated asset file containing your JS bundle
    // bundleAssetName = "MyApplication.android.bundle"
    //
    // The entry file for bundle generation. Default is 'index.android.js' or 'index.js'
    // entryFile = file("../js/MyApplication.android.js")
    //
    // A list of extra flags to pass to the 'bundle' commands.
    // See https://github.com/react-native-community/cli/blob/main/docs/commands.md#bundle
    // extraPackagerArgs = []

    /* Hermes Commands */
    // The hermes compiler command to run. By default it is 'hermesc'
    // hermesCommand = "$rootDir/my-custom-hermesc/bin/hermesc"
    //
    // The list of flags to pass to the Hermes compiler. By default is "-O", "-output-source-map"
    // hermesFlags = ["-O", "-output-source-map"]

    /* Autolinking */
    autolinkLibrariesWithApp()
    }

/**

  • Set this to true to Run Proguard on Release builds to minify the Java bytecode.
    */
    def enableProguardInReleaseBuilds = false

/**

  • The preferred build flavor of JavaScriptCore (JSC)
  • 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:+'

android {
ndkVersion rootProject.ext.ndkVersion
buildToolsVersion rootProject.ext.buildToolsVersion
compileSdk rootProject.ext.compileSdkVersion
namespace "com.barber"
defaultConfig {
applicationId "com.barber"
minSdkVersion rootProject.ext.minSdkVersion
targetSdkVersion rootProject.ext.targetSdkVersion
versionCode 1
versionName "1.0"
}
signingConfigs {
debug {
storeFile file('debug.keystore')
storePassword 'android'
keyAlias 'androiddebugkey'
keyPassword 'android'
}
}
buildTypes {
debug {
signingConfig signingConfigs.debug
}
release {
// Caution! In production, you need to generate your own keystore file.
// see https://reactnative.dev/docs/signed-apk-android.
signingConfig signingConfigs.debug
minifyEnabled enableProguardInReleaseBuilds
proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro"
if (project.ext.react.enableHermes.toBoolean()) {
// Hermes JS Bytecode is bundled and included in the APK
def hermesPath = file("../../node_modules/hermes-engine")
if (hermesPath.exists()) {
project.ext.react.bundleCommand = "ram-bundle"
project.ext.react.extraPackagerArgs = ["--entry-file", entryFile, "--bundle-output", "$buildDir/generated/assets/react/${targetName}/index.android.bundle", "--dev", "false", "--platform", "android", "--assets-dest", "$buildDir/generated/res/react/${targetName}", "--sourcemap-output", "$buildDir/generated/sourcemaps/react/${targetName}/index.android.bundle.map"]
}
}
}
}

}

dependencies {
implementation platform('com.google.firebase:firebase-bom:33.8.0')
// The version of react-native is set by the React Native Gradle Plugin
implementation("com.facebook.react:react-android")

// implementation project(path: ":@react-native-firebase_app")
if (project.ext.react.enableHermes.toBoolean()) {
    implementation("com.facebook.react:hermes-android")
} else {
    implementation jscFlavor
}
 // Use the latest BOM version
implementation 'com.google.firebase:firebase-analytics' // Firebase Analytics
// implementation 'com.google.firebase:firebase-messaging' // Firebase Cloud Messaging (if needed)

}
project.ext.vectoricons = [
iconFontNames: [
'MaterialCommunityIcons.ttf', // Include MaterialCommunityIcons
'FontAwesome.ttf', // Include FontAwesome
'AntDesign.ttf', // Include AntDesign
'Ionicons.ttf',
// Add other font files as needed
]
]
apply from: file("../../node_modules/react-native-vector-icons/fonts.gradle")

and add in android/app/google-services.json

getting error why??

@mikehardy
Copy link
Collaborator

@Santosh-NPL unknown, this is currently build-testing successfully every time with react-native 076.6 and react-native-firebase 21.7.2 (that is: current versions, looks like everything is current...) https://github.com/mikehardy/rnfbdemo/blob/main/make-demo.sh - so I can't reproduce a build failure, it works for me currently - perhaps you are using a different version of JDK (I test mostly 21 and 17) or a different version of gradle (I use the one that comes specified with the react-native template from npx react-native init)

@bantalimon
Copy link

I get the same issue. I'm running on a windows machine if that helps. I have tried running on a fresh build using "npx @react-native-community/cli init Test" npx react-native init is apparently deprecated. It build fine until I add firebase app latest. Logs arent particularly helpful.

@mikehardy
Copy link
Collaborator

@bantalimon Yes - I still use npx react-native init as a shorthand for that but need to stop, it is indeed npx @react-native-community/cli init now and my script has converted.

Looking at error messages it appears @Santosh-NPL is also on Windows. I have build-tested on windows before but it has been a while - normally I test on macOS as that allows me to build all platforms at once. I'll check on Windows, maybe there is something going on

@mikehardy mikehardy reopened this Jan 25, 2025
@mikehardy
Copy link
Collaborator

My demo script (starting in WSL and finishing in Powershell) worked fine with exception that gradle 8.10.2 doesn't work on windows, you need to edit android/gradle/gradle.properties to use 8.12

Using straight npx @react-native-community/cli init rnfbdemo, then adding @react-native-firebase/app (along with adding the google-services android dependency and plugin, and associated google-services.json file) also worked fine.

Can't reproduce at all.

Post a reproduction if needed but otherwise closed -> can't reproduce.

@mikehardy mikehardy added resolution: needs-repro This issue could not be reproduced or needs a repro provided. and removed type: bug New bug report Needs Attention labels Jan 25, 2025
@bantalimon
Copy link

Correct. I think this error happens after you include "implementation project(':@react-native-firebase_app')" in app build grade and the below in settings.gradle

include ':@react-native-firebase_app'
project(':@react-native-firebase_app').projectDir = new File(rootProject.projectDir, '../node_modules/@react-native-firebase/app/android')

@bantalimon
Copy link

repo -> https://github.com/bantalimon/rnTest

@mikehardy
Copy link
Collaborator

@bantalimon why would you ever do that? Don't do that.
There is nothing in our instructions that say you should do that and my script doesn't do that, no one should do that. Of course things will be duplicate then as you will manually link and auto link.
Remove it. Build happily

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
resolution: needs-repro This issue could not be reproduced or needs a repro provided.
Projects
None yet
Development

No branches or pull requests

5 participants