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

[0.57.0-rc.4] run-android: Could not find method google()... #21020

Closed
fungilation opened this issue Sep 8, 2018 · 7 comments
Closed

[0.57.0-rc.4] run-android: Could not find method google()... #21020

fungilation opened this issue Sep 8, 2018 · 7 comments
Labels
Resolution: Locked This issue was locked by the bot.

Comments

@fungilation
Copy link

fungilation commented Sep 8, 2018

Environment

  React Native Environment Info:
    System:
      OS: Windows 10
      CPU: x64 Intel(R) Core(TM) i7-8700K CPU @ 3.70GHz
      Memory: 3.47 GB / 15.95 GB
    Binaries:
      Yarn: 1.9.4 - C:\Program Files (x86)\Yarn\bin\yarn.CMD
      npm: 6.4.1 - C:\Program Files\nodejs\npm.CMD

Description

> react-native run-android
Starting JS server...
Building and installing the app on the device (cd android && gradlew.bat installDebug)...
Starting a Gradle Daemon (subsequent builds will be faster)

FAILURE: Build failed with an exception.

* Where:
Build file 'C:\Users\Gary\Documents\code\WonderSwipe\android\build.gradle' line: 13

* What went wrong:
A problem occurred evaluating root project 'wonderswipe'.
> Could not find method google() for arguments [] on repository container of type org.gradle.api.internal.artifacts.dsl.DefaultRepositoryHandler.

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

BUILD FAILED

Total time: 8.287 secs

Reproducible Demo

Run react-native run-android like above, with this as gradle-wrapper.properties like mine:

distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-3.5.1-all.zip

Took me some googling to figure this out. I fixed this with

distributionUrl=https\://services.gradle.org/distributions/gradle-4.10-all.zip

Gradle 4.10 is the current latest.

For RN 0.57 release, should change distributionUrl in android templates so users with old gradle dep like me don't bump into this same issue.

This complements this merged PR in 0.57: #20767

@gengjiawen
Copy link
Contributor

The gradle version in template is 4.4, which should works. Are you creating new project, or upgrade from old project ?

@fungilation
Copy link
Author

fungilation commented Sep 8, 2018

Upgrade from old (rc0), with my existing gradle-wrapper.properties.

Any "harm" in going with gradle 4.10 as I have, or should I stick with 4.4 myself?

PS. probably 4.4.1, as the latest minor version off 4.4

@gengjiawen
Copy link
Contributor

gengjiawen commented Sep 8, 2018

Both should works fine. But android gradle plugin is using 4.4, that's why we choose that version.

@fungilation
Copy link
Author

If there's no simple way to conditionally enforce Gradle being >= 4.4 in gradle-wrapper.properties on upgrade to RN 0.57, should document this requirement as manual upgrade instructions.

@gengjiawen
Copy link
Contributor

gengjiawen commented Sep 10, 2018

Actually you should use react-native-git-upgrade to upgrade react native project. I think there are things already going on for this.
cc @kelset .

@kelset
Copy link
Contributor

kelset commented Sep 10, 2018

should document this requirement as manual upgrade instructions.

could any of you add a comment related to this here, so that we can add an extra step?

I mean, we have already a section mentioning the Android native side updates, but maybe be worth mentioning the specific changes?

@gengjiawen
Copy link
Contributor

I have mentioned there.

@facebook facebook locked as resolved and limited conversation to collaborators Sep 8, 2019
@react-native-bot react-native-bot added the Resolution: Locked This issue was locked by the bot. label Sep 8, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Resolution: Locked This issue was locked by the bot.
Projects
None yet
Development

No branches or pull requests

4 participants