What is the order of searching maven repositories in Android - android

I had a problem writing android projects,I have a build.grade file as follows. When I build the project, I pull the project dependencies in the order A->B->C->mavenLocal? Or mavenLocal -> C->B->A? Or any other search order? Is it that once a Maven pull is successful there is no further search?Please help me~
allprojects {
repositories {
maven { url A }
maven { url B }
maven { url C }
mavenLocal()
}
}

Related

Android gradle problem while build with using MPAndroidChart

I am trying to use MPAndroidChart, but there is occuring build gradle problem.
I reference the github document below.
https://github.com/PhilJay/MPAndroidChart
I follow the 'Gradle Setup'
repositories {
maven { url 'https://jitpack.io' }
}
dependencies {
implementation 'com.github.PhilJay:MPAndroidChart:v3.1.0'
}
This is how I put the codes
and when I started to build it the error code is
Build was configured to prefer settings repositories over project repositories but repository 'maven' was added by build file 'app\build.gradle'
Did I put the build code in the wrong way? or did I missed some important settings?
Probably, you need to append the entry, maven { ... } to the dependencyResolutionManagement.repositories clause in settings.gradle.
app/build.gradle
// repositories {
// maven { url 'https://jitpack.io' }
// }
settings.gradle
dependencyResolutionManagement {
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
repositories {
google()
mavenCentral()
maven { url 'https://jitpack.io' }
}
}

How to limit the repositories of a specific module in a multi-module Android project

I want to specify specific repositories only for specific modules
I try above code.
allprojects {
repositories {
google()
jcenter()
maven { url "https://jitpack.io" }
}
}
project(':specific_module') {
repositories {
google()
jcenter()
maven { url "https://jitpack.io" }
maven { url 'https://specific.repository.url' } -> specific repository
}
}
Sync succeeds, but build fails.
Please help me.
Sorry for may poor english.
Thank you.

Bitrise error Could not find com.google.gms:google-services:3.2.1 [duplicate]

This question already has answers here:
Error: could not find com.google.gms:google-services:4.2.0
(4 answers)
Closed 4 years ago.
I get the following error in bitrise CI, although the build works find locally. I made no changes to the gradle files yet they suddenly stopper working in bitrise CI
A problem occurred configuring root project 'src'.
> Could not resolve all files for configuration ':classpath'.
> Could not find com.google.gms:google-services:3.2.1.
Searched in the following locations:
https://dl.google.com/dl/android/maven2/com/google/gms/google-services/3.2.1/google-services-3.2.1.pom
https://dl.google.com/dl/android/maven2/com/google/gms/google-services/3.2.1/google-services-3.2.1.jar
https://maven.google.com/com/google/gms/google-services/3.2.1/google-services-3.2.1.pom
https://maven.google.com/com/google/gms/google-services/3.2.1/google-services-3.2.1.jar
file:/root/.m2/repository/com/google/gms/google-services/3.2.1/google-services-3.2.1.pom
file:/root/.m2/repository/com/google/gms/google-services/3.2.1/google-services-3.2.1.jar
https://maven.fabric.io/public/com/google/gms/google-services/3.2.1/google-services-3.2.1.pom
https://maven.fabric.io/public/com/google/gms/google-services/3.2.1/google-services-3.2.1.jar
https://jcenter.bintray.com/com/google/gms/google-services/3.2.1/google-services-3.2.1.pom
https://jcenter.bintray.com/com/google/gms/google-services/3.2.1/google-services-3.2.1.jar
Required by:
project :
but ./gradlew assembleDebug it works fine locally.
gradle project:
buildscript {
repositories {
google()
maven { url 'https://maven.google.com' }
maven { url 'https://dl.google.com/dl/android/maven2' }
mavenLocal()
maven { url 'https://maven.fabric.io/public' }
maven { url "http://dl.bintray.com/populov/maven" }
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.1.2'
classpath 'com.google.gms:google-services:3.2.1'
classpath 'io.fabric.tools:gradle:1.25.1'
}
}
allprojects {
repositories {
def androidHome = System.getenv("ANDROID_HOME")
maven { url "$androidHome/extras/android/m2repository" }
google()
maven { url "https://maven.google.com" }
maven { url 'https://dl.google.com/dl/android/maven2' }
mavenLocal()
maven { url "http://repo.commonsware.com.s3.amazonaws.com" }
maven { url "http://dl.bintray.com/populov/maven" }
jcenter()
}
}
gradle app:
apply plugin: 'com.google.gms.google-services'
What's going wrong here?
com.google.gms.google-services just disappears from google repository (at https://dl.google.com/dl/android/maven2/index.html)
Issue here => https://issuetracker.google.com/issues/120759347
A temporary workaround is to add this repository to your buildscript repositories
maven { url 'https://dl.bintray.com/android/android-tools' }
See this answer. Google Seems to be having some issues; they are currently looking into it.
The reason it works locally is because your dependancy is still cached. If you need to fix it temporarily, add the following line to your buildscript --> repositories in your main (project-level) build.gradle file. (See this other answer)
maven { url 'https://dl.bintray.com/android/android-tools' }

jcenter.bitrary library support-v4/26.1.0 not accessible || Android Build || Ionic Build || error

Please, someone can check this and tell me that where it has been moved. The problem started today when building an ionic app.
https://jcenter.bintray.com/com/android/support/support-v4/26.1.0/support-v4-26.1.0.jar
had the same issue today - scratched my head for a while before I realized the package was missing. No other reports on it than your post, too so... yeeha.
What worked for me just now was removing jcenter from the gradle buildscript and allprojects repositories and adding three others. now it looks like this:
buildscript {
repositories {
google()
maven {
url "https://maven.google.com"
}
maven { url 'https://maven.fabric.io/public' }
maven { url 'https://plugins.gradle.org/m2/' }
}
compatibility
dependencies {
classpath 'com.android.tools.build:gradle:3.0.0'
}
}
allprojects {
repositories {
google()
maven {
url "https://maven.google.com"
}
maven { url 'https://maven.fabric.io/public' }
maven { url 'https://plugins.gradle.org/m2/' }
}
}
I also told android studio not to try and update gradle - after that it worked. All this was really specific - so I don't know which one of the things I did was actually the solution. Hope this helps anyway ;)

Second maven repository in gradle on an Android Project

this is the way I added facebook repository in order to use FacebookSDK on an gradle-based android project
repositories {
mavenCentral()
mavenLocal()
maven {
url "http://mente.github.io/facebook-api-android-aar"
}
}
Now I have to add a new repository for the umano sliding menu (https://github.com/umano/AndroidSlidingUpPanel).
I've tried something like this (but it obviously doesn't work):
repositories {
mavenCentral()
mavenLocal()
maven {
url "http://mente.github.io/facebook-api-android-aar", "https://bitbucket.org/luciofm/m2repository/raw/master/"
}
}
You need to add it separately:
maven {
url "http://mente.github.io/facebook-api-android-aar"
}
maven {
url "https://bitbucket.org/luciofm/m2repository/raw/master/"
}

Categories

Resources