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

Error compiling after updating to react-native 0.72.1 #7217

Closed lmahoudeau closed 1 year ago

lmahoudeau commented 1 year ago

Issue

Hello, After updating to react-native 0.72.1 from 0.71.11. firebase app v18.1.0 is not compiling anymore with android studio, and got this issue after gradlew clean and gradlew :app:assembleRelease

Task :react-native-firebase_app:extractDeepLinksForAarRelease FAILED

FAILURE: Build failed with an exception.

What did I do wrong ?

Thank you for your help


LeleDallas commented 1 year ago

Same issue here in Xcode. I'm trying to install firebase app to a react native 0.72.1 project but when I open the app in my iOS emulator, it crash. I follow all the requirement from the guide but I cannot run the app.

lmahoudeau commented 1 year ago

Hello,

I tried with the new react-native version 0.72.2 and it's still the same (full 1st failed task) :

1: Task failed with an exception.

LeleDallas commented 1 year ago

Same issue here in Xcode. I'm trying to install firebase app to a react native 0.72.1 project but when I open the app in my iOS emulator, it crash. I follow all the requirement from the guide but I cannot run the app.

I opened a specific issue about it https://github.com/invertase/react-native-firebase/issues/7237

Choyeongdeok commented 1 year ago

Hello,

I tried with the new react-native version 0.72.2 and it's still the same (full 1st failed task) :

1: Task failed with an exception.

  • What went wrong: Some problems were found with the configuration of task ':react-native-firebase_app:packageDebugResources' (type 'MergeResources').

    • Gradle detected a problem with the following location: 'E:\git_sources\bus-on-time-app\node_modules@react-native-firebase\app\android\build\generated\res\rs\debug'. Reason: Task ':react-native-firebase_app:packageDebugResources' uses this output of task ':@react-native-firebase_app:compileDebugRenderscript' 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:compileDebugRenderscript' as an input of ':react-native-firebase_app:packageDebugResources'.
    2. Declare an explicit dependency on ':@react-native-firebase_app:compileDebugRenderscript' from ':react-native-firebase_app:packageDebugResources' using Task#dependsOn.
    3. Declare an explicit dependency on ':@react-native-firebase_app:compileDebugRenderscript' from ':react-native-firebase_app:packageDebugResources' using Task#mustRunAfter.

    Please refer to https://docs.gradle.org/8.0.1/userguide/validation_problems.html#implicit_dependency for more details about this problem.

  • Exception is: org.gradle.internal.execution.WorkValidationException: Some problems were found with the configuration of task ':react-native-firebase_app:packageDebugResources' (type 'MergeResources').

    • Gradle detected a problem with the following location: 'E:\git_sources\bus-on-time-app\node_modules@react-native-firebase\app\android\build\generated\res\rs\debug'. Reason: Task ':react-native-firebase_app:packageDebugResources' uses this output of task ':@react-native-firebase_app:compileDebugRenderscript' 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:compileDebugRenderscript' as an input of ':react-native-firebase_app:packageDebugResources'.
    2. Declare an explicit dependency on ':@react-native-firebase_app:compileDebugRenderscript' from ':react-native-firebase_app:packageDebugResources' using Task#dependsOn.
    3. Declare an explicit dependency on ':@react-native-firebase_app:compileDebugRenderscript' from ':react-native-firebase_app:packageDebugResources' using Task#mustRunAfter.

    Please refer to https://docs.gradle.org/8.0.1/userguide/validation_problems.html#implicit_dependency for more details about this problem.

    • Gradle detected a problem with the following location: 'E:\git_sources\bus-on-time-app\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.

    Please refer to https://docs.gradle.org/8.0.1/userguide/validation_problems.html#implicit_dependency for more details about this problem.

+1, any update?

yogeshchauhan commented 1 year ago

any updates on same

mikehardy commented 1 year ago

Hi everyone! This is an open source repository, development is conducted in the open. There are no secret updates, so if you do not see one here, there is no update.

Asking if there is an update, when you do not see one, does not advance the issue.

As far as I can tell - and I test these things all the time there is no problem with react-native 0.72.x.

This is not an idle statement. I prove it here, and you can prove it to yourself: https://github.com/mikehardy/rnfbdemo/blob/main/make-demo.sh

Note that the original poster specifically cites a failure with ./gradlew assembleRelease and note the script explicitly tests that: https://github.com/mikehardy/rnfbdemo/blob/6c59d358a970f418ef578e81d124f99e4e1de1b5/make-demo.sh#L343

lmahoudeau commented 1 year ago

Hi @mikehardy,

Thank you very much for your answer.

So it turns out, after removing the firebase librairy, that firebase wasn't the problem! In fact, I'm using react-native-reanimated v2 used along side with react-native-navigation v4 which, from what I saw in the librairy forum, is not compatible with react-native v0.72.x. When the project is compiling, react-native is falling back to v0.71 and creates loads of compatibility issues with other librairies.

Sorry for taking up your time, but if I update the react-native-reanimated v3 with the new @react-native-navigation librairy, I think my problems will go away...

You can close/archive my thread

Thank you

mikehardy commented 1 year ago

glad to hear you seem to have found the root cause and have a path forward I'll close this but hopefully the information you helpfully provided will assist others Cheers!

drager commented 11 months ago

I'm currently encounter a similar issue for android with React Native 0.72.5 and

"@react-native-firebase/app": "14.9.3",
"@react-native-firebase/dynamic-links": "14.9.3",
"@react-native-firebase/messaging": "14.9.3",

If I remove implementation project(path: ":@react-native-firebase_messaging") from build.gradle the build works fine.

> Task :@react-native-firebase_messaging:compileDebugJavaWithJavac

> Task :react-native-firebase_messaging: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.

See https://docs.gradle.org/8.1.1/userguide/command_line_interface.html#sec:command_line_warnings
148 actionable tasks: 11 executed, 137 up-to-date

info πŸ’‘ Tip: Make sure that you have set up your development environment correctly, by running 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

⚠  Cannot resolve the path to "ast-types" package.
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
⚠  Cannot resolve the path to "ast-types" package.

FAILURE: Build failed with an exception.

* What went wrong:
Some problems were found with the configuration of task ':react-native-firebase_messaging:packageDebugResources' (type 'MergeResources').
  - Gradle detected a problem with the following location: 'node_modules/@react-native-firebase/messaging/android/build/generated/res/rs/debug'.

    Reason: Task ':react-native-firebase_messaging:packageDebugResources' uses this output of task ':@react-native-firebase_messaging:compileDebugRenderscript' 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_messaging:compileDebugRenderscript' as an input of ':react-native-firebase_messaging:packageDebugResources'.
      2. Declare an explicit dependency on ':@react-native-firebase_messaging:compileDebugRenderscript' from ':react-native-firebase_messaging:packageDebugResources' using Task#dependsOn.
      3. Declare an explicit dependency on ':@react-native-firebase_messaging:compileDebugRenderscript' from ':react-native-firebase_messaging:packageDebugResources' using Task#mustRunAfter.

    Please refer to https://docs.gradle.org/8.1.1/userguide/validation_problems.html#implicit_dependency for more details about this problem.
  - Gradle detected a problem with the following location: 'node_modules/@react-native-firebase/messaging/android/build/generated/res/resValues/debug'.

    Reason: Task ':react-native-firebase_messaging:packageDebugResources' uses this output of task ':@react-native-firebase_messaging: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_messaging:generateDebugResValues' as an input of ':react-native-firebase_messaging:packageDebugResources'.
      2. Declare an explicit dependency on ':@react-native-firebase_messaging:generateDebugResValues' from ':react-native-firebase_messaging:packageDebugResources' using Task#dependsOn.
      3. Declare an explicit dependency on ':@react-native-firebase_messaging:generateDebugResValues' from ':react-native-firebase_messaging:packageDebugResources' using Task#mustRunAfter.

    Please refer to https://docs.gradle.org/8.1.1/userguide/validation_problems.html#implicit_dependency for more details about this problem.
manueldomi commented 11 months ago

@drager Have you found solution ?

zemuldo commented 11 months ago

Seems to be related to using old firebase messaging configurations. According to https://rnfirebase.io/messaging/usage, no extract steps are needed. Try editing these file.

android/settings.gradle Remove these lines

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

build.gradle remove

implementation project(path: ":@react-native-firebase_messaging")

Seems to work for me after removing these configurations.

vikrant-sixer commented 10 months ago

Solution given by [zemuldo] https://github.com/invertase/react-native-firebase/issues/7217#issuecomment-1752166762 worked for me while I was upgrading to 0.72.6. I was getting similar error for _app and _crashlytics. Made similar changes for both and this fixed the issue.