When opening Android Studio I get the following error messages under messages Gradle Sync:
Please help. I need it for my work.
Add this to your project level build.gradle:
allprojects {
repositories {
jcenter()
maven {
url "https://maven.google.com"
}
}
}
as described here: cannot install repository and sync project - not able to use support libraries 25.2.0
Related
Good afternoon, I had a new problem in my android project, I don't know why but i can't implement a volley library in my project, i'm using Android Studio 3.1.3 API 26
I need a help.
Update your gradle to v 3.2.0:
classpath 'com.android.tools.build:gradle:3.2.0'
And make sure you have added:
repositories {
google() // should be always the first one
jcenter { url "http://jcenter.bintray.com/" }
maven {
url "https://jitpack.io"
}
}
In your root build.gradle repositories which is located in your project root -> build.gradle.
For better understanding:
I am using Visual Studio Apache Cordova and in there I am having an admob service. I updated my google play services as well as google support services via sdk. Besides, I updated everything from my android sdk, but I am still seeing this error.
I do see something on google post that these services are no longer supported via sdk but need to be put as dependencies in the project itself. But I don't know how to proceed with that
Solution here:
Failed to resolve: com.google.android.gms:play-services-basement:12.0.1
In next future, I recommend to update gradle and SDK in your project.
For now you can to try to add maven in android/build.gradle:
buildscript {
repositories {
maven { url "https://maven.google.com" }
jcenter()
...
...
allprojects {
repositories {
mavenLocal()
maven { url "https://maven.google.com" }
jcenter()
...
...
I'm trying to use Travis CI for my Android Project but my Builds constantly failing but works on local build. I am using Android Studio Preview 3 and gradle 3 alpha 3.
I am getting this error below.
Could not find com.android.tools.build:gradle:3.0.0-alpha3.
Here is my build log
My Travis Config file
My Project gradle file
I'm getting an Access denied error to your build log, and I didn't use it, but I'll try to answer you.
As announced here:
The Android Gradle Plugin 3.0.0-alpha3 was also released through
maven.google.com.
You can try to fix it by adding Google’s Maven Repository here like this:
buildscript {
repositories {
jcenter()
maven {
url "https://maven.google.com"
}
}
dependencies {
classpath 'com.android.tools.build:gradle:3.0.0-alpha3'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
Make sure that the repositories section includes a maven section with
the "https://maven.google.com" endpoint. For example:
allprojects {
repositories {
jcenter()
maven {
url "https://maven.google.com"
}
}
}
As commented here, this version doesn't exist in Bintray JCenter:
com.android.tools.build.gradle
latest version is 2.5.0-alpha-preview-02, there is no 3.0.0-alpha3
Also be sure to update build tools to the latest version as suggested in this related question:
Update your build tools from SDK manager
I add links to samples using the new sdkmanager command line here.
I would need a sample project reproducing the issue to check my suggestions.
I just forked fresh mapbox library and tried to add it to my project as a module. Main problem is that gradle gives error when it's synchronising, because I can't access telemetry 2.0.0-SNAPSHOT
Error:Could not find com.mapbox.mapboxsdk:mapbox-android-telemetry:2.0.0-SNAPSHOT.
Required by:
MyApp:app:unspecified > com.mapbox.mapboxsdk:MapboxGLAndroidSDK:5.0.0-SNAPSHOT
Search in build.gradle files
How can I add telemetry services to my project?
Or it's impossible and I should be patient and just check for latest public Mapbox release in git history (currently it's 4.2.2 on Android), checkout and use that version and wait for a new public release?
Finally I found out that top level gradle file was missing snapshot sonatype repository.
allprojects {
repositories {
jcenter()
flatDir {
dirs 'libs'
}
maven { url "http://oss.sonatype.org/content/repositories/snapshots/" }
}
}
Recently I upgraded my Cordova project from Cordova 3.0 to 5.3.3 and Android platform from 3.6 to 4.1. New android platform uses gradle for build and need to connect to internet (maven repo) every day for building. Once it connects to repo, it does not require connection for that day.
I am working behind the proxy which does not have access to maven repo. I am new to gradle build and want to configure gradle for offline building cordova application.
Here are environment details
OS -> MAC OSX
Cordova version -> 5.3.3
Cordova Android platform version -> 4.1
Kindly suggest.
Dependencies are declared in Gradle in the dependencies section and the repositories section controls where the dependencies are fetched from. For example:
repositories {
jcenter()
}
dependencies {
compile 'com.google.guava:guava:18.0'
}
This says, guava:18.0 is fetched during compile time, from the jcenter() repository. You can also use maven central as:
repositories {
mavenCentral()
}
A custom repo like a company repo as:
repositories {
maven {
url "http://repo.mycompany.com/maven2"
}
}
or, the local .m2 repo as:
repositories {
mavenLocal()
}
You can define multiple repositories as well:
repositories {
mavenLocal()
jcenter()
}
Gradle searches for dependencies in the order that the repositories are listed. So it will look in local .m2 first, and if a matching dependency isn't available, it goes out to JCenter to download dependencies.