Android studio minify enabled = true , not able to generate apk? - android

apply plugin: 'com.android.application'
apply plugin: 'com.neenbedankt.android-apt'
apply plugin: 'me.tatarka.retrolambda'
apply plugin: 'com.google.gms.google-services'
apply plugin: 'realm-android'
android {
compileSdkVersion 23
buildToolsVersion "23.0.3"
defaultPublishConfig "debug"
defaultConfig {
applicationId "com.youth4work.ibps"
minSdkVersion 16
targetSdkVersion 23
multiDexEnabled true
versionCode 1
versionName "1.0.0"
}
signingConfigs {
release {
storeFile file('keystore/youth4work_second_key')
keyAlias 'youth4work_second_key_alias'
keyPassword "youth4work"
storePassword "youth4work"
}
debug {
storeFile file('keystore/debug.keystore')
keyAlias 'androiddebugkey'
storePassword 'android'
keyPassword 'android'
}
}
buildTypes {
release {
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
debug {
versionNameSuffix "Debug"
debuggable true
}
}
lintOptions {
disable 'InvalidPackage'
checkReleaseBuilds false
}
packagingOptions {
exclude 'META-INF/services/javax.annotation.processing.Processor'
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
}
retrolambda {
jvmArgs '-noverify'
}
dependencies {
final PLAY_SERVICES_VERSION = '8.3.0'
final SUPPORT_LIBRARY_VERSION = '23.3.0'
// Google Play Services
compile "com.google.android.gms:play-services-base:$PLAY_SERVICES_VERSION"
compile "com.google.android.gms:play-services- analytics:$PLAY_SERVICES_VERSION"
compile "com.google.android.gms:play-services-gcm:$PLAY_SERVICES_VERSION"
compile "com.google.android.gms:play-services-plus:$PLAY_SERVICES_VERSION"
// Support Libraries
compile "com.android.support:support-v4:$SUPPORT_LIBRARY_VERSION"
compile "com.android.support:appcompat-v7:$SUPPORT_LIBRARY_VERSION"
compile "com.android.support:recyclerview-v7:$SUPPORT_LIBRARY_VERSION"
compile "com.android.support:cardview-v7:$SUPPORT_LIBRARY_VERSION"
compile "com.android.support:design:$SUPPORT_LIBRARY_VERSION"
compile 'com.android.support:support-annotations:23.3.0'
compile 'com.squareup.picasso:picasso:2.5.2'
compile 'com.squareup.okhttp3:okhttp:3.2.0'
compile 'com.squareup.okhttp3:logging-interceptor:3.2.0'
compile 'com.squareup.retrofit2:retrofit:2.0.2'
compile 'com.squareup.retrofit2:converter-gson:2.0.2'
compile 'com.squareup.retrofit2:adapter-rxjava:2.0.2'
compile 'com.jakewharton:butterknife:7.0.1'
compile 'com.jakewharton.timber:timber:4.1.0'
compile 'com.jakewharton.rxbinding:rxbinding:0.4.0'
compile 'com.github.siyamed:android-shape-imageview:0.9.+#aar'
compile 'com.github.kevinsawicki:timeago:1.0.1'
compile 'com.facebook.android:facebook-android-sdk:4.8.2'
compile 'com.rengwuxian.materialedittext:library:2.1.4'
compile 'com.mobsandgeeks:android-saripaar:2.0.2'
compile 'com.joanzapata.iconify:android-iconify-fontawesome:2.1.1'
compile 'com.github.jakob-grabner:Circle-Progress-View:1.2.8'
compile 'com.github.vlonjatg:progress-activity:v1.0.3'
compile 'com.github.PhilJay:MPAndroidChart:v2.2.4'
compile 'com.daasuu:animateHorizontalProgressBar:0.2.2'
compile 'io.reactivex:rxjava:1.1.0'
compile 'io.reactivex:rxandroid:1.1.0'
compile 'com.trello:rxlifecycle:0.4.0'
compile 'com.trello:rxlifecycle-components:0.4.0'
compile('com.github.afollestad.material-dialogs:core:0.8.5.6#aar') {
transitive = true
}
compile('com.mikepenz:fastadapter:1.4.0#aar') {
transitive = true
}
testCompile 'junit:junit:4.12'
}
// Log out test results to console
tasks.matching { it instanceof Test }.all {
testLogging.events = ["failed", "passed", "skipped"]
}
here if i make minify enabled = false the code runs fine while if i use true the code shows
Information:Gradle tasks [:app:assembleRelease] google-services plugin
could not detect any version for com.google.android.gms, default
version: 8.3.0 will be used. please apply google-services plugin at
the bottom of the build file. :app:preBuild UP-TO-DATE
:app:preReleaseBuild UP-TO-DATE :app:checkReleaseManifest
:app:preDebugBuild UP-TO-DATE
:app:prepareComAndroidSupportAnimatedVectorDrawable2330Library
UP-TO-DATE :app:prepareComAndroidSupportAppcompatV72330Library
UP-TO-DATE :app:prepareComAndroidSupportCardviewV72330Library
UP-TO-DATE :app:prepareComAndroidSupportDesign2330Library UP-TO-DATE
:app:prepareComAndroidSupportMultidex101Library UP-TO-DATE
:app:prepareComAndroidSupportRecyclerviewV72330Library UP-TO-DATE
:app:prepareComAndroidSupportSupportV42330Library UP-TO-DATE
:app:prepareComAndroidSupportSupportVectorDrawable2330Library
UP-TO-DATE :app:prepareComDaasuuAnimateHorizontalProgressBar022Library
UP-TO-DATE :app:prepareComFacebookAndroidFacebookAndroidSdk482Library
UP-TO-DATE
:app:prepareComGithubAfollestadMaterialDialogsCore0856Library
UP-TO-DATE
:app:prepareComGithubJakobGrabnerCircleProgressView128Library
UP-TO-DATE :app:prepareComGithubSiyamedAndroidShapeImageview093Library
UP-TO-DATE :app:prepareComGithubVlonjatgProgressActivityV103Library
UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesAnalytics830Library
UP-TO-DATE :app:prepareComGoogleAndroidGmsPlayServicesBase830Library
UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesBasement830Library
UP-TO-DATE :app:prepareComGoogleAndroidGmsPlayServicesGcm830Library
UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesMeasurement830Library
UP-TO-DATE :app:prepareComGoogleAndroidGmsPlayServicesPlus830Library
UP-TO-DATE :app:prepareComJakewhartonRxbindingRxbinding040Library
UP-TO-DATE :app:prepareComJakewhartonTimberTimber410Library UP-TO-DATE
:app:prepareComJoanzapataIconifyAndroidIconify211Library UP-TO-DATE
:app:prepareComJoanzapataIconifyAndroidIconifyFontawesome211Library
UP-TO-DATE :app:prepareComMikepenzFastadapter140Library UP-TO-DATE
:app:prepareComRengwuxianMaterialedittextLibrary214Library UP-TO-DATE
:app:prepareComTrelloRxlifecycle040Library UP-TO-DATE
:app:prepareComTrelloRxlifecycleComponents040Library UP-TO-DATE
:app:prepareIoReactivexRxandroid110Library UP-TO-DATE
:app:prepareIoRealmRealmAndroidLibrary0883Library UP-TO-DATE
:app:prepareMeZhanghaiAndroidMaterialprogressbarLibrary114Library
UP-TO-DATE :app:prepareReleaseDependencies :app:compileReleaseAidl
:app:compileReleaseRenderscript :app:generateReleaseBuildConfig
:app:generateReleaseAssets UP-TO-DATE :app:mergeReleaseAssets
:app:generateReleaseResValues UP-TO-DATE
:app:processReleaseGoogleServices :app:generateReleaseResources
:app:mergeReleaseResources :app:processReleaseManifest
:app:processReleaseResources :app:generateReleaseSources
:app:compileReleaseJavaWithJavac Note: Some input files use or
override a deprecated API. Note: Recompile with -Xlint:deprecation for
details. Note: Some input files use unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
:app:compileRetrolambdaRelease :app:compileReleaseNdk UP-TO-DATE
:app:compileReleaseSources :app:prePackageMarkerForRelease
:app:transformClassesWithRealmTransformerForRelease
:app:processReleaseJavaRes UP-TO-DATE
:app:transformResourcesWithMergeJavaResForRelease
:app:transformClassesAndResourcesWithProguardForRelease assmember)
Warning:there were 1 unresolved references to library class members.
You probably need to update the library versions.
(http://proguard.sourceforge.net/manual/troubleshooting.html#unresolvedlibraryclassmember)
Warning:Exception while processing task java.io.IOException: Please
correct the above warnings first.
:app:transformClassesAndResourcesWithProguardForRelease FAILED
Error:Execution failed for task
':app:transformClassesAndResourcesWithProguardForRelease'.
java.io.IOException: Please correct the above warnings first. Information:BUILD FAILED Information:Total time: 27.946 secs
Information:1 error Information:91 warnings Information:See complete
output in console

If you enable minifying, the build will call Proguard to strip out every unnecessary classes, members and methods.
For this to work, you'll need a proguard config file, which will tell Proguard which classes are your entrypoint to your classes and which members and methods should be kept.
The error you are seeing is a common error for mismatching method calls.
The error includes a link to the Proguard manual, describing the error a bit more: you'll have to make sure that you are using the right Android Build Target and that you keep all necessary libs and their methods.
Try to adapt the Android Build Target in your properties. If this doesn't work, you'll have to check if you need more entries in your proguard config.

Related

When build in android studio i get error :app:processDebugResources

When I run Build - rebuild project I get the following error
I have tryed many sollution but nothing works..
What went wrong:
the error build code:
Executing tasks: [:app:generateDebugSources]
Configuration on demand is an incubating feature.
:app:preBuild UP-TO-DATE
:app:preDebugBuild UP-TO-DATE
:app:compileDebugAidl UP-TO-DATE
:app:compileDebugRenderscript UP-TO-DATE
:app:checkDebugManifest UP-TO-DATE
:app:generateDebugBuildConfig UP-TO-DATE
:app:prepareLintJar UP-TO-DATE
:app:mainApkListPersistenceDebug UP-TO-DATE
:app:generateDebugResValues UP-TO-DATE
:app:generateDebugResources UP-TO-DATE
:app:mergeDebugResources UP-TO-DATE
:app:createDebugCompatibleScreenManifests UP-TO-DATE
:app:processDebugManifest
:app:splitsDiscoveryTaskDebug UP-TO-DATE
AGPBI: {"kind":"error","text":"error: resource drawable/appiconlarge () not found.","sources":[{"file":"/home/.gradle/caches/transforms-1/files-1.1/appcompat-v7-25.3.1.aar/a9a8f29f5baeae5b590388a64347d1e6/res/values/values.xml","position":{"startLine":1362,"startColumn":4,"startOffset":99385,"endLine":1403,"endColumn":12,"endOffset":102566}}],"original":"","tool":"AAPT"}
:app:processDebugResources
error: failed linking references.
:app:processDebugResources FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:processDebugResources'.
> Failed to process resources, see aapt output above for details.
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
Build.gradle file
apply plugin: 'com.android.application'
android {
compileSdkVersion 25
buildToolsVersion '27.0.3'
defaultConfig {
applicationId "xxxx"
minSdkVersion 19
targetSdkVersion 24
versionCode 1
versionName "1.0"
testInstrumentationRunner
manifestPlaceholders = [auth0Domain:"#string/com_auth0_domain"]
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
androidTestImplementation('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
testImplementation 'junit:junit:4.12'
implementation 'de.hdodenhof:circleimageview:2.1.0'
implementation 'com.google.android.gms:play-services-maps:10.0.0'
implementation 'com.android.volley:volley:1.0.0'
implementation 'com.auth0.android:lock:2.7.0'
implementation 'com.android.support:cardview-v7:25.3.1'
implementation 'com.android.support:support-annotations:24.2.0'
implementation 'com.squareup.retrofit2:retrofit:2.3.0'
implementation 'com.squareup.retrofit2:converter-gson:2.3.0'
}
The main issue is
resource drawable/appiconlarge not found
Please check the drawable/appiconlarge file exists or not. If not please add appiconlarge image on the drawable directory.
Hope this will solve your problem.
Consider doing this, not sure it would remove the error but it helped in my case.
android.enableAapt2=true

Error when multiple libraries use diferent versions of the same external library in gradle

I'm facing some problems when updating the external libraries that my app uses. Here are the gradle files:
Project build.gradle:
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
ext.kotlin_version = '1.2.31'
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.1.1'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath 'com.google.gms:google-services:3.2.1'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
google()
jcenter()
maven { url "https://jitpack.io" }
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
ext {
daggerVersion = "2.13"
supportVersion = "27.1.1"
}
Application build.gradle
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
apply plugin: 'kotlin-kapt'
android {
compileSdkVersion 27
defaultConfig {
applicationId "com.myapp"
minSdkVersion 19
targetSdkVersion 27
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
// multiDexEnabled true
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation "org.jetbrains.kotlin:kotlin-stdlib-jre7:$kotlin_version"
implementation "com.android.support:appcompat-v7:$supportVersion"
implementation "com.android.support:cardview-v7:$supportVersion"
implementation "com.android.support:design:$supportVersion"
implementation "com.android.support:animated-vector-drawable:$supportVersion"
implementation "com.android.support:support-fragment:$supportVersion"
implementation 'com.android.support.constraint:constraint-layout:1.0.2'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.1'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1'
implementation 'com.google.firebase:firebase-core:12.0.1'
implementation 'com.google.firebase:firebase-auth:12.0.1'
implementation 'com.google.firebase:firebase-database:12.0.1'
implementation 'com.google.firebase:firebase-analytics:12.0.1'
// implementation 'com.android.support:multidex:1.0.3'
// Google Sign In SDK (only required for Google Sign In)
implementation 'com.google.android.gms:play-services-auth:12.0.1'
implementation 'com.hannesdorfmann.mosby3:mvp-lce:3.0.4'
implementation 'com.github.bumptech.glide:glide:4.6.1'
annotationProcessor 'com.github.bumptech.glide:compiler:4.6.1'
kapt 'com.github.bumptech.glide:compiler:4.6.1'
// Firebase UI
// Used in FirebaseUIActivity. The FirebaseUI-Android library has a minSdk level of 16
// so this library is only included in the minSdkJellybean variant.
implementation 'com.firebaseui:firebase-ui-auth:3.2.1'
// Facebook Android SDK (only required for Facebook Login)
// Used in FacebookLoginActivity. This is only compiled into the minSdkJellybean variant of this
// app. You can build a 'minSdkGingerbread' variant to test on devices with 9 <= SDK <= 15.
implementation 'com.facebook.android:facebook-login:4.31.0'
implementation "com.android.support:customtabs:$supportVersion"
// Twitter Android SDK (only required for Twitter Login)
// implementation('com.twitter.sdk.android:twitter-core:3.2.0#aar') {
// transitive = true
// }
// implementation('com.twitter.sdk.android:twitter:3.2.0#aar') {
// transitive = true
// }
implementation "org.jetbrains.kotlin:kotlin-reflect:$kotlin_version"
// Dagger
implementation "com.google.dagger:dagger:$rootProject.daggerVersion"
kapt "com.google.dagger:dagger-compiler:$rootProject.daggerVersion"
implementation "com.google.dagger:dagger-android:$rootProject.daggerVersion"
kapt "com.google.dagger:dagger-android-processor:$rootProject.daggerVersion"
implementation "com.google.dagger:dagger-android-support:$rootProject.daggerVersion"
// Room
implementation "android.arch.persistence.room:runtime:1.0.0"
kapt "android.arch.persistence.room:compiler:1.0.0"
implementation "android.arch.lifecycle:common-java8:1.1.1"
// RxJava
implementation 'io.reactivex.rxjava2:rxandroid:2.0.1'
implementation 'io.reactivex.rxjava2:rxjava:2.1.6'
// compile 'io.reactivex.rxjava2:rxkotlin:2.2.0'
// RxFirebase
implementation('com.github.b3er.rxfirebase:firebase-database:11.2.0') {
transitive = false
}
// // PhotoView
// implementation 'com.github.chrisbanes:PhotoView:2.1.3'
// ucrop
// implementation 'com.github.yalantis:ucrop:2.2.2'
}
apply plugin: 'com.google.gms.google-services'
But when I try to run the application I get the following error:
Executing tasks: [:app:assembleDebug]
Could not find google-services.json while looking in [src/nullnull/debug, src/debug/nullnull, src/nullnull, src/debug, src/nullnullDebug]
registerResGeneratingTask is deprecated, use registerGeneratedResFolders(FileCollection)
app: 'annotationProcessor' dependencies won't be recognized as kapt annotation processors. Please change the configuration name to 'kapt' for these artifacts: 'com.github.bumptech.glide:compiler:4.6.1'.
:app:buildInfoDebugLoader
:app:preBuild UP-TO-DATE
:app:preDebugBuild UP-TO-DATE
:app:compileDebugAidl UP-TO-DATE
:app:compileDebugRenderscript UP-TO-DATE
:app:checkDebugManifest UP-TO-DATE
:app:generateDebugBuildConfig UP-TO-DATE
:app:mainApkListPersistenceDebug UP-TO-DATE
:app:generateDebugResValues UP-TO-DATE
:app:generateDebugResources UP-TO-DATE
:app:processDebugGoogleServices
Parsing json file: /Users/joan/Development/myapp/git/myapp-android/app/google-services.json
:app:mergeDebugResources UP-TO-DATE
:app:createDebugCompatibleScreenManifests UP-TO-DATE
:app:processDebugManifest
:app:splitsDiscoveryTaskDebug UP-TO-DATE
:app:processDebugResources
:app:kaptGenerateStubsDebugKotlin
:app:kaptDebugKotlin
w: Note: [1] Wrote GeneratedAppGlideModule with: []
w: warning: Supported source version 'RELEASE_7' from annotation processor 'org.jetbrains.kotlin.kapt3.ProcessorWrapper' less than -source '1.8'
w: /Users/joan/Development/myapp/git/myapp-android/app/build/tmp/kapt3/stubs/debug/com/myapp/model/ApplicationDatabase.java:7: warning: Schema export directory is not provided to the annotation processor so we cannot export the schema. You can either provide `room.schemaLocation` annotation processor argument OR set exportSchema to false.
public abstract class ApplicationDatabase extends android.arch.persistence.room.RoomDatabase {
^
:app:compileDebugKotlin
:app:prepareLintJar UP-TO-DATE
:app:generateDebugSources
:app:javaPreCompileDebug
Note: Some input files use unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
:app:compileDebugJavaWithJavac
:app:mergeDebugShaders
:app:compileDebugShaders
:app:generateDebugAssets
:app:mergeDebugAssets
:app:packageInstantRunResourcesDebug
:app:validateSigningDebug
:app:processInstantRunDebugResourcesApk
:app:checkManifestChangesDebug
:app:transformClassesWithStackFramesFixerForDebug
:app:transformClassesWithDesugarForDebug
:app:transformClassesWithExtractJarsForDebug
:app:transformClassesWithInstantRunVerifierForDebug
:app:transformClassesWithDependencyCheckerForDebug
:app:compileDebugNdk NO-SOURCE
:app:mergeDebugJniLibFolders
:app:transformNativeLibsWithMergeJniLibsForDebug
:app:processDebugJavaRes NO-SOURCE
:app:transformResourcesWithMergeJavaResForDebug
:app:transformNativeLibsAndResourcesWithJavaResourcesVerifierForDebug
:app:transformClassesWithInstantRunForDebug
:app:transformClassesEnhancedWithInstantReloadDexForDebug
:app:incrementalDebugTasks
:app:preColdswapDebug
:app:fastDeployDebugExtractor
:app:generateDebugInstantRunAppInfo
:app:transformClassesWithInstantRunSlicerForDebug
:app:transformClassesWithDexBuilderForDebug
AGPBI: {"kind":"error","text":"Program type already present: android.arch.lifecycle.LiveData$1","sources":[{}],"tool":"D8"}
:app:transformDexArchiveWithExternalLibsDexMergerForDebug FAILED
:app:buildInfoGeneratorDebug
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:transformDexArchiveWithExternalLibsDexMergerForDebug'.
> com.android.builder.dexing.DexArchiveMergerException: Error while merging dex archives: /Users/joan/Development/myapp/git/myapp-android/app/build/intermediates/transforms/dexBuilder/debug/0.jar, /Users/joan/Development/myapp/git/myapp-android/app/build/intermediates/transforms/dexBuilder/debug/1.jar, /Users/joan/Development/myapp/git/myapp-android/app/build/intermediates/transforms/dexBuilder/debug/2.jar, /Users/joan/Development/myapp/git/myapp-android/app/build/intermediates/transforms/dexBuilder/debug/3.jar, /Users/joan/Development/myapp/git/myapp-android/app/build/intermediates/transforms/dexBuilder/debug/4.jar, /Users/joan/Development/myapp/git/myapp-android/app/build/intermediates/transforms/dexBuilder/debug/5.jar, /Users/joan/Development/myapp/git/myapp-android/app/build/intermediates/transforms/dexBuilder/debug/6.jar, /Users/joan/Development/myapp/git/myapp-android/app/build/intermediates/transforms/dexBuilder/debug/7.jar, /Users/joan/Development/myapp/git/myapp-android/app/build/intermediates/transforms/dexBuilder/debug/8.jar, /Users/joan/Development/myapp/git/myapp-android/app/build/intermediates/transforms/dexBuilder/debug/9.jar, /Users/joan/Development/myapp/git/myapp-android/app/build/intermediates/transforms/dexBuilder/debug/10.jar, /Users/joan/Development/myapp/git/myapp-android/app/build/intermediates/transforms/dexBuilder/debug/11.jar, /Users/joan/Development/myapp/git/myapp-android/app/build/intermediates/transforms/dexBuilder/debug/12.jar, /Users/joan/Development/myapp/git/myapp-android/app/build/intermediates/transforms/dexBuilder/debug/13.jar, /Users/joan/Development/myapp/git/myapp-android/app/build/intermediates/transforms/dexBuilder/debug/14.jar, /Users/joan/Development/myapp/git/myapp-android/app/build/intermediates/transforms/dexBuilder/debug/15.jar, /Users/joan/Development/myapp/git/myapp-android/app/build/intermediates/transforms/dexBuilder/debug/16.jar, /Users/joan/Development/myapp/git/myapp-android/app/build/intermediates/transforms/dexBuilder/debug/17.jar, /Users/joan/Development/myapp/git/myapp-android/app/build/intermediates/transforms/dexBuilder/debug/18.jar, /Users/joan/Development/myapp/git/myapp-android/app/build/intermediates/transforms/dexBuilder/debug/19.jar, /Users/joan/Development/myapp/git/myapp-android/app/build/intermediates/transforms/dexBuilder/debug/20.jar, /Users/joan/Development/myapp/git/myapp-android/app/build/intermediates/transforms/dexBuilder/debug/21.jar, /Users/joan/Development/myapp/git/myapp-android/app/build/intermediates/transforms/dexBuilder/debug/22.jar, /Users/joan/Development/myapp/git/myapp-android/app/build/intermediates/transforms/dexBuilder/debug/23.jar, /Users/joan/Development/myapp/git/myapp-android/app/build/intermediates/transforms/dexBuilder/debug/24.jar, /Users/joan/Development/myapp/git/myapp-android/app/build/intermediates/transforms/dexBuilder/debug/25.jar, /Users/joan/Development/myapp/git/myapp-android/app/build/intermediates/transforms/dexBuilder/debug/26.jar, /Users/joan/Development/myapp/git/myapp-android/app/build/intermediates/transforms/dexBuilder/debug/27.jar, /Users/joan/Development/myapp/git/myapp-android/app/build/intermediates/transforms/dexBuilder/debug/28.jar, /Users/joan/Development/myapp/git/myapp-android/app/build/intermediates/transforms/dexBuilder/debug/29.jar, /Users/joan/Development/myapp/git/myapp-android/app/build/intermediates/transforms/dexBuilder/debug/30.jar, /Users/joan/Development/myapp/git/myapp-android/app/build/intermediates/transforms/dexBuilder/debug/31.jar, /Users/joan/Development/myapp/git/myapp-android/app/build/intermediates/transforms/dexBuilder/debug/32.jar, /Users/joan/Development/myapp/git/myapp-android/app/build/intermediates/transforms/dexBuilder/debug/33.jar, /Users/joan/Development/myapp/git/myapp-android/app/build/intermediates/transforms/dexBuilder/debug/34.jar, /Users/joan/Development/myapp/git/myapp-android/app/build/intermediates/transforms/dexBuilder/debug/35.jar, /Users/joan/Development/myapp/git/myapp-android/app/build/intermediates/transforms/dexBuilder/debug/36.jar, /Users/joan/Development/myapp/git/myapp-android/app/build/intermediates/transforms/dexBuilder/debug/37.jar, /Users/joan/Development/myapp/git/myapp-android/app/build/intermediates/transforms/dexBuilder/debug/38.jar, /Users/joan/Development/myapp/git/myapp-android/app/build/intermediates/transforms/dexBuilder/debug/39.jar, /Users/joan/Development/myapp/git/myapp-android/app/build/intermediates/transforms/dexBuilder/debug/40.jar, /Users/joan/Development/myapp/git/myapp-android/app/build/intermediates/transforms/dexBuilder/debug/41.jar, /Users/joan/Development/myapp/git/myapp-android/app/build/intermediates/transforms/dexBuilder/debug/42.jar, /Users/joan/Development/myapp/git/myapp-android/app/build/intermediates/transforms/dexBuilder/debug/43.jar, /Users/joan/Development/myapp/git/myapp-android/app/build/intermediates/transforms/dexBuilder/debug/44.jar, /Users/joan/Development/myapp/git/myapp-android/app/build/intermediates/transforms/dexBuilder/debug/45.jar, /Users/joan/Development/myapp/git/myapp-android/app/build/intermediates/transforms/dexBuilder/debug/46.jar, /Users/joan/Development/myapp/git/myapp-android/app/build/intermediates/transforms/dexBuilder/debug/47.jar, /Users/joan/Development/myapp/git/myapp-android/app/build/intermediates/transforms/dexBuilder/debug/48.jar, /Users/joan/Development/myapp/git/myapp-android/app/build/intermediates/transforms/dexBuilder/debug/49.jar, /Users/joan/Development/myapp/git/myapp-android/app/build/intermediates/transforms/dexBuilder/debug/50.jar, /Users/joan/Development/myapp/git/myapp-android/app/build/intermediates/transforms/dexBuilder/debug/51.jar, /Users/joan/Development/myapp/git/myapp-android/app/build/intermediates/transforms/dexBuilder/debug/52.jar, /Users/joan/Development/myapp/git/myapp-android/app/build/intermediates/transforms/dexBuilder/debug/53.jar, /Users/joan/Development/myapp/git/myapp-android/app/build/intermediates/transforms/dexBuilder/debug/54.jar, /Users/joan/Development/myapp/git/myapp-android/app/build/intermediates/transforms/dexBuilder/debug/55.jar, /Users/joan/Development/myapp/git/myapp-android/app/build/intermediates/transforms/dexBuilder/debug/56.jar, /Users/joan/Development/myapp/git/myapp-android/app/build/intermediates/transforms/dexBuilder/debug/57.jar, /Users/joan/Development/myapp/git/myapp-android/app/build/intermediates/transforms/dexBuilder/debug/58.jar, /Users/joan/Development/myapp/git/myapp-android/app/build/intermediates/transforms/dexBuilder/debug/59.jar, /Users/joan/Development/myapp/git/myapp-android/app/build/intermediates/transforms/dexBuilder/debug/60.jar, /Users/joan/Development/myapp/git/myapp-android/app/build/intermediates/transforms/dexBuilder/debug/61.jar, /Users/joan/Development/myapp/git/myapp-android/app/build/intermediates/transforms/dexBuilder/debug/62.jar, /Users/joan/Development/myapp/git/myapp-android/app/build/intermediates/transforms/dexBuilder/debug/63.jar, /Users/joan/Development/myapp/git/myapp-android/app/build/intermediates/transforms/dexBuilder/debug/64.jar, /Users/joan/Development/myapp/git/myapp-android/app/build/intermediates/transforms/dexBuilder/debug/65.jar, /Users/joan/Development/myapp/git/myapp-android/app/build/intermediates/transforms/dexBuilder/debug/66.jar, /Users/joan/Development/myapp/git/myapp-android/app/build/intermediates/transforms/dexBuilder/debug/67.jar, /Users/joan/Development/myapp/git/myapp-android/app/build/intermediates/transforms/dexBuilder/debug/68.jar, /Users/joan/Development/myapp/git/myapp-android/app/build/intermediates/transforms/dexBuilder/debug/69.jar, /Users/joan/Development/myapp/git/myapp-android/app/build/intermediates/transforms/dexBuilder/debug/70.jar, /Users/joan/Development/myapp/git/myapp-android/app/build/intermediates/transforms/dexBuilder/debug/71.jar, /Users/joan/Development/myapp/git/myapp-android/app/build/intermediates/transforms/dexBuilder/debug/72.jar, /Users/joan/Development/myapp/git/myapp-android/app/build/intermediates/transforms/dexBuilder/debug/73.jar, /Users/joan/Development/myapp/git/myapp-android/app/build/intermediates/transforms/dexBuilder/debug/74.jar, /Users/joan/Development/myapp/git/myapp-android/app/build/intermediates/transforms/dexBuilder/debug/75.jar, /Users/joan/Development/myapp/git/myapp-android/app/build/intermediates/transforms/dexBuilder/debug/76.jar, /Users/joan/Development/myapp/git/myapp-android/app/build/intermediates/transforms/dexBuilder/debug/77.jar, /Users/joan/Development/myapp/git/myapp-android/app/build/intermediates/transforms/dexBuilder/debug/78.jar, /Users/joan/Development/myapp/git/myapp-android/app/build/intermediates/transforms/dexBuilder/debug/79.jar, /Users/joan/Development/myapp/git/myapp-android/app/build/intermediates/transforms/dexBuilder/debug/80.jar, /Users/joan/Development/myapp/git/myapp-android/app/build/intermediates/transforms/dexBuilder/debug/81.jar, /Users/joan/Development/myapp/git/myapp-android/app/build/intermediates/transforms/dexBuilder/debug/82.jar, /Users/joan/Development/myapp/git/myapp-android/app/build/intermediates/transforms/dexBuilder/debug/83.jar, /Users/joan/Development/myapp/git/myapp-android/app/build/intermediates/transforms/dexBuilder/debug/84.jar, /Users/joan/Development/myapp/git/myapp-android/app/build/intermediates/transforms/dexBuilder/debug/85.jar
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
* Get more help at https://help.gradle.org
BUILD FAILED in 22s
45 actionable tasks: 34 executed, 11 up-to-date
But if I change the supportVersion to 27.0.2 everything works fine until I add an other library (implementation 'com.github.yalantis:ucrop:2.2.2'), then I have the same issue. It looks like each library is using different versions of other libs I use, but I don't know how to solve this issue. Any help?

DBFlow - Gradle cannot find symbol DatabaseHolder when using multiple modules

i need help with a problem using DBFlow 4.0.0-beta3 and Gradle 2.2.3 in my module app of an Android Studio project; i have two modules (app, notifications) that uses DBFlow so i configure them like is indicated in the usage of the library, the notifications module compiles whell and generates the DatabaseHolder class, then the compiler goes to app and throws the exception:
error: cannot find symbol
import com.raizlabs.android.dbflow.config.SamsungGeneratedDatabaseHolder;
But that class is generated successfully, this is my gradle output:
Executing tasks: [clean, :app:generateDebugSources, :app:mockableAndroidJar, :app:prepareDebugUnitTestDependencies, :app:generateDebugAndroidTestSources, :app:compileDebugSources, :app:compileDebugUnitTestSources, :app:compileDebugAndroidTestSources, :notifications:generateDebugSources, :notifications:generateDebugAndroidTestSources, :notifications:mockableAndroidJar, :notifications:prepareDebugUnitTestDependencies, :notifications:compileDebugSources, :notifications:compileDebugAndroidTestSources, :notifications:compileDebugUnitTestSources, :sapservice:generateDebugSources, :sapservice:generateDebugAndroidTestSources, :sapservice:mockableAndroidJar, :sapservice:prepareDebugUnitTestDependencies, :sapservice:compileDebugSources, :sapservice:compileDebugAndroidTestSources, :sapservice:compileDebugUnitTestSources]
Configuration on demand is an incubating feature.
Incremental java compilation is an incubating feature.
:clean
:app:clean
:notifications:clean
:sapapi:clean
:sapprocessor:clean
:sapservice:clean
:app:preBuild UP-TO-DATE
:app:preDebugBuild UP-TO-DATE
:app:checkDebugManifest
:app:preReleaseBuild UP-TO-DATE
:notifications:preBuild UP-TO-DATE
:notifications:preReleaseBuild UP-TO-DATE
:notifications:checkReleaseManifest
:notifications:preDebugAndroidTestBuild UP-TO-DATE
:notifications:preDebugBuild UP-TO-DATE
:notifications:preDebugUnitTestBuild UP-TO-DATE
:notifications:preReleaseUnitTestBuild UP-TO-DATE
:notifications:prepareComAndroidSupportAnimatedVectorDrawable2511Library
:notifications:prepareComAndroidSupportAppcompatV72511Library
:notifications:prepareComAndroidSupportSupportCompat2511Library
:notifications:prepareComAndroidSupportSupportCoreUi2511Library
:notifications:prepareComAndroidSupportSupportCoreUtils2511Library
:notifications:prepareComAndroidSupportSupportFragment2511Library
:notifications:prepareComAndroidSupportSupportMediaCompat2511Library
:notifications:prepareComAndroidSupportSupportV42511Library
:notifications:prepareComAndroidSupportSupportVectorDrawable2511Library
:notifications:prepareComGithubRaizlabsDBFlowDbflow400Beta3Library
:notifications:prepareComGithubRaizlabsDBFlowDbflowKotlinextensions400Beta3Library
:notifications:prepareIoReactivexRxjava2Rxandroid201Library
:notifications:prepareNetDanlewAndroidJoda2942Library
:notifications:prepareReleaseDependencies
:notifications:compileReleaseAidl
:notifications:compileReleaseNdk UP-TO-DATE
:notifications:compileLint
:notifications:copyReleaseLint UP-TO-DATE
:notifications:compileReleaseRenderscript
:notifications:generateReleaseBuildConfig
:notifications:generateReleaseResValues
:notifications:generateReleaseResources
:notifications:mergeReleaseResources
:notifications:processReleaseManifest
:notifications:processReleaseResources
:notifications:generateReleaseSources
:notifications:incrementalReleaseJavaCompilationSafeguard
:notifications:compileReleaseKotlin
:notifications:compileReleaseJavaWithJavac
Destination for generated sources was modified by kapt. Previous value = /home/diego/Documents/development/mobile/android/samsung-club/notifications/build/generated/source/apt/release
:notifications:compileReleaseJavaWithJavac - is not incremental (e.g. outputs have changed, no previous execution, etc.).
warning: File for type 'com.raizlabs.android.dbflow.config.NotificationsRegisterDatabaseNotificationsRegisterDatabase_Database' created in the last round will not be subject to annotation processing.
warning: File for type 'com.raizlabs.android.dbflow.config.NotificationsModuleGeneratedDatabaseHolder' created in the last round will not be subject to annotation processing.
2 warnings
:notifications:compileReleaseKotlinAfterJava
:notifications:copyReleaseKotlinClasses
:notifications:extractReleaseAnnotations
:notifications:mergeReleaseShaders
:notifications:compileReleaseShaders
:notifications:generateReleaseAssets
:notifications:mergeReleaseAssets
:notifications:mergeReleaseProguardFiles UP-TO-DATE
:notifications:packageReleaseRenderscript UP-TO-DATE
:notifications:packageReleaseResources
:notifications:processReleaseJavaRes UP-TO-DATE
:notifications:transformResourcesWithMergeJavaResForRelease
:notifications:transformClassesAndResourcesWithSyncLibJarsForRelease
:notifications:mergeReleaseJniLibFolders
:notifications:transformNative_libsWithMergeJniLibsForRelease
:notifications:transformNative_libsWithSyncJniLibsForRelease
:notifications:bundleRelease
:app:prepareComAndroidSupportAnimatedVectorDrawable2511Library
:app:prepareComAndroidSupportAppcompatV72511Library
:app:prepareComAndroidSupportCardviewV72511Library
:app:prepareComAndroidSupportDesign2511Library
:app:prepareComAndroidSupportMultidex101Library
:app:prepareComAndroidSupportPercent2511Library
:app:prepareComAndroidSupportRecyclerviewV72511Library
:app:prepareComAndroidSupportSupportCompat2511Library
:app:prepareComAndroidSupportSupportCoreUi2511Library
:app:prepareComAndroidSupportSupportCoreUtils2511Library
:app:prepareComAndroidSupportSupportFragment2511Library
:app:prepareComAndroidSupportSupportMediaCompat2511Library
:app:prepareComAndroidSupportSupportV42511Library
:app:prepareComAndroidSupportSupportVectorDrawable2511Library
:app:prepareComAndroidSupportTransition2511Library
:app:prepareComAppsflyerAfAndroidSdk467Library
:app:prepareComCrashlyticsSdkAndroidAnswers136Library
:app:prepareComCrashlyticsSdkAndroidBeta114Library
:app:prepareComCrashlyticsSdkAndroidCrashlytics255Library
:app:prepareComCrashlyticsSdkAndroidCrashlyticsCore238Library
:app:prepareComCrashlyticsSdkAndroidCrashlyticsNdk111Library
:app:prepareComDaimajiaSwipelayoutLibrary120Library
:app:prepareComFacebookAndroidFacebookAndroidSdk470Library
:app:prepareComGithubAfollestadMaterialDialogsCore0857Library
:app:prepareComGithubRaizlabsDBFlowDbflow400Beta3Library
:app:prepareComGithubRaizlabsDBFlowDbflowKotlinextensions400Beta3Library
:app:prepareComGoogleAndroidGmsPlayServicesAnalytics961Library
:app:prepareComGoogleAndroidGmsPlayServicesAnalyticsImpl961Library
:app:prepareComGoogleAndroidGmsPlayServicesBase961Library
:app:prepareComGoogleAndroidGmsPlayServicesBasement961Library
:app:prepareComGoogleAndroidGmsPlayServicesGcm961Library
:app:prepareComGoogleAndroidGmsPlayServicesIid961Library
:app:prepareComGoogleAndroidGmsPlayServicesLocation961Library
:app:prepareComGoogleAndroidGmsPlayServicesMaps961Library
:app:prepareComGoogleAndroidGmsPlayServicesTasks961Library
:app:prepareComGoogleFirebaseFirebaseAnalytics961Library
:app:prepareComGoogleFirebaseFirebaseAnalyticsImpl961Library
:app:prepareComGoogleFirebaseFirebaseCommon961Library
:app:prepareComGoogleFirebaseFirebaseCore961Library
:app:prepareComGoogleFirebaseFirebaseIid961Library
:app:prepareComGoogleMapsAndroidAndroidMapsUtils043Library
:app:prepareComKarumiDexter231Library
:app:prepareComTwitterSdkAndroidTweetComposer200Library
:app:prepareComTwitterSdkAndroidTweetUi200Library
:app:prepareComTwitterSdkAndroidTwitter200Library
:app:prepareComTwitterSdkAndroidTwitterCore200Library
:app:prepareIoFabricSdkAndroidFabric1313Library
:app:prepareIoReactivexRxandroid121Library
:app:prepareIoReactivexRxjava2Rxandroid201Library
:app:prepareMeZhanghaiAndroidMaterialprogressbarLibrary115Library
:app:prepareNetDanlewAndroidJoda2942Library
:app:prepareSamsungClubGeoreferencedpushnotificationsReleaseUnspecifiedLibrary
:app:prepareSamsungClubNotificationsUnspecifiedLibrary
:app:prepareDebugDependencies
:app:compileDebugAidl
:app:compileDebugRenderscript
:app:generateDebugBuildConfig
:app:mergeDebugShaders
:app:compileDebugShaders
:app:generateDebugAssets
:app:mergeDebugAssets
:app:processDebugManifest
:app:fabricGenerateResourcesDebug
:app:generateDebugResValues
:app:processDebugGoogleServices
Parsing json file: /home/diego/Documents/development/mobile/android/samsung-club/app/google-services.json
:app:generateDebugResources
:app:mergeDebugResources
:app:processDebugResources
:app:generateDebugSources
:app:mockableAndroidJar
:app:preDebugUnitTestBuild UP-TO-DATE
:app:prepareDebugUnitTestDependencies
:app:preDebugAndroidTestBuild UP-TO-DATE
:app:prepareDebugAndroidTestDependencies
:app:compileDebugAndroidTestAidl
:app:processDebugAndroidTestManifest
:app:compileDebugAndroidTestRenderscript
:app:generateDebugAndroidTestBuildConfig
:app:generateDebugAndroidTestResValues
:app:generateDebugAndroidTestResources
:app:mergeDebugAndroidTestResources
:app:processDebugAndroidTestResources
:app:generateDebugAndroidTestSources
:app:incrementalDebugJavaCompilationSafeguard
:app:compileDebugJavaWithJavac
/home/diego/Documents/development/mobile/android/samsung-club/app/src/main/java/com/creardigitalm/samsungclub/controller/fragment/MyBenefitsFragment.java:28: error: cannot find symbol
import com.raizlabs.android.dbflow.config.SamsungGeneratedDatabaseHolder;
^
symbol: class SamsungGeneratedDatabaseHolder
location: package com.raizlabs.android.dbflow.config
warning: File for type 'com.raizlabs.android.dbflow.config.SamsungClubDatabaseSamsungDB_Database' created in the last round will not be subject to annotation processing.
warning: File for type 'com.raizlabs.android.dbflow.config.SamsungGeneratedDatabaseHolder' created in the last round will not be subject to annotation processing.
1 error
2 warnings
FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:compileDebugJavaWithJavac'.
> Compilation failed; see the compiler error output for details.
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
BUILD FAILED
Total time: 17.914 secs
Like you can see the compiler try to find the import class and then generate the classes i will post my app gradle.build (i switch from apt to annotationProcessor):
buildscript {
repositories {
mavenCentral()
maven { url 'https://maven.fabric.io/public' }
}
dependencies {
classpath 'io.fabric.tools:gradle:1.+'
classpath 'org.aspectj:aspectjtools:1.8.5'
}
}
apply plugin: 'com.android.application'
//apply plugin: 'kotlin-android'
//apply plugin: 'com.neenbedankt.android-apt'
apply plugin: 'io.fabric'
repositories {
maven { url 'https://maven.fabric.io/public' }
mavenCentral()
}
android {
compileSdkVersion 25
buildToolsVersion '24.0.1'
defaultConfig {
applicationId "com.creardigitalm.samsungclub"
minSdkVersion 18
targetSdkVersion 25
versionCode 69
versionName '1.5.5.0'
//multiDexEnabled true
javaCompileOptions {
annotationProcessorOptions {
arguments = [ targetModuleName : 'Samsung']
}
}
}
buildTypes {
debug {
resValue("bool", "is_debug", "true")
}
release {
resValue("bool", "is_debug", "false")
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
productFlavors {
}
packagingOptions {
//exclude 'META-INF/services/javax.annotation.processing.Processor'
exclude 'META-INF/rxjava.properties'
}
sourceSets {
main.java.srcDirs += 'src/main/kotlin'
}
}
/*apt {
arguments {
targetModuleName 'Samsung'
}
}*/
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
/*---- GOOGLE SUPPORT LIBRARIES ----*/
// MATERIAL DESIGN
compile "com.android.support:appcompat-v7:$support_version"
compile "com.android.support:support-v4:$support_version"
compile "com.android.support:design:$support_version"
compile "com.android.support:cardview-v7:$support_version"
// PERCENT RELATIVE LAYOUT
compile "com.android.support:percent:${support_version}"
//MATERIAL DIALOGS
compile('com.github.afollestad.material-dialogs:core:0.8.5.7#aar') {
transitive = true
}
/*----------------------------------*/
//SWIPE LIST
// Swipe layout https://github.com/daimajia/AndroidSwipeLayout
compile "com.daimajia.swipelayout:library:1.2.0#aar"
//PICASSO
compile 'com.squareup.picasso:picasso:2.5.2'
/*------ DEPENDENCY INJECTION ------*/
// ButterKnife utils http://jakewharton.github.io/butterknife/
compile 'com.jakewharton:butterknife:7.0.1'
// Parceler https://github.com/johncarl81/parceler
compile 'org.parceler:parceler-api:1.1.4'
annotationProcessor 'org.parceler:parceler:1.1.4'
/*----------------------------------*/
/*------- REST - NETWORKING -------*/
// Retrofit http://square.github.io/retrofit/
compile 'com.squareup.retrofit2:retrofit:2.1.0'
compile 'com.squareup.retrofit2:adapter-rxjava:2.1.0'
compile 'com.squareup.retrofit2:converter-gson:2.1.0'
// OkHttp http://square.github.io/okhttp/
compile 'com.squareup.okhttp3:okhttp:3.4.1'
/*----------------------------------*/
/*------------ GOOGLE --------------*/
//Google Map Utils.
compile 'com.google.maps.android:android-maps-utils:0.4.3'
//Google Cloud Message
compile 'com.google.android.gms:play-services-gcm:9.6.1'
//Google Location
compile 'com.google.android.gms:play-services-location:9.6.1'
//Google Maps
compile 'com.google.android.gms:play-services-maps:9.6.1'
//Google Analytics
compile 'com.google.android.gms:play-services-analytics:9.6.1'
/*----------------------------------*/
/*------------ FABRIC --------------*/
compile('com.crashlytics.sdk.android:crashlytics:2.5.5#aar') {
transitive = true;
}
compile('com.crashlytics.sdk.android:crashlytics-ndk:1.1.1#aar') {
transitive = true;
}
compile('com.crashlytics.sdk.android:answers:1.3.3#aar') {
transitive = true;
}
/*----------------------------------*/
/*----------- ANALYTICS ------------*/
//Appsflyer
compile 'com.appsflyer:af-android-sdk:4+#aar'
/*----------------------------------*/
/*------------ FACEBOOK ------------*/
compile 'com.facebook.android:facebook-android-sdk:4.7.0'
/*----------------------------------*/
/*------------- TWITTER -------------*/
compile('com.twitter.sdk.android:twitter:2.0.0#aar') {
transitive = true;
}
/*----------------------------------*/
/*--------- GEO FENCED PUSH --------*/
compile project(':georeferencedpushnotifications-release')
/*compile "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
compile "org.jetbrains.kotlin:kotlin-reflect:$kotlin_version"
compile 'net.danlew:android.joda:2.9.4.2'
compile "com.github.Raizlabs.DBFlow:dbflow-kotlinextensions:$dbflow_version"*/
/*----------------------------------*/
/*---------- NOTIFICATIONS ---------*/
compile project(':notifications')
/*----------------------------------*/
/*------------ SECURITY ------------*/
// Dexter https://github.com/Karumi/Dexter
compile 'com.karumi:dexter:2.3.1'
/*----------------------------------*/
/*--------------- RX ---------------*/
compile 'io.reactivex:rxandroid:1.2.1'
compile 'io.reactivex:rxjava:1.2.1'
/*----------------------------------*/
/*------------ MULTIDEX ------------*/
compile 'com.android.support:multidex:1.0.1'
/*----------------------------------*/
/*-------------- DBFLOW ------------*/
annotationProcessor "com.github.Raizlabs.DBFlow:dbflow-processor:$dbflow_version"
compile "com.github.Raizlabs.DBFlow:dbflow-core:$dbflow_version"
compile "com.github.Raizlabs.DBFlow:dbflow:$dbflow_version"
/*----------------------------------*/
/*------- SAPAPI PARA GEAR S2 ------*/
/*compile project(':sapservice')
apt project(':sapprocessor')
compile 'org.aspectj:aspectjrt:1.8.5'*/
/*----------------------------------*/
}
apply plugin: 'com.google.gms.google-services'
crashlytics {
enableNdk true
androidNdkOut 'src/main/obj'
androidNdkLibsOut 'src/main/libs'
}

Not able to import apache HttpClient in Android 6.0 Marshmallow API 23 [duplicate]

This question already has answers here:
org.apache.http.entity.FileEntity is deprecated in Android 6 (Marshmallow)
(3 answers)
Closed 7 years ago.
I am having trouble in converting my simple project from buildtool version 19 to 23.... the app was running on 19 without any error.. i included all apache httpclient jar files from apache site n gave proper path too.. still don't know what's wrong. the reason m trying convert is m unable to include material components i.e. com.android.support:appcompat-v7:23.0.1 hence i have to upgrade buildtool version
this is build.gradle for project
apply plugin: 'com.android.application'
android {
compileSdkVersion 23
buildToolsVersion '23.0.2'
useLibrary 'org.apache.http.legacy'
packagingOptions {
exclude 'META-INF/LICENSE.txt'
}
defaultConfig {
applicationId "reminder.simpleaccountapp"
minSdkVersion 14
targetSdkVersion 21
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_7
targetCompatibility JavaVersion.VERSION_1_7
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:22.2.1'
compile files('libs/activation.jar')
compile files('libs/additionnal.jar')
compile files('libs/mail.jar')
compile 'com.google.android.gms:play-services-appindexing:8.1.0'
compile 'com.android.support:appcompat-v7:23.0.1'
compile 'com.android.support:design:23.0.1'
}
this is build.gradle for module app
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
jcenter()
/*mavenCentral()
maven{
url 'http://repository.codehaus.org'
}*/
}
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()
}
}
this is output message
Information:Gradle tasks [:app:assembleDebug]
:app:preBuild UP-TO-DATE
:app:preDebugBuild UP-TO-DATE
:app:checkDebugManifest
:app:preReleaseBuild UP-TO-DATE
:app:prepareComAndroidSupportAppcompatV72301Library UP-TO-DATE
:app:prepareComAndroidSupportDesign2301Library UP-TO-DATE
:app:prepareComAndroidSupportSupportV42301Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesAppindexing810Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesBasement810Library UP-TO-DATE
:app:prepareDebugDependencies
:app:compileDebugAidl UP-TO-DATE
:app:compileDebugRenderscript UP-TO-DATE
:app:generateDebugBuildConfig UP-TO-DATE
:app:generateDebugAssets UP-TO-DATE
:app:mergeDebugAssets UP-TO-DATE
:app:generateDebugResValues UP-TO-DATE
:app:generateDebugResources UP-TO-DATE
:app:mergeDebugResources UP-TO-DATE
:app:processDebugManifest UP-TO-DATE
:app:processDebugResources UP-TO-DATE
:app:generateDebugSources UP-TO-DATE
:app:processDebugJavaRes UP-TO-DATE
:app:compileDebugJavaWithJavac UP-TO-DATE
:app:compileDebugNdk UP-TO-DATE
:app:compileDebugSources UP-TO-DATE
:app:preDexDebug UP-TO-DATE
:app:dexDebug
UNEXPECTED TOP-LEVEL EXCEPTION:
com.android.dex.DexException: Multiple dex files define Lorg/apache/http/client/HttpClient;
at com.android.dx.merge.DexMerger.readSortableTypes(DexMerger.java:579)
at com.android.dx.merge.DexMerger.getSortedTypes(DexMerger.java:535)
at com.android.dx.merge.DexMerger.mergeClassDefs(DexMerger.java:517)
at com.android.dx.merge.DexMerger.mergeDexes(DexMerger.java:164)
at com.android.dx.merge.DexMerger.merge(DexMerger.java:188)
at com.android.dx.command.dexer.Main.mergeLibraryDexBuffers(Main.java:504)
at com.android.dx.command.dexer.Main.runMonoDex(Main.java:334)
at com.android.dx.command.dexer.Main.run(Main.java:277)
at com.android.dx.command.dexer.Main.main(Main.java:245)
at com.android.dx.command.Main.main(Main.java:106)
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_80\bin\java.exe'' finished with non-zero exit value 2
Information:BUILD FAILED
Information:Total time: 59.486 secs
Information:1 error
Information:0 warnings
Information:See complete output in console
Try to use:
compile 'org.jbundle.util.osgi.wrapped:org.jbundle.util.osgi.wrapped.org.apache.http.client:4.1.2'
on your android dependencies section.

I can't import libs by gradle in android studio

I am trying to import libraries using gradle. This is my build.gradle file:
apply plugin: 'android'
dependencies {
compile 'com.google.code.gson:gson:2.2.+'
compile 'com.android.support:support-v4:19.1.0'
compile 'com.android.support:appcompat-v7:19.1.0'
compile 'com.squareup.okhttp:okhttp:1.3.0'
compile 'com.squareup.retrofit:retrofit:1.4.1'
compile 'net.hockeyapp.android:HockeySDK:3.0.1'
compile files('libs/activeandroid-3.1-SNAPSHOT.jar')
}
android {
compileSdkVersion 19
buildToolsVersion "19.0.3"
defaultConfig {
minSdkVersion 14
targetSdkVersion 19
versionCode 1
versionName "1.0"
}
buildTypes {
release {
runProguard false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
}
}
// TODO: Fix the warnings and removed this section!
lintOptions {
abortOnError false
}
}
I get errors like these:
I/dalvikvm﹕ Failed resolving Landroid/support/v4/media/TransportMediatorJellybeanMR2$1; interface 964 'Landroid/view/ViewTreeObserver$OnWindowAttachListener;'
W/dalvikvm﹕ Link of class 'Landroid/support/v4/media/TransportMediatorJellybeanMR2$1;' failed
W/dalvikvm﹕ Unable to resolve superclass of Landroid/support/v4/print/PrintHelperKitkat$1; (155)
W/dalvikvm﹕ Link of class 'Landroid/support/v4/print/PrintHelperKitkat$1;' failed
I/dalvikvm﹕ Failed resolving Lretrofit/RestAdapter$RxSupport$1; interface 1942 'Lrx/Observable$OnSubscribeFunc;'
W/dalvikvm﹕ Link of class 'Lretrofit/RestAdapter$RxSupport$1;' failed
I have run gradlew clean and build command. But it doesn't help. Do you have any idea what is wrong ?
There are my logs for gradlew build command:
Relying on packaging to define the extension of the main artifact has been deprecated and is scheduled to be removed in Gradle 2.0
:app:compileDebugNdk
:app:preBuild
:app:preDebugBuild
:app:checkDebugManifest
:app:preReleaseBuild
:app:prepareComAndroidSupportAppcompatV71910Library
:app:prepareDebugDependencies
:app:compileDebugAidl
:app:compileDebugRenderscript
:app:generateDebugBuildConfig
:app:mergeDebugAssets
:app:generateDebugResValues UP-TO-DATE
:app:generateDebugResources
:app:mergeDebugResources
:app:processDebugManifest
:app:processDebugResources
:app:generateDebugSources
:app:compileDebugJava
:app:preDexDebug
:app:dexDebug
:app:processDebugJavaRes UP-TO-DATE
:app:validateDebugSigning
:app:packageDebug
:app:assembleDebug
:app:checkReleaseManifest
:app:prepareReleaseDependencies
:app:compileReleaseAidl
:app:compileReleaseRenderscript
:app:generateReleaseBuildConfig
:app:mergeReleaseAssets
:app:generateReleaseResValues UP-TO-DATE
:app:generateReleaseResources
:app:mergeReleaseResources
:app:processReleaseManifest
:app:processReleaseResources
:app:generateReleaseSources
:app:compileReleaseJava
:app:lintVitalRelease SKIPPED
:app:compileReleaseNdk
:app:preDexRelease
:app:dexRelease
:app:processReleaseJavaRes UP-TO-DATE
:app:packageRelease
:app:assembleRelease
:app:assemble
:app:compileLint
:app:lint
Ran lint on variant release: 25 issues found
Ran lint on variant debug: 25 issues found
Wrote HTML report to file:.../lint-results.html
Wrote XML report to .../lint-results.xml
:app:check
:app:build
BUILD SUCCESSFUL
This is my gradle.build file from project directory:
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:0.9.+'
}
}
allprojects {
repositories {
mavenCentral()
}
}
Maybe support-v4 dependencies mismatch ?
Try to add this into build.gradle:
configurations {
all*.exclude group: 'com.google.android', module: 'support-v4'
}
dependencies {
....

Categories

Resources