Big problem since upgrading to Android Studio 3.1, I get:
No cached version of com.github.bumptech.glide:compiler:4.6.1 available for offline mode
But I am not in offline mode as you can see here:
I tried Clean Project and Rebuild Project, all with no success.
I even rebooted my PC.
Here's my Build.gradle:
dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation 'com.android.support:design:27.1.0'
implementation 'com.android.support:support-v4:27.1.0'
implementation 'com.android.support:appcompat-v7:27.1.0'
implementation "com.android.support:gridlayout-v7:27.1.0"
implementation 'com.android.support:exifinterface:27.1.0'
implementation 'com.android.support.constraint:constraint-layout:1.0.2'
implementation 'com.google.code.gson:gson:2.8.2'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.1'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1'
implementation 'com.github.bumptech.glide:glide:4.6.1'
annotationProcessor 'com.github.bumptech.glide:compiler:4.6.1'
}
I ran into this issue and "offline work" was unchecked inside gradle settings. After wasting 2 hours on it, I realized that I had --offline in the Command-line options of Build, Execution, Deployment > Compiler. So make sure you don't have that command listed there when you encounter this issue.
You should close Gradle offline-work model and clear compiler Command-line Options --offline:
The only thing that worked for me was to remove the "--offline" in "File -> Settings -> Compiler -> Command-line Options".
I don't know why this parameter was there but anyway...now it's ok.
Dont know what was going on, maybe it was really due to JCenter being partly down during the day. Probably because half the globe was upgrading Android Studio to 3.1.
I cleaned the cache (70.000 files!), no effect, except from a resulting hourlong download of thousands of files, mainly from JCenter, with at least 10 fails (time outs?) along the way.
End result: Gradle still complaing about
No cached version of com.github.bumptech.glide:compiler:4.6.1 available for offline mode
Then in desparation, I modified
annotationProcessor 'com.github.bumptech.glide:compiler:4.6.1'
to
`compile group: 'com.github.bumptech.glide', name: 'compiler', version:` '4.6.1'
in my Build.gradle.
The result was of course an error message.
After then changing back to where I came from
compile group: 'com.github.bumptech.glide', name: 'compiler', version: '4.6.1'
Bingo: all was good, no idea why.
Thanks for your help anyway
First My English is very poor,Sorry.
I meet this problem too,when I upgrade my AndroidStudio to 3.1 and update gradle 3.0.1 to 3.1.0 ,then I build to run my project,it is error “no version of butterknife in offline mode”,but I'm sure it’s not offline mode。I have tried to a lot of ways ,doesn't work.
Then I try to add dependences in AndroidStudio ProjectStructure--app--dependences,search and selected the butterknife,and then build to run.
It works!
https://blog.csdn.net/binglumeng/article/details/79747651
I hope It can help you!
have you tried invalidating your cache and restarting your android studio?
or else if your working behind a proxy network checkout this
link
Related
Gradle Dependencies are:
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'androidx.appcompat:appcompat:1.0.2'
implementation 'com.google.android.material:material:1.1.0-alpha05'
implementation 'androidx.constraintlayout:constraintlayout:2.0.0-alpha3'
implementation 'androidx.vectordrawable:vectordrawable:1.1.0-alpha01'
implementation 'androidx.recyclerview:recyclerview:1.0.2'
implementation 'androidx.cardview:cardview:1.0.0'
implementation 'com.hendraanggrian.material:collapsingtoolbarlayout-subtitle:1.0.0'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'androidx.test:runner:1.1.1'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.1'
Gradle Project Sync failed every time after clean and rebuild.
To resolve this issue please Turn off Gradle offline mode.
Just go to (android studio 3.6 and above)
View -> Tool Window -> Gradle -> Toggle Offline Mode Icon
Click here to see the Toggle Offline Mode Icon
Gradle is in offline mode, which means that it won't go to the network to resolve dependencies.
Go to Preferences (File->Settings->Build, Execution, Deployment) -> Gradle and uncheck "Offline work".
if gradle global settings is set to offline work ,android studio will not be able to resolve this for you
To Resolve this
Go to preferences
Build,Execution,Deployment
Gradle
Global gradle settings
Uncheck offline work
Then Rebuild your project/Try sync
Make sure you have a working internet connection else possibly not work
enter image description here
Go to build.gradle(:app) and change
implementation 'androidx.appcompat:appcompat:1.4.0'
to
implementation 'androidx.appcompat:appcompat:1.3.1'
as shown in the diagram
Go to settings then search for gradle. Here are 2 status:
Your gradle is set to work offline(by checkbo
Your gradle path is not set correctly(if there wasn't problem before)
If all thing is ok then search proxy in setting page and check them. You can also check your connectivity here.
These 3 ways may solve the problem.
I wanted to get started with learning to code for android devices and for this i've bought a course on udemy. Unfortunately after the third video I couldn't go on because of some very annoying problems in the Android studio version 3.1.3. I tried to solve the problems but since i'm just a very beginer in programming and espacially in java I didn't stand a chance to solve it on my own and sadly every solution which i've found on the internet didn't function. So here is my problem.
Every time I start a project (no matter which) the layout won't load. And then I get this 4 messages.
Pic 1
Pic 2
I think the render problem is because of the missing styles and the missing styles are because of the classes which failed to instantiate. I think the private ressources problem is independent. So I really have no clue how to solve this problem. I think i tried almost everything. Is it possible that it has something to do with the java development kid? I've downloaded the newest version but I'm not sure if Android Studio is using it. Or maybe something with the normal java software is wrong.
Maybe the build.gradle will help you to find a solution:
pic 3
I really appreciate your time and your answers and if you need some further information please let me know.
Thank you and kind regards
Gmunderos7
UPDATE:
I've downloaded both versions on this website:
https://developer.android.com/studio/preview/?utm_source=android-studio
And both of them don't have this problems (just the private ressource). Would you recommend using one of the versions (or maybe an older version than 3.1.3 which don't has this problems)?
And can someone even use version 3.1.3 without such problems?
Step 1: "File" -> "Invalidate caches / Restart" -> "Invalidate"
Step 2: "File" -> "Close project"
Step 3: In launcher window delete your project
Step 4: Open your project by "Open an existing Android Studio project"
Step 5: Write nice code :)
I had the same problem and i fixed it today, I changed my dependencies into these
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:appcompat-v7:27.1.1'
implementation 'com.android.support:cardview-v7:27.1.1'
implementation 'com.android.support:design:27.1.1'
implementation 'android.arch.core:runtime:1.1.1'
implementation 'com.android.support.constraint:constraint-layout:1.1.2'
implementation 'com.firebaseui:firebase-ui-firestore:4.1.0'
implementation 'com.android.support:recyclerview-v7:27.1.1'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
compile 'com.google.firebase:firebase-core:16.0.0'
apply plugin: 'com.google.gms.google-services'
}
I get that error:
style attribute 'android:attr/metaButtonBarStyle' not found
I get it on a new empty project on a just installed version of Android Studio.
I've tried rebuilding the project, adding the property metaButtonBarStyle in the generated values.xml file, disabling AAPT2 on gradle-wrapper.properties with android.enableAapt2=false, I've tried uninstalling plugins and Android Studio, starting with a just-installed version of Android Studio with an empty project and I still get the error.
this are my dependencies:
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:appcompat-v7:27.1.1'
implementation 'com.android.support.constraint:constraint-layout:1.1.1'
implementation 'com.android.support:design:27.1.1'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
could anybody help me with this?
Downgrading which SDK you're using may help unless you need a particular one.
I know when I was using Android's SDK with the Unity game engine I had to go in and delete/rename a folder to trigger Unity to download versions of those files that worked, I don't know if a similar auto-repair is available in Android Studio but if there is you might want to locate where metaButtonBarStyle should be and rename the parent folder.
I'm working on a project. I started with updating the libraries after not touching the project for around a year or so. Updated most of the libraries except implementation 'com.google.android.gms:play-services-maps:9.2.1' and implementation 'com.google.android.gms:play-services-gcm:9.2.1' because there is an older version of a library supplying push for me, which I can't update right now. Anyways, after a while I opened some classes and noticed that for example SupportMapFragment is red and says "Unresolved reference". This happens with every class that comes out of the two libraries. However, the project still runs and still works as expected.
Why is this happening? And how can I fix it?
I will list some other libraries which could have an influence below:
$support_library_version = '27.1.0'
implementation "com.android.support:appcompat-v7:$support_library_version"
implementation "com.android.support:recyclerview-v7:$support_library_version"
implementation "com.android.support:cardview-v7:$support_library_version"
implementation "com.android.support:design:$support_library_version"
implementation 'com.squareup.retrofit2:retrofit:2.3.0'
implementation 'com.squareup.picasso:picasso:2.5.2'
implementation('com.crashlytics.sdk.android:crashlytics:2.9.1#aar') {
transitive = true;
}
They got updated from these versions:
$support_library_version = '24.1.1'
compile 'com.squareup.retrofit2:retrofit:2.0.2'
compile 'com.squareup.picasso:picasso:2.5.2'
Crashlytics was not added in previous versions
I was experiencing a similar issue earlier today and used the instructions from this post to fix it:
File->Invalidate Caches/Restart
In addition, it appears that Gradle 3.1.0 doesn't work, but Gradle 2.3.0 does.
Apparently the version I had for GCM and maps was too low. I had to update to a higher version and the unresolved references disappeared. I'm using 11.8.0 right now.
I am facing a issue after run existing android studio project. Please check error below and let me know how to resolve that.
Error:(54) Error retrieving parent for item: No resource found that matches the given name 'Theme.AppCompat.Light'.
Thanks in advance
Try to use accroding gradle plugin. I've got the problem with plugin 2.3-beta1 and Studio 2.2.3, when changed to plugin 2.2.3 - everything worked like a charm
Please change compileSdkVersion and buildToolsVersion in your gradle file according to your android studio existing running project.
Our compile SDK version must match the support library's major
version.
If you are using version 23 of the support library, you need to compile against version 23 of the Android SDK.
Alternatively you can continue compiling against version 22 of the Android SDK by switching to the latest support library v22.
You can either change it manually in your build.gradle, or you can use
the GUI by opening up the project properties and going to the
"dependencies" tab.
Or Press Ctrl + Shift + Alt + S to get to the project structure page. Go to the properties tab and change version to 23.0.0 or whatever latest in the build tool area and rebuild your project.
If that doesn't work, go to gradle:app and then
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:22.2.1'
Edit version as shown above and sync gradle.
Ran into same issue as OP, March 2017 Android Studio 2.3.
My build was working fine for months, and this issue came up right after adding a new line to gradle build file. Ultimately making some changes in Gradle and re-sync'ing fixed the issue, but my Gradle ended up being exactly the same as when the issue first came up, strangely.
My original Gradle build dependencies:
compile 'com.android.support:design:25.1.1'
compile 'com.android.support:multidex:1.0.1'
compile 'com.android.support:support-v4:25.1.1'
compile 'com.android.support:appcompat-v7:25.1.1'
compile 'com.android.support:gridlayout-v7:25.1.1'
compile 'com.android.support:cardview-v7:25.1.1'
compile 'com.android.support:recyclerview-v7:25.1.1'
compile 'com.google.android.gms:play-services-location:10.0.0'
compile 'com.google.android.gms:play-services-maps:10.0.0'
compile 'com.google.maps.android:android-maps-utils:0.5'
compile 'com.android.volley:volley:1.0.0'
compile 'com.google.code.gson:gson:2.4'
Then, I simply added a new line:
compile 'org.scribe:scribe:1.3.5'
This is when the issue appeared, same as OP.
I saw red errors in my styles.xml and wondered "wtf?".
Cleaning and re-building had no affect.
Going back to the Gradle build file, I commented-out that new line. ISSUE RESOLVED! So obviously there was something going on.
For fun, I put that line, uncommented, at the top of this compile list. NO ISSUE!
For fun yet again, I put that line back again to the bottom of the list (like how originally added it). NO ISSUE.... weird!
How Gradle sync'ing responds doesn't seem to be 100% consistent. I did no other changes to my project. All I can say is try toggling and re-ordering things in the compile list.