I am getting this error:
Build file 'C:\Users\Acer Bilgisayar\Desktop\Android Project\app\build.gradle' line: 1
A problem occurred evaluating project ':app'.
> Failed to apply plugin 'com.onesignal.androidsdk.onesignal-gradle-plugin'.
> Could not create plugin of type 'GradleProjectPlugin'.
> Could not initialize class com.onesignal.androidsdk.GradleProjectPlugin
build.gradle:
error:
Replace jcenter() with mavenCentral() in build.gradle
buildscript {
repositories {
google()
//jcenter()
mavenCentral()
maven { url 'https://plugins.gradle.org/m2/' }
}
}
allprojects {
repositories {
google()
//jcenter()
mavenCentral()
maven { url "https://jitpack.io" }
maven { url 'https://plugins.gradle.org/m2/' }
maven { url "https://maven.google.com" }
}
}
Related
I am using "auth-retrofit" and that problem I face it,
and I can't understand where is the problem and why that's my Gradle code and that's the shown error.
"" Build file 'C:\Users\Ammar\AndroidStudioProjects\user-auth-retrofit\build.gradle' line: 7
A problem occurred evaluating root project 'user-auth-retrofit'.Could not find method google() for arguments [] on repository container.""
here's my Build gradle:
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
jcenter()
maven { url 'https://maven.google.com' }
google()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.0.0'
}
}
allprojects {
repositories {
jcenter()
maven { url 'https://maven.google.com' }
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
I am having a 502 Gateway error when gradle try to fetch artifacts from 'https://jcenter.bintray.com/. I have tried to remove the jcenter repository from my platforms/android/build.gradle file but nothing change. I also changed the configuration of my repositories but during the compilation still calling the jcenter.bintray.com that seems to be down.
buildscript {
repositories {
google()
maven { url "https://jcenter.bintray.com" }
maven { url "https://dl.bintray.com" }
maven { url 'https://maven.fabric.io/public' }
maven { url 'https://jitpack.io' }
mavenCentral()
maven { url "https://maven.google.com" }
}
dependencies {
classpath 'com.android.tools.build:gradle:3.1.0'
}
}
// Allow plugins to declare Maven dependencies via build-extras.gradle.
allprojects {
repositories {
google()
mavenCentral()
maven { url "https://jcenter.bintray.com" }
maven { url "https://dl.bintray.com" }
maven { url 'https://jitpack.io' }
maven { url "https://maven.google.com" }
maven { url 'https://maven.fabric.io/public' }
}
}
I am trying to install with gradle this library:
https://android-arsenal.com/details/1/6652
It NEEDS jitpack in the gradle:
allprojects {
repositories {
jcenter()
maven {
url "https://jitpack.io"
}
}
}
All fixes I have found result in me having to replace the above with maven.google.
I need to use jitpack.
The errors i get:
Failed to resolve com.android.support.appcompat.
Add https://maven.google.com or google() to your repositories block.
allprojects {
repositories {
jcenter()
maven {
url "https://maven.google.com"
}
maven {
url "https://jitpack.io"
}
}
}
OR
allprojects {
repositories {
jcenter()
google()
maven {
url "https://jitpack.io"
}
}
}
Add AppCompact lib as below:
In the app.gradle, add appCompact lib:
implementation "com.android.support:appcompat-v7:27.0.0"
Add google() as below:
allprojects {
repositories {
jcenter()
google()
maven {
url "https://jitpack.io"
}
}
}
I follow Migrate to the New Plugin doc,add google maven "https://maven.google.com"
buildscript {
repositories {
mavenCentral()
jcenter()
// jcenter {
// url "http://jcenter.bintray.com/"
// }
//这里是 LeanCloud 的包仓库
maven {
url "http://mvn.leancloud.cn/nexus/content/repositories/releases"
}
//MPAndroidChart仓库
maven { url "https://jitpack.io" }
//google
maven {
url 'https://maven.google.com'
}
}
dependencies {
classpath 'com.android.tools.build:gradle:3.0.0-alpha1'
classpath group: 'org.tmatesoft.svnkit', name: 'svnkit', version: '1.8.11'
classpath 'com.jakewharton:butterknife-gradle-plugin:7.0.1'
// https://mvnrepository.com/artifact/com.jakewharton/butterknife
// classpath group: 'com.jakewharton', name: 'butterknife', version: '7.0.1'
}
}
to gradle script.
After that,when i build project,got this error:
Error:No route to host
I use VPN and connect to google.com fine.
How can i fix this problem
You should delete the Google maven repo from your app/gradle and instead put it your project base gradle file :
buildscript {
repositories {
mavenCentral()
jcenter()
maven { url 'https://maven.google.com' }
}
...
While Clean & build, following error comes up
FAILURE: Build failed with an exception.
* What went wrong:
A problem occurred configuring root project 'MyProject'.
> Could not resolve all dependencies for configuration ':classpath'.
> Could not resolve com.google.gms:google-services:1.3.0-beta1.
Required by:
:MyProject:unspecified
> Could not resolve com.google.gms:google-services:1.3.0-beta1.
> Could not get resource 'https://jcenter.bintray.com/com/google/gms/google-services/1.3.0-beta1/google-services-1.3.0-beta1.pom'.
> Could not GET 'https://jcenter.bintray.com/com/google/gms/google-services/1.3.0-beta1/google-services-1.3.0-beta1.pom'.
> peer not authenticated
> Could not resolve com.google.gms:google-services:1.3.0-beta1.
> Could not get resource 'https://repo1.maven.org/maven2/com/google/gms/google-services/1.3.0-beta1/google-services-1.3.0-beta1.pom'.
> Could not GET 'https://repo1.maven.org/maven2/com/google/gms/google-services/1.3.0-beta1/google-services-1.3.0-beta1.pom'.
> peer not authenticated
i also added security cert in the C:\Program Files\Java\jre7\lib\security, but still no clue how to fix it, Please help me
build.gradle
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.1.2'
classpath 'com.google.gms:google-services:1.3.0-beta1'
repositories { mavenCentral() }
}
}
allprojects {
repositories {
maven {
url 'https://jitpack.io'
}
jcenter {
url "http://jcenter.bintray.com/"
}
}
}
Thanks
Try changing your build.gradle to this:
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.1.2'
classpath 'com.google.gms:google-services:1.3.0-beta1'
}
}
allprojects {
repositories {
jcenter()
}
}
or force gradle to use http with this:
buildscript {
repositories {
maven { url "http://jcenter.bintray.com" }
}
dependencies {
classpath 'com.android.tools.build:gradle:2.1.2'
classpath 'com.google.gms:google-services:1.3.0-beta1'
}
}
allprojects {
repositories {
maven { url "http://jcenter.bintray.com" }
}
}