Gradle build unable to compile when trying to add ads [duplicate] - android

This question already has answers here:
Failed to resolve: com.google.firebase:firebase-core:11.2.0
(6 answers)
Closed 5 years ago.
Ok so I am trying to add ads to my application and it tells me to add this line of code in my build.gradle file.
Error image:
compile 'com.google.android.gms:play-services:11.2.0'
As you can see in this image at the bottom it says
Failed to resolve:compile 'com.google.android.gms:play-services:11.2.0'
I cannot click Install repository and sync project because when I do it does nothing. Does not even open another windows or anything?

try adding
maven { url 'https://maven.google.com' }
to your project level gradle file

Try doing these steps,
1)Either you are missing maven link
`repositories {
maven {
url "https://maven.google.com"
}
}`
2) Try updating to your google repository in Android SDK
Start Android Studio -> On the Tools menu, click Android > SDK Manager.
Update the Android Studio SDK Manager: click SDK Tools, expand Support
Repository, select Google Repository, and then click OK.

Related

suddenly got error in gradle sync - build tool version 27.0.1 and support version 27.0.1 etc. not found in android studio project

Failed to resolve: com.android.support:support-v13:27.0.1
in my project I am using 25 , but it is showing error for 27.
I opened Android studio project, which was already developed.
Project was built successfully, but after few days suddenly this error came up in gradle sync.
I have installed build tools for 27 and sync with that, but it is still giving same error.
I think it is because of vcs or git used in project, is it possible?
or any other reason ? how to solve it?
Thanks
Add this code in your gradle
allprojects {
repositories {
jcenter()
mavenCentral()
maven {
url "https://maven.google.com"
}
}
}

Gradle doesnt support newest libraries [duplicate]

This question already has answers here:
Failed to resolve: com.android.support:cardview-v7:26.0.0 android
(26 answers)
Failed to resolve com.google.android.gms play-services-auth:11.4.0
(13 answers)
Failed to resolve: com.google.firebase:firebase-core:11.2.0
(6 answers)
Closed 5 years ago.
I have updated parts of the Android sdk and now I can use newer versions of my libraries but the gradle file doesn't accept them. Can you help me pls?
That one is the only projects where it get an error, that's why I think it gets the error 'cause of a local project file.
I got a failed to resolve error at each library
I use some of Google firebase (11.2.0) ;support:appcompat-v7(26.0.2); support:design (26.0.2)
Android studio says me that are the newest versions for my project.
Play services and Firebase dependencies are now available via maven.google.com with the release of version 11.2.0 of Google Play services and Firebase.
Add maven { url "https://maven.google.com" } to your root level build.gradle file
allprojects {
repositories {
jcenter()
maven {
url "https://maven.google.com"
}
}
}
For more information please check official doc

Android Studio 2.3, cannot build gradle. Error 304 [duplicate]

This question already has answers here:
Why am I getting "(304) Not Modified" error on some links when using HttpWebRequest?
(5 answers)
Closed 5 years ago.
I am just installed Android Studio 2.3.
However, when I create any application, it always error.
For example, I just create new blank project.
It shows error: Error:Response 304: Not Modified has no content!
(see the screenshot)
I have already tried
Installing and reinstalling android studio, even delete the folder and not importing anything.
Invalidate cache and restart Android Studio
UPDATE:
I have already fixed this...
The problem is jcenter might now have the junit.jar or espresso.jar needed (or my internet connectin prevent me to fecth those). So, I change it to mavenCentral and it works
Before:
allprojects {
repositories {
jcenter()
}
}
After:
allprojects {
repositories {
mavenCentral()
}
}
I've been struggling with the same thing for many hours
https://services.gradle.org/distributions/gradle-3.3-all.zip download this link and extract it into C:\Program Files\Android\Android Studio\gradle\ now go to androidstudio -> setting -> build -> gradle edit gradle home as C:\Program Files\Android\Android Studio\gradle\gradle-3.3 disable offline work and save it
If it is not work diable testCompile 'junit:junit:4.12' in gradle and retry this process

The IDE can't open library dependency dialog (Maven dependency)

After upgrade Android Studio to 1.2.1.1 Or later , The IDE can't open library dependency dialog (Maven dependency)
it gives this error :
Could not initialize class com.android.tools.idea.structure.gradle.MavenDependencyLookupDialog
is it a bug ,, or some thing Wrong ??
I Found it Finally , in new versions of android studio
you should activate the Maven box from :
new SDK Manager >> Plugins >> Maven Integration >> check this box
I used #Maher Answer and tried to show graphically
Step 1: In android studio Open Tools > Android > Sdk Manager
Step 2: Now click or Plugin > Maven Integration and mark checked

Android studio: How to delete crashlytics plugin

I'm using Android Studio 1.0.2.
Due to some reason i have to uninstall the Crashlytics plugin/SDK from my Android studio.
I have tried going to File>Settings>Plugins to remove Crashlytics, but this has not helped me, as i cannot find it in the plugin list.
Request if someone can provide a solution for this issue.
You need to delete crashlytics in app/build.gradle.
buildscript {
repositories {
maven { url 'http://download.crashlytics.com/maven' }
}
dependencies {
classpath 'com.crashlytics.tools.gradle:crashlytics-gradle:1.+'
}
}
compile 'com.crashlytics.android:crashlytics:1.+'
Delete line that show crashlytics in repositories and dependencies.
Delete file app/crashlytics.properties and app/main/assets/crashlytics-build.properties
Then build gradle again.
For plugins installed inside the Studio just go to File-Settings-Plugins and uninstall
You can go to the Preferences->Plugins on the search bar, you can search the plugin you want to remove or you can go >installed plugin tab and it will show you the list of installed plugin then select the plugin to remove just right click on it and it will show you the option>uninstall and then press on the Uninstall button.
File > Setting > plugins > installed plugins > right click on plugin > uninstall
In case you cannot delete a Plugin from Preferences->Plugins because is not on the list, navigate to
{User-Home}\AppData\Local\JetBrains\Toolbox\apps\AndroidStudio\ch-0\202.6787931.plugins
and simply delete its folder and restart Android Studio.
You may have to look up that path yourself, as mine is for a JetBrains Toolbox installation of Android Studio, but the process should be the same.
Hint: In my case the plugin in question lived in a folder named "plugin", what I had to figure out first.
For Mac User find plugin on below path.
/Users/username/Library/Application
Support/Google/AndroidStudio2021.3/Plugins
Bold text would be different depending on computer environment + Android Studio version
For the new Android Studio version (Android Studio Electric Eel | 2022.1.1).
To delete or uninstall the Plugin, the steps are below:
Settings -> Plugins -> Choose Tab Installed -> Select the Plugin you want -> Click Icon Setting (Right of Title) -> Uninstall

Categories

Resources