nutritionfactsorg / daily-dozen-android

Keep track of the foods that Dr. Greger recommends in his NYT's best-selling book, How Not to Die with this Android app
https://play.google.com/store/apps/details?id=org.nutritionfacts.dailydozen&hl=en
Other
274 stars 95 forks source link

Fix error "Could not find com.android.tools.build:gradle:3.0.1" #96

Closed alibitek closed 6 years ago

alibitek commented 6 years ago

As per the Configure Your Build documentation Google's repository is needed when using Android plugin for Gradle version 3.0.1 as a classpath dependency.

The building from the command line also fails:

./gradlew assembleDebug

FAILURE: Build failed with an exception.

* What went wrong:
A problem occurred configuring root project 'daily-dozen-android'.
> Could not resolve all files for configuration ':classpath'.
   > Could not find com.android.tools.build:gradle:3.0.1.
     Searched in the following locations:
         https://jcenter.bintray.com/com/android/tools/build/gradle/3.0.1/gradle-3.0.1.pom
         https://jcenter.bintray.com/com/android/tools/build/gradle/3.0.1/gradle-3.0.1.jar
     Required by:
         project :

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

* Get more help at https://help.gradle.org

Not sure why it works without it from Android Studio.

Encountered this error while running build-fdroid.sh to test if the F-Droid build works locally: https://forum.f-droid.org/t/build-failing-with-could-not-find-gradle-error/1612