ANDROID ERROR: java.lang.NoSuchMethodError: com.google.common.base.Preconditions.checkState - java

Help please!
I've been trying to figure this out for 2 days and tried almost everything I could find, but with no luck.
The app builds ok, but then when I Make Project I get this error.
Running Android Studio 2.3 , jdk 1.8 on Windows 10 64-bit
Already tried using Jack and guava version 20.0
This is my gradle.build:
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
jcenter()
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.3.0'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
// Realm
classpath "io.realm:realm-gradle-plugin:3.0.0"
//GCM
classpath 'com.google.gms:google-services:3.0.0'
// Retrolambda , https://github.com/evant/gradle-retrolambda/
classpath 'me.tatarka:gradle-retrolambda:3.5.0'
// https://github.com/JakeWharton/butterknife
classpath 'com.jakewharton:butterknife-gradle-plugin:8.5.1'
}
}
allprojects {
repositories {
mavenCentral()
jcenter()
maven { url "https://jitpack.io" }
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
and gradle.build in the app dir:
import groovy.json.JsonOutput
import groovy.json.JsonSlurper
def generateFireBaseJsonConfiguration(file) {
def properties = loadPropertiesFile(file)
def templateFile = new File("google-services.json.template")
def json = new JsonSlurper().parseText(templateFile.text)
// populate properties
json.project_info.project_number = properties['FirebaseProjectInfoNumber']
json.project_info.firebase_url = properties['FirebaseProjectInfoUrl']
json.project_info.project_id = properties['FirebaseProjectInfoId']
json.project_info.storage_bucket = properties['FirebaseProjectInfoBucket']
json.client[0].client_info.mobilesdk_app_id = properties['FirebaseClientInfoMobileSDKAppId']
json.client[0].client_info.android_client_info.package_name = "org.openstack.android.summit"
json.client[0].api_key[0].current_key = properties['FirebaseClientApiKeyCurrent']
json.client[0].oauth_client[0].client_id = properties['FirebaseClientOAUTH2ClientClientId1']
json.client[0].oauth_client[0].client_type = 3
json.client[0].oauth_client[1].client_id = properties['FirebaseClientOAUTH2ClientClientId2']
json.client[0].oauth_client[1].client_type = 3
def jsonFile = new File("app/google-services.json")
jsonFile.write(JsonOutput.toJson(json))
}
buildscript {
repositories {
mavenCentral()
maven { url 'https://maven.fabric.io/public' }
}
dependencies {
classpath 'io.fabric.tools:gradle:1.+'
}
}
apply plugin: 'com.android.application'
apply plugin: 'io.fabric'
apply plugin: 'me.tatarka.retrolambda'
repositories {
mavenCentral()
maven { url 'https://maven.fabric.io/public' }
maven {
url 'https://github.com/uPhyca/stetho-realm/raw/master/maven-repo'
}
flatDir {
dirs 'libs'
}
}
def loadPropertiesFile(properties_file){
Properties props = new Properties()
println 'loading properties file : '+ properties_file;
props.load(new FileInputStream(file(properties_file)));
return props;
}
def getPropertyFromFile(properties_file, key){
Properties props = loadPropertiesFile(properties_file);
return props[key]
}
def expandManifest(flavor, properties_file) {
println 'expanding manifest for: ' + flavor
Properties props = loadPropertiesFile(properties_file);
return [
googleMapApiKey: props['googleMapApiKey'],
fabricApiKey: props['fabricApiKey'],
parseApplicationId: props['parseApplicationId'],
parseClientKey: props['parseClientKey'],
ServiceClientId: props['ServiceClientId'],
ServiceClientSecret: props['ServiceClientSecret'],
NativeClientId: props['NativeClientId'],
NativeClientSecret: props['NativeClientSecret'],
NativeClientReturnUrl: props['NativeClientReturnUrl'],
ResourceServerBaseUrl: props['ResourceServerBaseUrl'],
IdentityProviderBaseUrl: props['IdentityProviderBaseUrl'],
WebSiteBaseUrl: props['WebSiteBaseUrl'],
YouTubeAndroidPlayerAPIKey: props['YouTubeAndroidPlayerAPIKey'],
BasicAuthUser: props['BasicAuthUser'],
BasicAuthPass: props['BasicAuthPass'],
]
}
android {
signingConfigs {
config {
}
}
dexOptions {
javaMaxHeapSize "4g" //specify the heap size for the dex process
preDexLibraries = false
}
compileSdkVersion 25
buildToolsVersion '25.0.2'
defaultConfig {
applicationId "org.openstack.android.summit"
minSdkVersion 16
targetSdkVersion 25
versionCode 72
versionName "2.0"
multiDexEnabled true
testInstrumentationRunner 'android.support.test.runner.AndroidJUnitRunner'
}
buildTypes {
debug {
// Settings for Crashlytics Beta Distribution
ext.betaDistributionReleaseNotes = "Release Notes for this build."
ext.betaDistributionEmails = getPropertyFromFile("../summit-app.debug.properties", "BetaDistributionEmails")
ext.enableCrashlytics = false
}
release {
minifyEnabled true
//debuggable true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
productFlavors {
development {
generateFireBaseJsonConfiguration("../summit-app.debug.properties")
ext.betaDistributionEmails = getPropertyFromFile("../summit-app.debug.properties", "BetaDistributionEmails")
manifestPlaceholders = expandManifest("beta", "../summit-app.debug.properties")
}
production {
generateFireBaseJsonConfiguration("../summit-app.properties")
manifestPlaceholders = expandManifest("production", "../summit-app.properties")
}
beta {
generateFireBaseJsonConfiguration("../summit-app.debug.properties")
manifestPlaceholders = expandManifest("beta", "../summit-app.debug.properties")
}
}
packagingOptions {
pickFirst 'META-INF/license.txt'
pickFirst 'META-INF/LICENSE.txt'
pickFirst 'META-INF/NOTICE.txt'
// to avoid error file included twice
exclude 'META-INF/rxjava.properties'
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
sourceSets {
main {
jniLibs.srcDirs = ['libs']
}
}
variantFilter { variant ->
def names = variant.flavors*.name
if (names.contains("development") && variant.buildType.name == "release") {
variant.ignore = true
}
if (names.contains("production") && variant.buildType.name == "debug") {
variant.ignore = true
}
if (names.contains("beta") && variant.buildType.name == "debug") {
variant.ignore = true
}
}
}
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
compile 'com.android.support:appcompat-v7:25.2.0'
compile 'com.android.support:recyclerview-v7:25.2.0'
compile 'jp.wasabeef:recyclerview-animators:2.2.5'
compile 'com.android.support:design:25.2.0'
compile 'joda-time:joda-time:2.9.4'
compile 'com.google.code.gson:gson:2.7'
// Dagger 2 and Compiler
// https://github.com/google/dagger
compile 'com.google.dagger:dagger:2.8'
annotationProcessor 'com.google.dagger:dagger-compiler:2.8'
// Google's OAuth library for OpenID Connect
// See https://code.google.com/p/google-oauth-java-client/wiki/Setup
compile('com.google.oauth-client:google-oauth-client:1.22.0') {
exclude group: 'xpp3', module: 'xpp3'
exclude group: 'org.apache.httpcomponents', module: 'httpclient'
exclude group: 'junit', module: 'junit'
exclude group: 'com.google.android', module: 'android'
}
compile 'com.google.api-client:google-api-client-android:1.21.0'
// Google's JSON parsing, could be replaced with Jackson
compile 'com.google.api-client:google-api-client-gson:1.21.0'
compile 'org.modelmapper:modelmapper:0.7.5'
compile('com.github.claudioredi:Ranger:da908aa') {
exclude module: 'joda-time'
}
// progress indicator
compile 'cc.cloudist.acplibrary:library:1.2.1'
// pop up alerts
compile 'com.github.claudioredi:sweet-alert-dialog:9c1be1a'
// image library
compile 'com.facebook.fresco:fresco:0.11.0'
// simulate list with a linear layout
compile 'com.github.frankiesardo:linearlistview:1.0.1#aar'
// page indicator
compile 'com.githang:viewpagerindicator:2.4.2#aar'
// Tags
compile 'com.github.kaedea:Android-Cloud-TagView-Plus:5a49f4f'
// google maps
compile 'com.google.android.gms:play-services-maps:10.0.1'
// to get rid of UNEXPECTED TOP-LEVEL EXCEPTION: due oo many method references: (max is 65536)
// https://github.com/BoltsFramework/Bolts-Android
compile 'com.android.support:multidex:1.0.1'
compile 'com.parse.bolts:bolts-applinks:1.4.0'
compile files('libs/YouTubeAndroidPlayerApi.jar')
// material design spiner
compile('com.weiwangcn.betterspinner:library-material:1.1.0') {
exclude group: 'com.android.support', module: 'appcompat-v7'
}
compile('com.crashlytics.sdk.android:crashlytics:2.6.1#aar') {
transitive = true;
}
testCompile 'org.mockito:mockito-core:2.0.86-beta'
testCompile 'junit:junit:4.12'
testCompile 'org.robolectric:robolectric:3.1'
testCompile 'org.powermock:powermock-module-junit4:1.6.5'
testCompile 'org.powermock:powermock-module-junit4-rule:1.6.5'
testCompile 'org.powermock:powermock-api-mockito:1.6.5'
testCompile 'org.powermock:powermock-classloading-xstream:1.6.5'
androidTestCompile 'junit:junit:4.12'
androidTestCompile 'com.android.support.test:runner:0.5'
androidTestCompile 'com.android.support.test:rules:0.5'
androidTestCompile 'com.android.support:support-annotations:23.4.0'
if (file('libs/safe_storage.aar').exists()) {
println('adding dependency safe_storage.aar ...')
productionCompile "org.openstack.android.summit.safestorage:safe_storage#aar"
}
if (file('libs/safe_storage-testing.aar').exists()) {
println('adding dependency safe_storage-testing.aar ...')
betaCompile "org.openstack.android.summit.safestorage:safe_storage-testing#aar"
}
if (file('libs/safe_storage_debug.aar').exists()) {
println('adding dependency safe_storage_debug.aar ...')
developmentCompile "org.openstack.android.summit.safestorage:safe_storage_debug#aar"
}
// http://facebook.github.io/stetho and https://github.com/uPhyca/stetho-realm
compile 'com.facebook.stetho:stetho:1.4.2'
compile 'com.uphyca:stetho_realm:2.0.0'
// retrofit (REST API)
compile 'com.squareup.retrofit2:retrofit:2.1.0'
compile 'com.squareup.okhttp3:okhttp:3.5.0'
compile 'com.squareup.okhttp3:logging-interceptor:3.5.0'
compile 'com.squareup.retrofit2:converter-gson:2.1.0'
// Espresso Dependencies
androidTestCompile 'com.android.support.test:runner:0.5'
androidTestCompile 'com.android.support.test:rules:0.5'
androidTestCompile 'com.android.support.test.espresso:espresso-core:2.2.2'
androidTestCompile('com.android.support.test.espresso:espresso-contrib:2.2.2', {
exclude module: 'support-annotations'
exclude module: 'support-v4'
exclude module: 'recyclerview-v7'
exclude module: 'design'
})
configurations.all {
resolutionStrategy {
force 'com.android.support:support-annotations:23.0.1'
}
}
compile 'com.google.firebase:firebase-core:10.0.1'
compile 'com.google.firebase:firebase-messaging:10.0.1'
// RXJAVA
// HACK to get rid of an error related to realm https://github.com/realm/realm-java/issues/1963
// this is needed bc REALM dependency
compile('io.reactivex:rxjava:1.1.7') {
exclude module: 'rx.internal.operators'
}
// RXJAVA 2.x
compile 'io.reactivex.rxjava2:rxjava:2.0.5'
compile 'io.reactivex.rxjava2:rxandroid:2.0.1'
compile 'com.jakewharton.retrofit:retrofit2-rxjava2-adapter:1.0.0'
compile 'com.jakewharton:butterknife:8.5.1'
annotationProcessor 'com.jakewharton:butterknife-compiler:8.5.1'
}
apply plugin: 'realm-android'
apply plugin: 'com.google.gms.google-services'
apply plugin: 'com.jakewharton.butterknife'
Finally this is the console log:
...
:app:incrementalDevelopmentDebugJavaCompilationSafeguard
:app:javaPreCompileDevelopmentDebug
:app:compileDevelopmentDebugJavaWithJavac
...
C:\android_projects\summit-app-android\app\src\main\java\org\openstack\android\summit\OpenStackSummitApplication.java:17: error: cannot find symbol
import org.openstack.android.summit.dagger.components.DaggerApplicationComponent;
^
symbol: class DaggerApplicationComponent
location: package org.openstack.android.summit.dagger.components
warning: unknown enum constant Scope.LIBRARY_GROUP
...
* What went wrong:
Execution failed for task ':app:compileDevelopmentDebugJavaWithJavac'.
> java.lang.NoSuchMethodError: com.google.common.base.Preconditions.checkState(ZLjava/lang/String;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;)V

Thanks to Rahul I figured out how to solve this. As he mentioned the problem was that I was including different versions of guava. So first I ran this in Android Studio terminal :
gradlew -q dependencies app:dependencies --configuration compile
where "app" is your project. This showed me a list of all dependencies and saw that different versions of guava where being included.
Then I excluded each repeated version of guava from the included projects like this:
testCompile ('org.robolectric:robolectric:3.1') {
exclude module: 'guava'
}
Hope this helps someone :)

Related

**> Could not find com.jfrog.bintray.gradle:gradle-bintray-plugin:1.8.5.** & **> Could not find com.novoda:bintray-release:0.9.2.**

This is my first time here, i just updated gradle from 3.XX to 7.2.0 and am rebuilding and finding the following error.
I am not sure how to go about resolving the same. I consistently get new gradle build errors after resolving old ones. Is this normal?
Thanks for any help regarding the same.
A problem occurred configuring root project 'paramg-android-app'.
> Could not resolve all files for configuration ':classpath'.
**> Could not find com.novoda:bintray-release:0.9.2.**
Searched in the following locations:
- https://dl.google.com/dl/android/maven2/com/novoda/bintray-release/0.9.2/bintray-release-0.9.2.pom
- https://jitpack.io/com/novoda/bintray-release/0.9.2/bintray-release-0.9.2.pom
- https://repo.maven.apache.org/maven2/com/novoda/bintray-release/0.9.2/bintray-release-0.9.2.pom
Required by:
project :
**> Could not find com.jfrog.bintray.gradle:gradle-bintray-plugin:1.8.5.**
Searched in the following locations:
- https://dl.google.com/dl/android/maven2/com/jfrog/bintray/gradle/gradle-bintray-plugin/1.8.5/gradle-bintray-plugin-1.8.5.pom
- https://jitpack.io/com/jfrog/bintray/gradle/gradle-bintray-plugin/1.8.5/gradle-bintray-plugin-1.8.5.pom
- https://repo.maven.apache.org/maven2/com/jfrog/bintray/gradle/gradle-bintray-plugin/1.8.5/gradle-bintray-plugin-1.8.5.pom
Required by:
project :
Possible solution:
- Declare repository providing the artifact, see the documentation at https://docs.gradle.org/current/userguide/declaring_repositories.html
App module build.gradle file:
buildscript {
repositories {
google()
mavenCentral()
}
}
repositories {
google()
mavenCentral()
}
apply plugin: 'com.android.library'
apply plugin: 'com.novoda.bintray-release'
apply plugin: 'com.jfrog.bintray'
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android-extensions'
apply plugin: 'kotlin-android'
apply from: '../dependencies.gradle'
compileSdkVersion 32
useLibrary 'org.apache.http.legacy'
defaultConfig {
applicationId "com.paramg"
minSdkVersion 22//18
targetSdkVersion 32
versionCode 32 // play stote 28
versionName "1.1.24" //1.1.20
multiDexEnabled true
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
// signingConfig signingConfigs.release
// signingConfig signingConfigs.release
}
buildTypes {
debug {
debuggable true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
release {
debuggable false
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
// signingConfig signingConfigs.release
}
}
dexOptions {
incremental true
javaMaxHeapSize "4g"
preDexLibraries true
dexInProcess = true
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_11
targetCompatibility JavaVersion.VERSION_11
}
configurations {
//noinspection DuplicatePlatformClasses
compile.exclude group: "org.apache.httpcomponents", module: "httpclient"
}
packagingOptions {
exclude 'META-INF/DEPENDENCIES'
exclude 'META-INF/LICENSE'
exclude 'META-INF/LICENSE.txt'
exclude 'META-INF/license.txt'
exclude 'META-INF/NOTICE'
exclude 'META-INF/NOTICE.txt'
exclude 'META-INF/notice.txt'
exclude 'META-INF/ASL2.0'
exclude 'META-INF/core_release.kotlin_module'
exclude 'META-INF/services/javax.annotation.processing.Processor'
pickFirst 'META-INF/maven/com.squareup.okhttp3/okhttp/pom.properties'
pickFirst 'META-INF/maven/com.squareup.okhttp3/okhttp/pom.xml'
exclude 'META-INF/DEPENDENCIES.txt'
exclude 'META-INF/dependencies.txt'
exclude 'META-INF/LGPL2.1'
}
repositories {
maven {
google()
jcenter()
url "https://mint.splunk.com/gradle/"
}
flatDir {
dirs 'libs'
}
}
lintOptions {
checkReleaseBuilds false
disable 'InvalidPackage'
abortOnError false
}
kotlinOptions {
jvmTarget = "1.8"
}
def version = "1.0.5"
publish {
userOrg = 'shinhyo'
groupId = 'com.wonshinhyo'
artifactId = 'dragrecyclerview'
publishVersion = version
website = 'https://github.com/adearya69/DragRecyclerView'
issueTracker = "${website}/issues"
repository = "${website}.git"
}
}
dependencies {
// implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
testImplementation 'junit:junit:4.13.2'
implementation 'androidx.appcompat:appcompat:1.4.1'
implementation 'androidx.annotation:annotation:1.3.0'
implementation 'com.google.android.material:material:1.6.0'
implementation 'com.squareup.picasso:picasso:2.71828'
implementation 'androidx.multidex:multidex:2.0.1'
implementation 'de.hdodenhof:circleimageview:3.1.0'
implementation 'com.jakewharton:butterknife:10.2.3'
annotationProcessor 'com.jakewharton:butterknife-compiler:10.2.3'
implementation 'com.flurry.android:analytics:12.4.0#aar'
implementation 'com.github.jgabrielfreitas:BlurImageView:1.0.1'
implementation 'pl.droidsonroids.gif:android-gif-drawable:1.2.24'
implementation 'com.google.apis:google-api-services-youtube:v3-rev181-1.22.0'
implementation 'androidx.lifecycle:lifecycle-extensions:2.9.0'
implementation "android.arch.lifecycle:viewmodel:$archLifecycleVersion"
implementation 'com.squareup.retrofit2:retrofit:2.9.0'
implementation 'com.squareup.retrofit2:adapter-rxjava2:2.9.0'
implementation "com.squareup.retrofit2:converter-gson:2.9.0"
implementation "com.squareup.okhttp3:okhttp:4.2.2"
implementation "com.squareup.okhttp3:logging-interceptor:4.2.2"
implementation "com.google.code.gson:gson:2.8.9"
// implementation project(':countrycodepicker')
implementation 'com.github.takusemba:multisnaprecyclerview:1.3.4'
implementation 'com.splunk.mint:mint:4.4.0'
implementation "androidx.core:core-ktx:1.7.0"
implementation "androidx.lifecycle:lifecycle-viewmodel-ktx:2.4.1"
implementation 'com.github.bumptech.glide:glide:4.13.2'
implementation 'com.github.jgabrielfreitas:BlurImageView:1.0.1'
implementation files('libs/YouTubeAndroidPlayerApi.jar')
implementation("com.google.android.gms:play-services-gcm:17.0.0") {
exclude group: "com.google.android.gms"
}
// implementation 'com.google.android.gms:play-services:12.0.0'
implementation 'com.google.firebase:firebase-core:21.0.0'
implementation 'com.google.firebase:firebase-auth:21.0.4'
implementation 'com.google.firebase:firebase-messaging:23.0.5'
implementation 'com.google.android.gms:play-services-safetynet:18.0.1'
// implementation project(':folioreader')
implementation 'com.android.support:multidex:1.0.3'
implementation 'com.android.volley:volley:1.2.1'
implementation 'com.github.barteksc:android-pdf-viewer:2.8.2'
implementation 'com.pierfrancescosoffritti.androidyoutubeplayer:core:11.0.1'
implementation "com.fasterxml.jackson.core:jackson-core:2.11.1"
implementation "com.fasterxml.jackson.core:jackson-annotations:2.11.1"
implementation "com.fasterxml.jackson.core:jackson-databind:2.11.1"
implementation "com.fasterxml.jackson.module:jackson-module-kotlin:2.11.1"
implementation 'com.tomergoldst.android:tooltips:1.0.10'
//progressBar error solve
configurations.matching { it.name == '_internal_aapt2_binary' }.all { config ->
config.resolutionStrategy.eachDependency { details ->
details.useVersion("3.3.2-5309881")
}
}
implementation 'com.github.chrisbanes:PhotoView:2.0.0'
//for auto read otp in android
implementation 'com.google.android.gms:play-services-base:18.0.1'
implementation 'com.google.android.gms:play-services-auth-api-phone:18.0.1'
implementation 'com.google.android.gms:play-services-location:19.0.1'
implementation 'androidx.viewpager2:viewpager2:1.1.0-beta01'
implementation 'com.google.android.material:material:1.7.0-alpha01'
implementation 'com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava'
implementation platform('com.google.firebase:firebase-bom:25.12.0')
implementation 'com.google.firebase:firebase-dynamic-links'
implementation 'com.google.firebase:firebase-analytics'
implementation 'com.google.android.gms:play-services-location:19.0.1'
implementation 'com.google.android.gms:play-services-maps:18.0.2'
implementation 'com.google.firebase:firebase-crashlytics:18.2.10'
implementation 'com.google.firebase:firebase-analytics:21.0.0'
implementation 'com.google.android.play:core:1.10.3'
implementation 'com.github.SanojPunchihewa:InAppUpdater:1.0.5'
implementation 'com.google.firebase:firebase-config-ktx:21.1.0'
implementation 'com.github.shts:StoriesProgressView:3.0.0'
implementation 'com.github.3llomi:CircularStatusView:V1.0.2'
implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-core:1.6.1'
implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-android:1.6.1'
implementation 'com.google.api-client:google-api-client-android:1.23.0' exclude module: 'httpclient'
implementation 'com.google.http-client:google-http-client-gson:1.23.0' exclude module: 'httpclient'
implementation "androidx.lifecycle:lifecycle-common-java8:2.4.1"
implementation 'androidx.lifecycle:lifecycle-extensions:2.2.0'
annotationProcessor 'androidx.lifecycle:lifecycle-compiler:2.4.1'
implementation 'org.apache.httpcomponents:httpclient:4.5.9'
implementation fileTree(dir: "libs", include: ["*.aar"])
implementation fileTree(include: ['*.jar'], dir: 'libs')
}
afterEvaluate {
publishing {
publications {
release(MavenPublication) {
from components.release
groupId = "com.wwdablu"
artifactId = "guidededittext"
version = '1.0.0'
}
}
}
}
apply plugin: 'com.google.gms.google-services'
//apply plugin: 'com.google.firebase.crashlytics'
googleServices { disableVersionCheck = true }
Project level build.gradle file:
ext{
compileSdk = 29
targetSdk = 29
minSdk = 22
androidXLibsVersion = "1.0.0-alpha3"
constraintLayoutVersion = "2.0.0-alpha2"
archLifecycleVersion = "2.0.0"
playServicesVersion = "12.0.0"
playServicesVersion1 = "12.0.0"
playServicesVersion2 = "12.0.0"
compileSDKVersion = "28.0.0"
rxAndroidVersion = "2.1.0"
playServicesVersion1 = "12.0.0"
playServicesVersion2 = "12.0.0"
okhttpVersion = "3.11.0"
gsonVersion = "2.8.0"
rxJavaVersion = "2.2.2"
retrofitVersion = "2.4.0"
androidBuildToolsVersion = "29.0.0"
androidMinSdkVersion = 22
androidTargetSdkVersion = 29
androidCompileSdkVersion = 29
appCompatVersion = "1.1.0-alpha01"
materialDesignVersion = "1.1.0-alpha02"
butterKnifeVersion = "10.0.0"
retrofit = "2.5.0"
jackson = "2.9.7"
gson = "2.8.5"
kotlin = "1.3.11"
}
buildscript {
apply from: 'versions.gradle'
ext.kotlinVersion = '1.6.10'
repositories {
google()
maven { url "https://jitpack.io" }
mavenCentral()
}
dependencies {
classpath 'com.google.dagger:hilt-android-gradle-plugin:2.38.1'
classpath fileTree(dir: 'build-libs', include: '*.jar')
classpath 'com.google.gms:google-services:4.3.10'
classpath 'com.android.tools.build:gradle:7.2.0'
classpath "com.novoda:bintray-release:0.9.2"
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVersion"
classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.8.5'
classpath 'com.github.dcendents:android-maven-gradle-plugin:2.1'
classpath 'com.jakewharton:butterknife-gradle-plugin:10.2.3'
classpath 'com.android.tools.build.jetifier:jetifier-processor:1.0.0-beta10'
}
}
allprojects {
repositories {
mavenCentral()
google()
maven { url 'https://jitpack.io' }
mavenLocal()
mavenCentral()
jcenter()
}
tasks.withType(Javadoc).all {
enabled = false
}
}
subprojects {
project.configurations.all {
resolutionStrategy.force "com.squareup.okhttp3:okhttp:${okhttpVersion}"
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}

Gradle invoking different tasks for each subproject

I have the following set up:
Project
spring boot app
java classes that are packaged into a jar
android project
app module of the android project
I am trying to set up gradle build so that i get runnable spring boot jar application, java jar library that is installed in the local maven repo and an apk file for the android.
To get an apk file I need to run assembleDebug task
To publish java ibrary I need to run publish task
To get spring executable I need to run compileJave task
Question is what task to run on the top level root gradel.build file to get different tasks accomplished?
root gradle:
allprojects {
task hello << { task -> println "I'm $task.project.name" }
}
subprojects {
repositories {
mavenCentral()
jcenter()
}
}
Spring Boot gradle:
apply plugin: 'java'
apply plugin: 'eclipse'
apply plugin: 'org.springframework.boot'
defaultTasks 'clean', 'build'
buildscript {
ext {
springBootVersion = '1.5.1.RELEASE'
}
repositories {
mavenCentral()
}
dependencies {
classpath("org.springframework.boot:spring-boot-gradle- plugin:${springBootVersion}")
}
}
jar {
baseName = 'demo'
version = '0.0.1-SNAPSHOT'
}
sourceCompatibility = 1.8
repositories {
mavenCentral()
}
dependencies {
compile('org.springframework.boot:spring-boot-starter-security')
compile('org.springframework.boot:spring-boot-starter-web')
compile('org.springframework.boot:spring-boot-starter-data-jpa')
compile('io.jsonwebtoken:jjwt:0.7.0')
compile('mysql:mysql-connector-java:6.0.5')
testCompile('org.springframework.boot:spring-boot-starter-test')
}
Java Proj gradle:
jar {
baseName = 'commonobjects'
version = "0.0.1-SNAPSHOT"
}
sourceCompatibility = 1.8
targetCompatibility = 1.8
dependencies {
testCompile group: 'junit', name: 'junit', version: '4.11'
}
Android Proj gradle:
buildscript {
repositories {
jcenter()
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.2.3'
}
}
Android App gradle:
def ANDROID_SUPPORT_DEPENDENCY_VERSION = '25.1.0'
def DAGGER_DEPENDENCY_VERSION = '2.8'
def OK_HTTP_DEPENDENCY_VERSION = '3.5.0'
def RETROFIT_DEPENDENCY_VERSION = '2.1.0'
def RETROFIT_JACKSON_DEPENDENCY_VERSION = '2.1.0'
def BUTTER_KNIFE_DEPENDENCY_VERSION = '8.5.1'
def JAVAX_ANNOTATION_JSR250_API_DEPENDENCY_VERSION = '1.0'
def GREEN_ROBOT_EVENT_BUS_DEPENDENCY_VERSION = '3.0.0'
def RX_JAVA_DEPENDENCY_VERSION = '2.0.5'
def RX_ANDROID_JAVA_DEPENDENCY_VERSION = '2.0.1'
defaultTasks 'clean', 'assembleDebug'
buildscript {
repositories {
mavenCentral()
jcenter()
maven {
url "https://plugins.gradle.org/m2/"
}
}
dependencies {
classpath "net.ltgt.gradle:gradle-apt-plugin:0.9"
}
}
repositories {
jcenter()
mavenCentral()
}
apply plugin: "com.android.application"
apply plugin: 'idea'
android {
compileSdkVersion 25
buildToolsVersion "25.0.1"
defaultConfig {
applicationId "..."
minSdkVersion 14
targetSdkVersion 25
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
// debug {
// buildConfigField "String", "PARSE_APPLICATION_ID", "\"1\""
// buildConfigField "String", "PARSE_API_KEY", "\"1\""
// }
release {
minifyEnabled true
proguardFiles "android-proguard-android.txt", "proguard-rules.txt"
// buildConfigField "String", "PARSE_APPLICATION_ID", "\"1\""
// buildConfigField "String", "PARSE_API_KEY", "\"1\""
}
}
packagingOptions {
pickFirst 'META-INF/LICENSE'
}
}
dependencies {
// Add jars supplied
compile fileTree(dir: 'libs', include: ['*.jar'])
// Test related
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
testCompile 'junit:junit:4.12'
androidTestCompile "com.android.support:support-annotations:${ANDROID_SUPPORT_DEPENDENCY_VERSION}"
androidTestCompile "com.android.support.test:runner:0.5"
// Android support libraries
compile "com.android.support:appcompat-v7:${ANDROID_SUPPORT_DEPENDENCY_VERSION}"
compile "com.android.support:design:${ANDROID_SUPPORT_DEPENDENCY_VERSION}"
compile "com.android.support:support-annotations:${ANDROID_SUPPORT_DEPENDENCY_VERSION}"
// An HTTP & HTTP/2 client for Android and Java applications
compile "com.squareup.okhttp3:okhttp:${OK_HTTP_DEPENDENCY_VERSION}"
// Retrofit: A type-safe HTTP client for Android and Java
compile "com.squareup.retrofit2:retrofit:${RETROFIT_DEPENDENCY_VERSION}"
compile "com.squareup.retrofit2:converter-jackson:${RETROFIT_JACKSON_DEPENDENCY_VERSION}"
// Butterknife: Field and method binding for Android views
compile "com.jakewharton:butterknife:${BUTTER_KNIFE_DEPENDENCY_VERSION}"
annotationProcessor "com.jakewharton:butterknife-compiler:${BUTTER_KNIFE_DEPENDENCY_VERSION}"
// Dagger DI
compile "com.google.dagger:dagger:${DAGGER_DEPENDENCY_VERSION}"
annotationProcessor "com.google.dagger:dagger-compiler:${DAGGER_DEPENDENCY_VERSION}"
provided "javax.annotation:jsr250-api:${JAVAX_ANNOTATION_JSR250_API_DEPENDENCY_VERSION}"
// Event bus
compile "org.greenrobot:eventbus:${GREEN_ROBOT_EVENT_BUS_DEPENDENCY_VERSION}"
// RxJava a library for composing asynchronous and event-based programs by using observable sequences.
compile "io.reactivex.rxjava2:rxjava:${RX_JAVA_DEPENDENCY_VERSION}"
compile "io.reactivex.rxjava2:rxandroid:${RX_ANDROID_JAVA_DEPENDENCY_VERSION}"
}
You can simply create your task that will depend on three different tasks. It's possible to have dependencies across subprojects as well:
task myAllTask {
}
myAllTask.dependsOn assembleDebug, publish, compileJava
For running tasks from subprojects:
myAllTask.dependsOn ':bootProj:assembleDebug', ':javaProj:publish', ':androidProj:compileJava

DuplicateFileException in apk build using Kotlin

I am trying to build a basic app using Kotlin/Anko but I am getting the following duplicate file exception
Execution failed for task
':app:transformResourcesWithMergeJavaResForDebug'.>
com.android.build.api.transform.TransformException:
com.android.builder.packaging.DuplicateFileException: Duplicate files
copied in APK kotlin/internal/internal.kotlin_builtins File1:
C:\Users\mahesh.gradle\caches\modules-2\files-2.1\org.jetbrains.kotlin\kotlin-runtime\1.0.6.\3562c66f648480d3bd4f76cff722488ced13445b\kotlin-runtime-1.0.6.jar File2:
C:\Users\mahesh.gradle\caches\modules-2\files-2.1\org.jetbrains.kotlin\kotlin-compiler-embeddable\1.0.6\4008eb91a337b377dae7e4572b8b543e5321f549\kotlin-compiler-embeddable-1.0.6.jar
Following is the code for the app level gradle file:
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
buildscript {
ext.kotlin_version = '1.0.6'
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.2.3'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
}
}
repositories {
jcenter()
}
android {
compileSdkVersion 23
buildToolsVersion "23.0.2"
defaultConfig {
applicationId "com.example.kotlin.androdikotlinexample"
minSdkVersion 15
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.1.1'
compile 'com.android.support:design:23.1.1'
//kotlin
compile "org.jetbrains.kotlin:kotlin-android-extensions:$kotlin_version"
compile "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
//anko
compile "org.jetbrains.anko:anko-design:0.8.3"
compile "org.jetbrains.anko:anko-support-v4:0.8.3"
compile "org.jetbrains.anko:anko-sdk15:0.8.3"
compile 'org.jetbrains.anko:anko-appcompat-v7:0.8.3'
}
Following is the code for Project level gradle file:
buildscript {
ext.kotlin_version = '1.0.6'
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.2.3'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
// 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
}
And this is the basic code for the MainUI file
class MainUI : AnkoComponent<MainActivityKotlin> {
override fun createView(ui: AnkoContext<MainActivityKotlin>): View = with(ui) {
coordinatorLayout {
verticalLayout {
// maybe put some content here
}
floatingActionButton {
imageResource = android.R.drawable.ic_menu_edit
onClick {
ui.owner.startActivityForResult<MainActivityKotlin>(1)
}
}.lparams {
gravity = Gravity.BOTTOM or Gravity.END
}
}
}
}
And the content is set on MainActivityKotlin file using the method MainUI().setContentView(this) in its onCreatemethod.
I have tried deleting the gradle cache and building the project again but nothing works. Please let me know where am I going wrong?
Remove compile "org.jetbrains.kotlin:kotlin-android-extensions:$kotlin_version" from your gradle
Remove also all buildscript section from you app level gradle
Try this one:
compile "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
compile ("org.jetbrains.kotlin:kotlin-android-extensions:$kotlin_version") {
transitive = false
}
Also you don't need the android-extensions dependency anymore, as it's bundled into the plugin. Just having the apply plugin: 'kotlin-android-extensions' in your gradle is enough.

app:transformClassesWithMultidexlistForDebugAndroidTest error when running instrumental test

I'm trying to put my finger in android functional testing. Making a first easy Application test case as the following :
public class ApplicationTest extends ApplicationTestCase<App> {
private App myApp;
public ApplicationTest() {
super(App.class);
}
protected void setUp() throws Exception {
super.setUp();
createApplication();
myApp = getApplication();
}
public void testCorrectVersion() throws Exception {
PackageInfo info = myApp.getPackageManager().getPackageInfo(myApp.getPackageName(), 0);
assertNotNull(info);
MoreAsserts.assertMatchesRegex("\\d\\.\\d", info.versionName);
}
}
I just run it with left click and then click on green arrow "Run
Application"
I selected "Debug" variant
And the test Artifact "Android Instrumental Test"
I have "Geny Motion", and want to run the test with it.
Gradle sync well
=> but I run the test case, I get the following error at the end :
:app:transformClassesWithMultidexlistForDebugAndroidTest FAILED
Error:Execution failed for task ':app:transformClassesWithMultidexlistForDebugAndroidTest'.
com.android.build.api.transform.TransformException: com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command '/Library/Java/JavaVirtualMachines/jdk1.7.0_75.jdk/Contents/Home/bin/java'' finished with non-zero exit value 1
Here is my app gradle file :
apply plugin: 'com.android.application'
apply plugin: 'com.google.gms.google-services'
android {
signingConfigs {
release {
if (System.getenv()["CI"]) { // CI=true is exported by Greenhouse
storeFile file(System.getenv()["GH_KEYSTORE_PATH"])
storePassword System.getenv()["GH_KEYSTORE_PASSWORD"]
keyAlias System.getenv()["GH_KEY_ALIAS"]
keyPassword System.getenv()["GH_KEY_PASSWORD"]
} else {
release
}
}
}
compileSdkVersion ANDROID_BUILD_SDK_VERSION
buildToolsVersion ANDROID_BUILD_TOOLS_VERSION
defaultConfig {
applicationId "fr.millezimsolutions.app.millezimu"
targetSdkVersion ANDROID_BUILD_TARGET_SDK_VERSION
minSdkVersion ANDROID_BUILD_MIN_SDK_VERSION
versionCode ANDROID_BUILD_VERSION_CODE
versionName ANDROID_BUILD_APP_VERSION_NAME
multiDexEnabled true
}
buildTypes {
release {
debuggable false
renderscriptOptimLevel 3
signingConfig android.signingConfigs.release
zipAlignEnabled true
minifyEnabled true
shrinkResources true
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro', 'proguard-rules-new.pro'
}
debug {
debuggable true
renderscriptOptimLevel 3
applicationIdSuffix ".debug"
versionNameSuffix "debug"
}
}
configurations{
all*.exclude group: 'cglib'
all*.exclude group: 'commons-collections'
}
dexOptions {
incremental false
preDexLibraries = false
jumboMode = true
javaMaxHeapSize "4g"
}
packagingOptions {
exclude 'META-INF/LICENSE.txt'
exclude 'META-INF/NOTICE.txt'
exclude 'META-INF/LICENSE'
exclude 'META-INF/NOTICE'
exclude 'META-INF/LICENSE-FIREBASE.txt'
exclude 'META-INF/INDEX.LIST'
exclude 'LICENSE.txt'
exclude 'NOTICE'
exclude 'META-INF/DEPENDENCIES'
exclude 'META-INF/license.txt'
exclude 'META-INF/notice.txt'
exclude 'META-INF/ASL2.0'
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_7
targetCompatibility JavaVersion.VERSION_1_7
}
useLibrary 'org.apache.http.legacy'
configurations.all {
resolutionStrategy.force 'com.google.code.gson:gson:2.5'
resolutionStrategy.force 'com.google.guava:guava:19.0'
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
// SUPPORT
compile 'com.android.support:appcompat-v7:23.1.1'
// WORKERS
compile 'de.greenrobot:eventbus:2.4.1'
compile 'com.nostra13.universalimageloader:universal-image-loader:1.9.5'
// SOCIAL NETWORK
compile 'org.twitter4j:twitter4j-core:4.0.4'
compile 'com.facebook.android:facebook-android-sdk:4.8.2'
// TEST
//testCompile 'org.robolectric:robolectric:3.0'
//testCompile "org.robolectric:robolectric:3.0"
testCompile 'junit:junit:4.+'
androidTestCompile 'junit:junit:4.+'
androidTestCompile 'io.appium:java-client:3.3.0'
androidTestCompile 'org.apache.commons:commons-lang3:3.4'
androidTestCompile 'com.google.code.gson:gson:2.5'
// Set this dependency if you want to use the Hamcrest matcher library
testCompile 'org.hamcrest:hamcrest-library:1.3'
// MULTIDEX
compile 'com.android.support:multidex:1.0.1'
// VIEW
compile 'com.android.support:design:23.1.1'
compile 'de.hdodenhof:circleimageview:2.0.0'
compile 'me.relex:circleindicator:1.1.7#aar'
compile 'com.lsjwzh:recyclerviewpager:1.0.8'
compile 'pl.droidsonroids.gif:android-gif-drawable:1.1.11'
compile('com.afollestad.material-dialogs:core:0.8.5.3#aar') {
transitive = true
}
compile project(':MaterialWidget')
compile project(':MultiHeaderRecyclerView')
compile 'com.android.support:cardview-v7:23.1.1'
compile 'me.zhanghai.android.materialprogressbar:library:1.1.4'
// TEXT
compile 'uk.co.chrisjenx:calligraphy:2.1.0'
compile 'com.github.bluejamesbond:textjustify-android:2.1.1'
// FIREBASE
compile 'com.firebaseui:firebase-ui:0.3.0'
compile 'com.firebase:geofire:1.1.1'
compile('com.firebase:firebase-client-android:2.5.0') {
exclude module: 'httpclient'
}
// UTILS
compile 'com.google.code.gson:gson:2.5'
// compile 'me.dm7.barcodescanner:zbar:1.6.3'
compile('com.google.http-client:google-http-client-jackson:1.21.0') {
exclude module: 'xpp3'
exclude group: 'stax'
}
compile 'org.apache.commons:commons-lang3:3.4'
// OAUTH
compile 'com.google.oauth-client:google-oauth-client-java6:1.21.0'
// TIME
compile 'joda-time:joda-time:2.9.1'
compile 'org.ocpsoft.prettytime:prettytime:4.0.1.Final'
// AMAZON WS
compile 'com.amazonaws:aws-android-sdk-core:2.2.9'
compile 'com.amazonaws:aws-android-sdk-cognito:2.2.9'
compile 'com.amazonaws:aws-android-sdk-s3:2.2.9'
// GOOGLE
compile 'com.google.android.gms:play-services:8.3.0'
// RATING STORE
compile project(':AppRate')
// DEBUG
compile 'com.github.brianPlummer:tinydancer:0.0.9'
compile 'com.splunk.mint:mint:4.4.0'
compile 'com.google.android.gms:play-services-analytics:8.3.0'
// debugCompile 'com.squareup.leakcanary:leakcanary-android:1.3.1'
// releaseCompile 'com.squareup.leakcanary:leakcanary-android-no-op:1.3.1'
compile 'com.squareup.leakcanary:leakcanary-android-no-op:1.3.1'
}
if (!System.getenv()["CI"]) {
// Routine pour acceder aux clés de signature
def Properties props = new Properties()
def propFile = file('../../signing.properties')
if (propFile.canRead()) {
props.load(new FileInputStream(propFile))
if (props != null && props.containsKey('STORE_FILE') && props.containsKey('STORE_PASSWORD') &&
props.containsKey('KEY_ALIAS') && props.containsKey('KEY_PASSWORD')) {
android.signingConfigs.release.storeFile = file(props['STORE_FILE'])
android.signingConfigs.release.storePassword = props['STORE_PASSWORD']
android.signingConfigs.release.keyAlias = props['KEY_ALIAS']
android.signingConfigs.release.keyPassword = props['KEY_PASSWORD']
} else {
android.buildTypes.release.signingConfig = null
}
} else {
android.buildTypes.release.signingConfig = null
}
}
println(getVersion().toString())
}
And here is the project gradle file :
buildscript {
repositories {
jcenter()
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.0.0-alpha3'
classpath 'com.google.gms:google-services:1.5.0-beta2'
classpath 'com.github.ben-manes:gradle-versions-plugin:0.11.3'
}
}
allprojects {
repositories {
jcenter()
mavenCentral()
maven {
url "https://jitpack.io"
}
maven {
url 'https://oss.sonatype.org/content/repositories/snapshots/'
}
maven {
url "https://mint.splunk.com/gradle/"
}
}
}
ext {
ANDROID_BUILD_MIN_SDK_VERSION = 16
ANDROID_BUILD_TARGET_SDK_VERSION = 23
ANDROID_BUILD_TOOLS_VERSION = "23.0.1"
ANDROID_BUILD_SDK_VERSION = 23
ANDROID_BUILD_VERSION_CODE = getAppVersionCode()
ANDROID_BUILD_APP_VERSION_NAME = getAppUVersionName()
ANDROID_DEFAULT_BUILD_VERSION_CODE = "24"
ANDROID_DEFAULT_BUILD_APP_VERSION_NAME = 0.4
}
apply plugin: 'com.github.ben-manes.versions'
I'look around for a while, but very difficult to see what it could be.

Error : app:dexDebug finished with non-zero exit value 1

Error:Execution failed for task ':app:dexDebug'.
com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command 'C:\Program Files\Java\jdk1.7.0_51\bin\java.exe'' finished with non-zero exit value 1
hello i get this error, which i have no idea how to fix.
these are my gradles:
app gradle:
apply plugin: 'com.android.application'
android {
compileSdkVersion 22
buildToolsVersion "23.0.0 rc2"
defaultConfig {
applicationId "com.example.daniel.testing6"
minSdkVersion 15
targetSdkVersion 22
versionCode 1
versionName "1.0"
multiDexEnabled true
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
//compile fileTree(dir: 'libs', include: ['*.jar'])
compile project(path: ':backend', configuration: 'android-endpoints')
//configurations { all*.exclude group: 'com.android.support', module: 'support-v4' }
compile 'com.android.support:appcompat-v7:22.2.1'
compile 'com.google.android.gms:play-services:8.1.0'
compile 'com.android.support:multidex:1.0.0'
compile 'com.android.support:design:22.2.1'
}
backend gradle:
// If you would like more information on the gradle-appengine-plugin please refer to the github page
// https://github.com/GoogleCloudPlatform/gradle-appengine-plugin
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.google.appengine:gradle-appengine-plugin:1.9.18'
}
}
repositories {
jcenter();
}
apply plugin: 'java'
apply plugin: 'war'
apply plugin: 'appengine'
sourceCompatibility = JavaVersion.VERSION_1_7
targetCompatibility = JavaVersion.VERSION_1_7
dependencies {
appengineSdk 'com.google.appengine:appengine-java-sdk:1.9.18'
compile 'com.google.appengine:appengine-endpoints:1.9.18'
compile 'com.google.appengine:appengine-endpoints-deps:1.9.18'
compile 'javax.servlet:servlet-api:2.5'
compile 'com.googlecode.objectify:objectify:4.0b3'
compile 'com.ganyo:gcm-server:1.0.2'
}
appengine {
downloadSdk = true
appcfg {
oauth2 = true
}
endpoints {
getClientLibsOnBuild = true
getDiscoveryDocsOnBuild = true
}
}
project gradle:
// 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.2.3'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
jcenter()
}
}
does any one know how to fix it???

Categories

Resources