Pushwoosh / pushwoosh-react-native-plugin

Other
57 stars 43 forks source link

Build fails #137

Closed Default112 closed 2 years ago

Default112 commented 2 years ago

I installed this plugin following the guide. Now if I want to build the app I get following Error:

Deprecated Gradle features were used in this build, making it incompatible with Gradle 8.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/7.2/userguide/command_line_interface.html#sec:command_line_warnings

FAILURE: Build failed with an exception.

* Where:
Build file '/Users/xxxxx/AppProjects/BielefeldApp/node_modules/pushwoosh-react-native-plugin/src/android/build.gradle' line: 49

* What went wrong:
A problem occurred evaluating project ':pushwoosh-react-native-plugin'.
> Failed to apply plugin class 'com.google.gms.googleservices.GoogleServicesPlugin'.
   > Cannot run Project.afterEvaluate(Closure) when the project is already evaluated.

* 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. Make sure you have the Android development environment set up: https://reactnative.dev/docs/environment-setup.
Error: Command failed: ./gradlew app:installDebug -PreactNativeDevServerPort=8081

FAILURE: Build failed with an exception.

* Where:
Build file '/Users/xxxxx/AppProjects/BielefeldApp/node_modules/pushwoosh-react-native-plugin/src/android/build.gradle' line: 49

* What went wrong:
A problem occurred evaluating project ':pushwoosh-react-native-plugin'.
> Failed to apply plugin class 'com.google.gms.googleservices.GoogleServicesPlugin'.
   > Cannot run Project.afterEvaluate(Closure) when the project is already evaluated.

* 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

    at makeError (/Users/xxxxx/AppProjects/BielefeldApp/node_modules/@react-native-community/cli-platform-android/node_modules/execa/index.js:174:9)
    at /Users/xxxxx/AppProjects/BielefeldApp/node_modules/@react-native-community/cli-platform-android/node_modules/execa/index.js:278:16
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
    at async runOnAllDevices (/Users/xxxxx/AppProjects/BielefeldApp/node_modules/@react-native-community/cli-platform-android/build/commands/runAndroid/runOnAllDevices.js:109:5)
    at async Command.handleAction (/Users/xxxxx/AppProjects/BielefeldApp/node_modules/@react-native-community/cli/build/index.js:192:9)

How do I fix this?

wfhm commented 2 years ago

@Default112 I could not reproduce it so far. Could you please share the build.gradle files and let us know what other plugins that rely on Google Services you use in your project? Also, what is the React Native version used in your project?

Default112 commented 2 years ago

@wfhm I was able to solve this issue. I was not setting up the Google Services right. I was missing some dependencies. I followed this guide to set up the pushwoosh plugin, but I had also follow this guide to set up firebase correctly.

Thank you!