Android Studio: Configure offline build dependencies
Asked Answered
G

1

0

Good day, I followed the instructions in the "Configure you Android Studio Page" to install offline build dependencies(found here https://developer.android.com/studio/intro/studio-config#offline). Downloaded the gradle plugin and the maven dependencies, unzipped them into the required folder, and also created the offline.gradle file, putting it in the appropriate folder. However, in the guide, it was said that to test it is working, one needs to comment the repositories in the build.gradle file. The problem is once I do this. My project fails to build.

I would appreciate any help with this. My SDK : Android 10(API 29) What I know: The android gradle plugin(I downloaded from the main site) is 3.5.0-beta01

When I check .android/manual-offline-m2/gmaven_stable/com/android/tools/build/gradle/ I see folders ranging from 3.0.0 to 3.4.0

The classpath in dependencies (in the build.gradle of my app) is 'com.android.tools.build:gradle:3.6.1'

The distributionUrl (gradle-wrapper.properties) points to https://services.gradle.org/distributions/gradle-5.6.4-all.zip

The ERROR I get says: A problem occured configuring root project 'TestingOfflineBuildApp'. Could not resolve all artifacts for configuration ':classpath'. Could not find com.android.tools.build:gradle:3.6.1. Searched in the following locations:

If I change the classpath from 3.6.1 to 3.5.0-beta01, the errors change to this(second pic). Error 1 Error 2 Thank you

Glomma answered 27/3, 2020 at 22:29 Comment(1)
Where did you find download for maven dependencies?Penzance
L
0

You don't need to change anything after configuring offline build dependencies, the error you getting is by putting comments on build.gradle file (i think there is exception in this documentation step 4 (optional) and that exception is [ internet is required one time for "new Android Gradle Plugin" version download if it is not present in local repo or cache ] ).

The Solution is

  1. (If error shows like this with "correct location of our set repo in local repo", then its fine,our setting is working fine) enter image description here

  2. Uncomment the comments which we commented earlier, classpath and other things should be same ,no need to change. enter image description here


Notes:- (follow this if offline build failed occurs after doing above steps)

Lamarre answered 8/4, 2020 at 17:48 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.