Skip to content

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

Closed
@fungilation

Description

@fungilation

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions