Gradle cannot find dependency that doesn't exist - Android studio - android

I'm trying to import an android project from bitbucket at my work, as the former android developer quit and I'm to continue his work.
Gradle sync never returns ok. It got the error:
Error:Could not find
com.google.android.gms:play-services-measurement:9.0.0. Required by:
frontend:app:unspecified
funny thing is, I grabbed every occourence of the string "measurement" at the whole git folder and found only one, at module app, build.gradle, and it was commented and not even the version gradle is complaining about:
dependencies {
...
// compile 'com.google.android.gms:play-services-measurement:8.3.0'
...
}
Can someone please help? I would really appriciate it as I'm struggling here for a couple of hours already.
Thx in advance!
the project (named "frontend") build.gradle:
buildscript {
repositories {
jcenter()
mavenCentral()
maven {
url "https://oss.sonatype.org/content/repositories/snapshots"
}
}
dependencies {
classpath 'com.android.tools.build:gradle:1.3.0'
classpath 'me.tatarka:gradle-retrolambda:3+'
classpath 'com.neenbedankt.gradle.plugins:android-apt:1.4'
classpath 'com.google.gms:google-services:2.0.0-alpha3'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
jcenter()
mavenCentral()
maven {
url "https://oss.sonatype.org/content/repositories/snapshots"
}
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
the module (named "app") build.gradle:
apply plugin: 'com.android.application' apply plugin: 'me.tatarka.retrolambda'
android {
compileSdkVersion 23
buildToolsVersion "23.0.2"
defaultConfig {
applicationId "com.smartbus"
minSdkVersion 17
targetSdkVersion 23
versionCode 29
versionName "2.1.5"
multiDexEnabled true
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
useLibrary 'org.apache.http.legacy'
dexOptions {
preDexLibraries = false
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
lintOptions {
abortOnError false
}
}
retrolambda {
jdk "C:\\ProgramData\\Oracle\\Java\\javapath\\java.exe"
jvmArgs '-noverify' }
dependencies {
apply plugin: 'android-apt'
compile fileTree(dir: 'libs', include: ['*.jar'])
testCompile 'junit:junit:4.12'
provided "org.projectlombok:lombok:1.16.8"
apt "org.projectlombok:lombok:1.16.8"
compile 'com.android.support:multidex:1.0.1'
compile 'com.android.support:appcompat-v7:24.0.0-alpha2'
compile 'com.android.support:design:24.0.0-alpha2'
compile 'com.android.support:cardview-v7:24.0.0-alpha2'
compile 'com.google.guava:guava:18.0'
compile 'org.reflections:reflections:0.9.10'
compile 'com.annimon:stream:1.0.5'
compile 'com.squareup.okhttp3:logging-interceptor:3.0.0-RC1'
compile 'com.squareup.retrofit2:retrofit:2.0.0-beta3'
compile 'com.squareup.retrofit2:converter-gson:2.0.0-beta3'
compile 'com.github.rey5137:material:1.2.2'
compile 'com.getbase:floatingactionbutton:1.10.1'
compile 'com.prolificinteractive:material-calendarview:1.1.0'
compile 'com.google.code.gson:gson:2.5'
// compile 'com.google.android.gms:play-services-measurement:8.3.0'
retrolambdaConfig 'net.orfjackal.retrolambda:retrolambda:+'
compile 'com.google.android.gms:play-services-analytics:9.0.0'
// compile 'com.google.android.gms:play-services-location:9.0.0'
}
apply plugin: 'com.google.gms.google-services'
the whole-error:
Error:A problem occurred configuring project ':app'. Could not resolve
all dependencies for configuration ':app:_debugCompile'. Could not
find com.google.android.gms:play-services-measurement:9.0.0.
Searched in the following locations:
https://jcenter.bintray.com/com/google/android/gms/play-services-measurement/9.0.0/play-services-measurement-9.0.0.pom
https://jcenter.bintray.com/com/google/android/gms/play-services-measurement/9.0.0/play-services-measurement-9.0.0.jar
https://repo1.maven.org/maven2/com/google/android/gms/play-services-measurement/9.0.0/play-services-measurement-9.0.0.pom
https://repo1.maven.org/maven2/com/google/android/gms/play-services-measurement/9.0.0/play-services-measurement-9.0.0.jar
https://oss.sonatype.org/content/repositories/snapshots/com/google/android/gms/play-services-measurement/9.0.0/play-services-measurement-9.0.0.pom
https://oss.sonatype.org/content/repositories/snapshots/com/google/android/gms/play-services-measurement/9.0.0/play-services-measurement-9.0.0.jar
file:/C:/Users/Re'em/AppData/Local/Android/sdk/extras/android/m2repository/com/google/android/gms/play-services-measurement/9.0.0/play-services-measurement-9.0.0.pom
file:/C:/Users/Re'em/AppData/Local/Android/sdk/extras/android/m2repository/com/google/android/gms/play-services-measurement/9.0.0/play-services-measurement-9.0.0.jar
file:/C:/Users/Re'em/AppData/Local/Android/sdk/extras/google/m2repository/com/google/android/gms/play-services-measurement/9.0.0/play-services-measurement-9.0.0.pom
file:/C:/Users/Re'em/AppData/Local/Android/sdk/extras/google/m2repository/com/google/android/gms/play-services-measurement/9.0.0/play-services-measurement-9.0.0.jar
Required by:
frontend:app:unspecified

Can you change
classpath 'com.google.gms:google-services:2.0.0-alpha3' to the latest version say
classpath 'com.google.gms:google-services:3.0.0'
and check
courtesy user3330522 answer

Related

Error:Execution failed for task ':app:transformClassesWithJarMergingForDebug'. while build apk

I know that there is so many question regarding this, but I have tried all solution from StackOverflow but still I did not resolve this issue
my app level build.gradle files is
buildscript {
repositories {
maven { url 'https://maven.fabric.io/public' }
}
dependencies {
classpath 'io.fabric.tools:gradle:1.+'
}
}
apply plugin: 'com.android.application'
apply plugin: 'io.fabric'
repositories {
maven { url 'https://maven.fabric.io/public' }
}
android {
compileSdkVersion 25
buildToolsVersion '25.0.2'
defaultConfig {
applicationId "com.aple.gole.video"
minSdkVersion 15
targetSdkVersion 25
versionCode 1
versionName "0.1"
multiDexEnabled true
manifestPlaceholders = [onesignal_app_id: "a1bdfc88-fffb-4283-9c45-8a15b3bbd3a2",
// Project number pulled from dashboard, local value is ignored.
onesignal_google_project_number: "REMOTE"]
}
buildTypes {
release {
shrinkResources false
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_7
targetCompatibility JavaVersion.VERSION_1_7
}
}
dependencies {
compile 'com.android.support:appcompat-v7:25.3.1'
compile 'com.android.support:support-v4:25.3.1'
compile 'com.android.support:design:25.3.1'
compile 'com.android.support:customtabs:25.3.1'
compile 'com.android.support:recyclerview-v7:25.3.1'
compile 'com.android.support:multidex:1.0.1'
compile 'com.google.code.gson:gson:2.7'
compile 'org.jsoup:jsoup:1.8.3'
compile 'org.mozilla:rhino:1.7.7'
compile 'ch.acra:acra:4.9.0'
compile 'info.guardianproject.netcipher:netcipher:1.2'
compile 'com.nostra13.universalimageloader:universal-image-loader:1.9.5'
compile 'de.hdodenhof:circleimageview:2.0.0'
compile 'com.github.nirhart:parallaxscroll:1.0'
compile 'com.nononsenseapps:filepicker:3.0.0'
compile 'com.google.android.exoplayer:exoplayer:r2.4.2'
compile ('com.crashlytics.sdk.android:crashlytics:2.6.8#aar') {
transitive = true;
}
compile ('com.onesignal:OneSignal:[3.5.3,4.0.0)') {
exclude group: 'com.google.android.gms', module: 'play-services'
}
compile 'com.github.varunest:sparkbutton:1.0.5'
compile 'com.google.firebase:firebase-database:11.0.2'
}
apply plugin: 'com.google.gms.google-services'
I started to get this issue when I used this
apply plugin: 'com.google.gms.google-services'
but it required for firebase
my project level build.gradle is
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.3.3'
classpath 'com.google.gms:google-services:3.1.0'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
jcenter()
maven {
url "https://maven.google.com"
}
maven { url "https://jitpack.io" }
}
}
From External Library I have found different version of Google Play Service
Might be that will crate problem, let me share you screenshot
please click here to check screenshot
but now problem is why there is different version of Google Play Service, One is Play Service iid 10.0.1 and other one is play service task 11.0.2
,How to make it same
Hi I have found that you
compile 'com.google.firebase:firebase-database:11.0.2'
is using
google-play-service lib 11.0.2
You can do this
compile 'com.google.firebase:firebase-database:10.0.1'
so it will use
google-play-service lib 10.0.1
it will work, I have tested

Adding apply plugin: 'org.robolectric' in (app)gradle file shows project refresh failed Error:The Android Gradle plugin 2.1.2 is not supported

Hi Am trying to configure Jenkins in android studio. I followed this link
and i installed Jenkins in MAC system and verified with my localhost to check its running perfectly or not(as mentioned in the above link).
I have added following line in my project(root) dependency.
classpath 'org.robolectric:robolectric-gradle-plugin:1.0.1'
My updated project .gradle file is
dependencies {
classpath 'com.android.tools.build:gradle:2.1.2'
classpath 'org.robolectric:robolectric-gradle-plugin:1.0.1'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
No issues while sync project .gradle file.
But the problem starts after updating(adding robolectric) app .gradle file
apply plugin: 'com.android.application'
apply plugin: 'org.robolectric'
this gives me the following error message
Gradle 'CreatrixAndApp' project refresh failed
Error:The Android Gradle plugin 2.1.2 is not supported.
this is my project root .gradle file
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.1.2'
classpath 'org.robolectric:robolectric-gradle-plugin:1.0.1'
}
}
allprojects {
repositories {
jcenter()
}
}
this is my app .gradle file
apply plugin: 'com.android.application'
apply plugin: 'org.robolectric'
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.1.2'
}
}
repositories {
mavenCentral()
maven {
url "${System.env.HOME}/.m2/repository"
}
flatDir {
dirs 'libs'
}
}
android {
compileSdkVersion 23
buildToolsVersion "23.0.2"
useLibrary 'org.apache.http.legacy'
defaultConfig {
applicationId 'com.creatrixhrm'
minSdkVersion 16
targetSdkVersion 23
versionCode 20160615
versionName "1.6.0"
multiDexEnabled true
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
productFlavors {
}
dexOptions {
javaMaxHeapSize "4g"
preDexLibraries = false
}
lintOptions {
checkReleaseBuilds false
abortOnError false
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile project(':photoViewerLibrary')
compile project(':multipleImagePick')
compile(name: 'creatrixone1_1', ext: 'aar')
compile 'com.android.support:multidex:1.0.1'
compile 'com.android.support:cardview-v7:23.3.0'
compile 'com.android.support:recyclerview-v7:23.3.0'
compile 'com.android.support:design:23.3.0'
compile 'com.android.support:appcompat-v7:23.3.0'
compile 'com.android.support:support-vector-drawable:23.3.0'
compile 'com.android.support:animated-vector-drawable:23.3.0'
compile 'com.koushikdutta.ion:ion:2.1.7'
compile 'mbanje.kurt:fabbutton:1.2.2#aar'
compile 'com.google.code.gson:gson:2.4'
compile 'com.android.support:support-v4:23.3.0'
compile 'com.google.android.gms:play-services-gcm:8.4.0'
compile 'io.jsonwebtoken:jjwt:0.6.0'
}
I tried following this suggestion, but no use
can anyone tell me where i am making mistake

gradle is not resolving any new dependencies in android studio

I am making an Intro for my app.So after some research i had got an github project which is used to make cool intros.It requires following dependencies :
compile 'com.github.paolorotolo:appintro:4.0.0'
when I compile it with gradle it gives me following errors:
Failed to resolve: com.github.paolorotolo:appintro:4.0.0
I have done some research on internet but anything didn't worked out.
here is my build.gradle(Module:app)
apply plugin: 'com.android.application'
android {
compileSdkVersion 24
buildToolsVersion "24.0.1"
defaultConfig {
applicationId "com.example.adarsh.testapp"
minSdkVersion 16
targetSdkVersion 24
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:24.2.0'
compile 'com.android.support:support-v4:24.2.0'
compile 'com.github.paolorotolo:appintro:4.0.0'
}
and here is my build.gradle(project:testapp)
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.1.3'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
jcenter()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
I solved my issue by just adding mavenCentral() in repositories in build.gradle.

Error:(3, 0) Cause: org/apache/commons/lang3/StringUtils

I get the following error
Error:(3, 0) Cause: org/apache/commons/lang3/StringUtils
when I try to add data binding in my Android project.
My dependencies include :
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.0.0-alpha7'
classpath 'me.tatarka:gradle-retrolambda:3.2.2'
classpath 'com.android.databinding:dataBinder:1.0-rc1'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
jcenter()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
My gradle wrapper is : distributionUrl=https://services.gradle.org/distributions/gradle-2.2.1-all.zip
My gradle file :
apply plugin: 'com.android.application'
apply plugin: 'me.tatarka.retrolambda'
apply plugin: 'com.android.databinding'
android {
compileSdkVersion 23
buildToolsVersion "23.0.1"
defaultConfig {
applicationId "com.quizviz.workbook.myworkbook"
minSdkVersion 14
targetSdkVersion 23
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
dataBinding {
enabled = true
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:23.1.1'
compile 'com.android.support:design:23.1.1'
compile 'io.reactivex:rxandroid:1.1.0'
compile 'io.reactivex:rxjava:1.1.0'
compile 'com.jakewharton.rxbinding:rxbinding:0.2.0'
compile 'com.jakewharton:butterknife:7.0.1'
compile 'com.squareup.retrofit2:retrofit:2.0.0-beta3'
compile 'com.squareup.retrofit2:converter-jackson:2.0.0-beta3'
compile 'com.squareup.retrofit2:adapter-rxjava:2.0.0-beta3'
compile 'com.squareup.okhttp3:okhttp:3.0.1'
compile 'com.squareup.okhttp3:okhttp-urlconnection:3.0.1'
}
It took me a while to notice this problem is caused by google updating the way to use data binding library. You can see more information from here:
http://developer.android.com/tools/data-binding/guide.html.
You can just remove these two lines of code:
apply plugin: 'com.android.databinding'
And this one in buildscript's dependencies:
classpath 'com.android.databinding:dataBinder:1.0-rc1'
Then add the dataBinding section to your build.gradle like this.
buildscript {
...
}
android {
...
dataBinding {
enabled = true
}
...
}
dependencies {
...
}
Here you go. This works for me :).

AndroidStudio/Kotlin - Unresolved reference: ReadWriteProperty - Kotlin version 1.0.0-beta-1038

I have a working Android project using Kotlin version 1.0.0-beta-1038 in Android Studio.
I can run it using Kotlin in different parts, it compiles and works in the emulator but when I tried to use ReadWriteProperty it gives this error message:
Unresolved reference: ReadWriteProperty
Class called PreferenceUtils.kt:
build.grade (Module: app)
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
android {
compileSdkVersion 23
buildToolsVersion "23.0.1"
defaultConfig {
applicationId "com.droidcba.oculto"
minSdkVersion 16
targetSdkVersion 23
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
sourceSets {
main.java.srcDirs += 'src/main/kotlin'
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:23.0.1'
compile 'com.android.support:design:23.0.1'
compile 'com.android.support:recyclerview-v7:23.0.1'
compile "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
compile 'com.squareup.retrofit:retrofit:2.0.0-beta1'
compile 'com.squareup.retrofit:adapter-rxjava:2.0.0-beta1'
compile 'com.squareup.retrofit:converter-gson:2.0.0-beta1'
compile 'io.reactivex:rxandroid:1.0.1'
compile 'io.reactivex:rxjava:1.0.14'
}
buildscript {
ext.kotlin_version = '1.0.0-beta-1038'
repositories {
mavenCentral()
}
dependencies {
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath "org.jetbrains.kotlin:kotlin-android-extensions:$kotlin_version"
}
}
repositories {
mavenCentral()
}
build.grade (Module: myProject)
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:1.3.0'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
jcenter()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
Please let me know if you need more info. Thanks!
Solved! I have to upgrade the Kotlin Plugin
from Android Studio. It started to recognise "ReadWriteProperty".

Categories

Resources