I installed JetBrains IDEA 15.0.2 with android support on my computer that is disconnected from Internet. After that the project sync give an error that gradle is not existed, so I solve the problem by downloading gradle 2.2.1 and extracting it in its corresponding position But after that a new sync error occurs that say "No cached version of com.android.tools.build:gradle:1.2.3 available for offline mode" How can I solve error, at the same time keeping my conputer disconnected from Internet
If we need to use the offline mode, just go to the Gradle window and click the Toggle Offline Mode button: After we click the button to enable offline mode, we can reload all dependencies and find that offline mode works.
Gradle needs an internet connection to download the dependencies that you specify. Once it downloads everything, it can put them in memory so that you can work offline. To do this, you need to go to Files->Settings (For Mac: Android Studio-> Settings...). You can now build your project without internet.
Go to Preferences -> Build,Execution,Deployment -> Build Tools -> Maven Uncheck the Work Offline option. To find it quickly: Open the settings and search for "offline".
Try the following steps:
I faced similar kind of issue in android studio because its also uses the gradle so my problem was app's source code was written in old version of gradle but i have the latest android studio with latest gradle. so changed the classpath dependency to have latest gradle version
Update the Classpath under dependency in build.gradle file at project level from
dependencies {
classpath 'com.android.tools.build:gradle:1.2.3'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
to
dependencies {
classpath 'com.android.tools.build:gradle:2.1.0'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With