Gradle desugaring failed, Hierarchy is incomplete - android

I am working on this project: https://github.com/muxinc/mux-stats-sdk-exoplayer/tree/min_sdk_version_fix It is Android app called demo that have dependency to a module from a same project called MuxExoPlayer which have a dependency to a MuxCore.jar library.
When I try to compile the project with minSdkVersion 16, I get desugaring issue on jar file, error:
Transform artifact full.jar (project :MuxExoPlayer) with DexingWithClasspathTransform
AGPBI: {"kind":"error","text":"Default method desugaring of `com.mux.stats.sdk.muxstats.MuxStatsExoPlayer` failed because it's hierarchy is incomplete. The class `com.mux.stats.sdk.core.events.EventBus` is missing and it is the declared super class of `com.mux.stats.sdk.muxstats.MuxBaseExoPlayer`","sources":[{}],"tool":"D8"}
When I compile with minSdkVersion 24, I do not get this error and project compile just fine.
MuxCore.jar is also built with gradle, here is the gradle.build:
apply plugin: 'java-library'
// In this section you declare where to find the dependencies of your project
repositories {
// Use jcenter for resolving your dependencies.
// You can declare any Maven/Ivy/file repository here.
jcenter()
}
tasks.withType(JavaCompile) {
sourceCompatibility = '1.7'
targetCompatibility = '1.7'
}
dependencies {
// This dependency is exported to consumers, that is to say found on their compile classpath.
api 'org.apache.commons:commons-math3:3.6.1'
// This dependency is used internally, and not exposed to consumers on their own compile classpath.
implementation 'com.google.guava:guava:23.0'
implementation 'org.json:json:20180130'
// Use JUnit test framework
testImplementation 'junit:junit:4.4'
testImplementation 'org.mockito:mockito-core:2.23.4'
}
What am I missing here ?
How do I need to compile MuxCore in order to compile with android minSdkVersion 16 ?

I have the same problem and also create a ticket in Mux github repo but could not make it work... If you update the minSdk to 24 it will work...
https://github.com/muxinc/mux-stats-sdk-exoplayer/issues/19
What is working for me is: instead of adding MuxStatsExoPlayer as a module add directly all the files and classes in your app module into your project and it should work.

Related

Dagger throwing errors after Kotlin integration in a java code

Android project Code base is full java and dagger 2 is implemented in java as well. I am integrating kotlin in the code and each time I rebuild, Dagger gives errors. (Added below)
code:
build.gradle (project)
buildscript {
ext {
kotlin_version = "1.7.10"
}
repositories {
google()
mavenCentral()
}
dependencies {
classpath 'com.google.gms:google-services:4.3.10'
classpath 'com.android.tools.build:gradle:7.2.1'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
}
}
allprojects {
repositories {
google()
mavenCentral()
}
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
build.gradle (app)
apply plugin: 'com.android.application'
apply plugin: 'com.google.gms.google-services'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-kapt'
android {
compileSdkVersion 32
defaultConfig {
applicationId "co.xyz.abc"
minSdkVersion 21
targetSdkVersion 32
versionCode 15
versionName "1.1.1"
multiDexEnabled true
renderscriptTargetApi 19
renderscriptSupportModeEnabled true
vectorDrawables.useSupportLibrary = true
}
buildTypes {
// ...
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
kotlinOptions {
jvmTarget = '1.8'
}
buildFeatures {
viewBinding true
}
}
dependencies {
// AndroidX
// ....
//kotlin
implementation 'org.jetbrains.kotlin:kotlin-stdlib:1.7.10'
implementation 'androidx.core:core-ktx:1.9.0'
// ViewModel
def lifecycle_version = "2.4.1"
implementation "androidx.lifecycle:lifecycle-viewmodel-ktx:$lifecycle_version"
// Dagger2
def daggerVersion = "2.35.1"
api "com.google.dagger:dagger:$daggerVersion"
annotationProcessor "com.google.dagger:dagger-compiler:$daggerVersion"
// Dagger Android
api "com.google.dagger:dagger-android-support:$daggerVersion"
api "com.google.dagger:dagger-android:$daggerVersion"
annotationProcessor "com.google.dagger:dagger-android-processor:$daggerVersion"
// AssistedInject
def assistedInject = '0.6.0'
compileOnly "com.squareup.inject:assisted-inject-annotations-dagger2:$assistedInject"
annotationProcessor "com.squareup.inject:assisted-inject-processor-dagger2:$assistedInject"
androidTestImplementation 'junit:junit:4.13.2'
}
gradle.properties
android.enableJetifier=true
android.useAndroidX=true
org.gradle.jvmargs=-Xmx1536m
kotlin.code.style=official
gradle-wrapper.properties
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.3.3-all.zip
Errors after Rebuild:
FAILURE: Build failed with an exception.
What went wrong: Execution failed for task ':app:checkStagingLocalDevAarMetadata'. A failure occurred while
executing
com.android.build.gradle.internal.tasks.CheckAarMetadataWorkAction
3 issues were found when checking AAR metadata:
Dependency 'androidx.core:core-ktx:1.9.0' requires libraries and applications that
depend on it to compile against version 33 or later of the
Android APIs.
:app is currently compiled against android-32.
Also, the maximum recommended compile SDK version for Android Gradle
plugin 7.2.1 is 32.
Recommended action: Update this project's version of the Android Gradle
plugin to one that supports 33, then update this project to use
compileSdkVerion of at least 33.
Note that updating a library or application's compileSdkVersion (which
allows newer APIs to be used) can be done separately from updating
targetSdkVersion (which opts the app in to new runtime behavior) and
minSdkVersion (which determines which devices the app can be installed
on).
Dependency 'androidx.core:core:1.9.0' requires libraries and applications that
depend on it to compile against version 33 or later of the
Android APIs.
:app is currently compiled against android-32.
Also, the maximum recommended compile SDK version for Android Gradle
plugin 7.2.1 is 32.
Recommended action: Update this project's version of the Android Gradle
plugin to one that supports 33, then update this project to use
compileSdkVerion of at least 33.
Note that updating a library or application's compileSdkVersion (which
allows newer APIs to be used) can be done separately from updating
targetSdkVersion (which opts the app in to new runtime behavior) and
minSdkVersion (which determines which devices the app can be installed
on).
Dependency 'androidx.annotation:annotation-experimental:1.3.0' requires libraries and applications that
depend on it to compile against version 33 or later of the
Android APIs.
:app is currently compiled against android-32.
Also, the maximum recommended compile SDK version for Android Gradle
plugin 7.2.1 is 32.
Recommended action: Update this project's version of the Android Gradle
plugin to one that supports 33, then update this project to use
compileSdkVerion of at least 33.
Note that updating a library or application's compileSdkVersion (which
allows newer APIs to be used) can be done separately from updating
targetSdkVersion (which opts the app in to new runtime behavior) and
minSdkVersion (which determines which devices the app can be installed
on).
When I change compileSdk to 33 :
Task :app:compileStagingLocalDevJavaWithJavac
error: cannot find symbol import
co.abc.client.di.components.DaggerABCApplicationComponent;
^ symbol: class DaggerABCApplicationComponent location: package
co.abc.client.di.components
Now, if I downgrade the core-ktx version to 1.8.0 and change annotationProcessor to kapt :
Task :app:kaptStagingLocalDevKotlin
/StudioProjects/project/app/src/main/java/co/abc/client/di/modules/account/AssistedModule.java:8:
error: cannot find symbol #Module(includes =
AssistedInject_AssistedModule.class)
^ symbol: class AssistedInject_AssistedModule /StudioProjects/project/app/src/main/java/co/abc/client/di/modules/account/AssistedModule.java:9:
error: [ComponentProcessor:MiscError]
dagger.internal.codegen.ComponentProcessor was unable to process this
interface because not all of its dependencies could be resolved. Check
for compilation errors or a circular dependency with generated code.
public interface AssistedModule {}
^ /StudioProjects/project/app/src/main/java/co/abc/client/di/components/ABCApplicationComponent.java:40:
error: [ComponentProcessor:MiscError]
dagger.internal.codegen.ComponentProcessor was unable to process this
interface because not all of its dependencies could be resolved. Check
for compilation errors or a circular dependency with generated code.
public interface ABCApplicationComponent extends
AndroidInjector {
^
Task :app:kaptStagingLocalDevKotlin FAILED
FAILURE: Build failed with an exception.
What went wrong: Execution failed for task ':app:kaptStagingLocalDevKotlin'. A failure occurred while executing
org.jetbrains.kotlin.gradle.internal.KaptWithoutKotlincTask$KaptExecutionWorkAction
java.lang.reflect.InvocationTargetException (no error message)
What could be the issue here? Should the Dagger-related code be written in Kotlin? Is there a source I could refer to for kotlin integration in java code base for android when dagger is there?
So far, I have tried these which didn't work:
upgrading and downgrading versions for kotlin and dagger.
changing all annotationProcessors to kapt
adding this to gradle - -Pandroid.incrementalJavaCompile=false
android {
compileOptions.incremental = false
}
restart ide
Also, I have another project(java code base and kotlin integration setup) which is working with these versions so the issue doesn't seem to be with that. only difference is, dagger is not in my other project and everything runs fine there.
try using the latest version of the dagger in both Gradle
//Hilt
implementation 'com.google.dagger:hilt-android:2.42'
kapt 'com.google.dagger:hilt-android-compiler:2.42'
kapt "androidx.hilt:hilt-compiler:1.0.0"
in App level
classpath 'com.google.dagger:hilt-android-gradle-plugin:2.42'
Maybe it is a version issue
downgrade your kotlin version and then check it
implementation 'org.jetbrains.kotlin:kotlin-stdlib:1.5.30'
implementation 'androidx.core:core-ktx:1.8.0'

Warning "Kotlin plugin version is not the same as library version" (but it is!)

I have an Android studio project in which I have added a Java library module, which I call core. My three Gradle build files look like this.
project/build.gradle
buildscript {
ext.kotlin_version = '1.2.40'
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.0.1'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
}
}
allprojects {
repositories {
google()
jcenter()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
core/build.gradle
apply plugin: 'java-library'
apply plugin: 'kotlin'
dependencies {
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7"
...
}
app/build.gradle
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
android { ... }
dependencies {
implementation project(':core')
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
implementation 'com.android.support.constraint:constraint-layout:1.1.0'
implementation 'com.android.support:appcompat-v7:27.1.1'
androidTestImplementation 'com.android.support.test:runner:1.0.1'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1'
testImplementation 'junit:junit:4.12'
}
The problem I have is that, in core/build.gradle, the kotlin-stdlib-jdk7 line is giving me the warning Plugin version (1.2.40) is not the same as library version (jdk7-1.2.40). I have tried changing it to:
implementation "org.jetbrains.kotlin:kotlin-stdlib"
implementation "org.jetbrains.kotlin:kotlin-stdlib:1.2.40"
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.2.40"
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
implementation "org.jetbrains.kotlin:kotlin-stdlib-jre7:$kotlin_version"
But the warning is still there. The build still runs successfully, and I know I can surpress the warning without any problems and ignore it, but I really want to know why this is happening and how I can get rid of it. I am using Android Studio 3.0.1. Does anyone know of a solution to this?
Starting from Kotlin 1.4 dependency on the standard library added by default:
You no longer need to declare a dependency on the stdlib library in any Kotlin Gradle project, including a multiplatform one. The dependency is added by default.
The automatically added standard library will be the same version of the Kotlin Gradle plugin, since they have the same versioning.
For platform-specific source sets, the corresponding platform-specific variant of the library is used, while a common standard library is added to the rest. The Kotlin Gradle plugin will select the appropriate JVM standard library depending on the kotlinOptions.jvmTarget compiler option of your Gradle build script.
Link to Kotlin Gradle plugin documentation.
This is a bug in the Kotlin plugin. I've filed an issue in the Kotlin issue tracker. You can simply ignore the message.
EDIT: JetBrains marked the issue as a duplicate of KT-23744 "Kotlin library and Gradle plugin versions are different" inspection false positive for non-JVM dependencies".
Solution, in my case, I got rid of the line
implementation"org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
in the app level Gradle and the warning disappear
As the Kotlin page says :
" You no longer need to declare a dependency on the stdlib library in any Kotlin Gradle project, including a multiplatform one. The dependency is added by default.
The automatically added standard library will be the same version of the Kotlin Gradle plugin, since they have the same versioning.
For platform-specific source sets, the corresponding platform-specific variant of the library is used, while a common standard library is added to the rest. The Kotlin Gradle plugin will select the appropriate JVM standard library depending on the kotlinOptions.jvmTarget compiler option of your Gradle build script."
You might be facing this after upgrading kotlin version, Actually, older versions are still in your caches, In this case, you need to do the following steps
Invalidate cache
Clean project
Sync project with gradle files
Now your warning will be gone.
[build.gradle(Module)]
dependencies {
implementation 'org.jetbrains.kotlin:kotlin-stdlib:1.5.10'
implementation 'org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.5.10'
...
}
My project automatically added
(implementation 'org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.5.10')
to the project build file. After moving the implementation to the module file, and removing
(implementation 'org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.5.10')
the warning went away.
The 'stdlib' needs to match the 'stdlib-jdk' in the module file.
I faced the same issue while using Firebase with Kotlin.
I had to upgrade all the dependencies with their latest version available.
Note: have your kotlin-reflect and kotlin-stdlib versions same.
after many days i have solve the issue
Update the kotlin_version to '1.4.32'
In my case, I set the version number for all modules the same as gradle of app as latest version, and problem resolved.

Setting Explict Annotation Processor

I am attempting to add a maven repository to my Android Studio project.
When I do a Gradle project sync everything is fine. However, whenever I try to build my apk, I get this error:
Execution failed for task ':app:javaPreCompileDebug'.
> Annotation processors must be explicitly declared now. The following dependencies on
the compile classpath are found to contain annotation processor. Please add them to
the annotationProcessor configuration.
- classindex-3.3.jar
Alternatively, set android.defaultConfig.javaCompileOptions.annotationProcessorOptions
.includeCompileClasspath = true to continue with previous behavior. Note that this
option is deprecated and will be removed in the future.
See https://developer.android.com/r/tools/annotation-processor-error-message.html for more details.
The link included (https://developer.android.com/r/tools/annotation-processor-error-message.html) in the error 404s so its of no help.
I have enabled annotation processing in the android studio settings, and added includeCompileClasspath = true to my Annotation Processor options. I have also tried adding classindex, classindex-3.3 and classindex-3.3.jar to Processor FQ Name, but that did not help either.
these are the lines I have added to the default build.gradle under dependecies:
dependencies {
...
compile group: 'com.skadistats', name: 'clarity', version:'2.1.1'
compile group: 'org.atteo.classindex', name: 'classindex', version:'3.3'
}
Originally I just had the "clarity" one added, because that is the one I care about, but I added the "classindex" entry in the hopes that it would fix it. Removing "clarity" and keeping "classindex" gives me the exact same error.
I'm not all too familiar with gradle/maven so any help would be appreciated.
To fix the error, simply change the configuration of those dependencies to use annotationProcessor. If a dependency includes components that also need to be on the compile classpath, declare that dependency a second time and use the compile dependency configuration.
For example:
annotationProcessor 'com.jakewharton:butterknife:7.0.1'
compile 'com.jakewharton:butterknife:7.0.1'
This link describes it in detail: https://developer.android.com/studio/preview/features/new-android-plugin-migration.html#annotationProcessor_config
Relevant snippet included for completeness.
Use the annotation processor dependency configuration
In previous versions of the Android plugin for Gradle, dependencies on
the compile classpath were automatically added to the processor
classpath. That is, you could add an annotation processor to the
compile classpath and it would work as expected. However, this causes
a significant impact to performance by adding a large number of
unnecessary dependencies to the processor.
When using the new plugin, annotation processors must be added to the
processor classpath using the annotationProcessor dependency
configuration, as shown below:
dependencies {
...
annotationProcessor 'com.google.dagger:dagger-compiler:' }
The plugin assumes a dependency is an annotation processor if its JAR
file contains the following file: META-
INF/services/javax.annotation.processing.Processor. If the plugin
detects annotation processors on the compile classpath, your build
fails and you get an error message that lists each annotation
processor on the compile classpath. To fix the error, simply change
the configuration of those dependencies to use annotationProcessor. If
a dependency includes components that also need to be on the compile
classpath, declare that dependency a second time and use the compile
dependency configuration.
I was with a similar error. I follow the instructions on the Google link and it works.
try to add the follow instructions to your app gradle file:
defaultConfig {
applicationId "com.yourdomain.yourapp"
minSdkVersion 17
targetSdkVersion 25
versionCode 1
versionName "1.0"
javaCompileOptions {
annotationProcessorOptions {
includeCompileClasspath = false
}
}
}
Attention to -> includeCompileClasspath false
Add this code to your gradle app
defaultConfig{
javaCompileOptions {
annotationProcessorOptions {
includeCompileClasspath true
}
}
}
I found the solution here https://github.com/JakeWharton/butterknife/issues/908
Simply update your butter knife with Annotation processor
compile 'com.jakewharton:butterknife:8.8.1'
annotationProcessor 'com.jakewharton:butterknife-compiler:8.8.1'
i hope it's help you
Add this in defaultConfig
android.defaultConfig.javaCompileOptions.annotationProcessorOptions.includeCompileClasspath = true
In the build.gradle(module app)
apply the plugin:
apply plugin: 'com.jakewharton.butterknife'
Add the following lines in the dependencies section:
annotationProcessor 'com.jakewharton:butterknife-compiler:8.7.0'
implementation 'com.jakewharton:butterknife:8.7.0'
in the build.gradle(Project:projectName), add the classPath in the dependencies like this :
classpath 'com.jakewharton:butterknife-gradle-plugin:8.4.0'
It will fix this issue.
In case if not then add maven:
maven {
url 'https://maven.google.com'
}
If you have dependencies on the compile classpath that include annotation processors you don't need, you can disable the error check by adding the following to your build.gradle file. Keep in mind, the annotation processors you add to the compile classpath are still not added to the processor classpath.
android {
...
defaultConfig {
...
javaCompileOptions {
annotationProcessorOptions {
includeCompileClasspath false
}
}
}
}
If you are experiencing issues migrating to the new dependency resolution strategy, you can restore behavior to that of Android plugin 2.3.0 by setting includeCompileClasspath true. However, restoring behavior to version 2.3.0 is not recommended, and the option to do so will be removed in a future update.
See here https://developer.android.com/r/tools/annotation-processor-error-message.html for more details
If nothing works from above answers add following step as well, specially for new update of Android Studio 3.0.1:
Android Studio 3.0.1:
Add this to your app.gradle file in dependencies:
classpath 'com.neenbedankt.gradle.plugins:android-apt:1.8'
In previous versions of the plugin, dependencies on the compile classpath were automatically added to the processor classpath. That is, you could add an annotation processor to the compile classpath and it would work as expected. However, this causes a significant impact to performance by adding a large number of unnecessary dependencies to the processor.
When using the Android plugin 3.0.0, you must add annotation processors to the processor classpath using the annotationProcessor dependency configuration, as shown below:
dependencies {
...
annotationProcessor 'com.google.dagger:dagger-compiler:<version-number>'
implementation 'com.google.dagger:dagger-compiler:<version-number>'
}

apt dependency scope in Android gradle - what is it used for?

What is the apt dependency scope in android gradle files i see sometimes ?
An example looks like this?
apply plugin: 'com.android.application'
apply plugin: 'com.neenbedankt.android-apt'
android {
compileSdkVersion 20
buildToolsVersion '20.0.0'
defaultConfig {
applicationId "org.ligboy.test.card.module1"
minSdkVersion 14
targetSdkVersion 20
versionCode 1
versionName "1.0"
}
buildTypes {
release {
runProguard false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
final DAGGER_VERSION = '2.0.2'
dependencies {
compile "com.google.dagger:dagger:${DAGGER_VERSION}"
apt "com.google.dagger:dagger-compiler:${DAGGER_VERSION}"//what is this scope
provided 'org.glassfish:javax.annotation:10.0-b28'
}
and in the top level build.gradle file it has this global dependency:
buildscript {
dependencies {
classpath 'com.android.tools.build:gradle:1.3.0'
classpath 'com.neenbedankt.gradle.plugins:android-apt:1.4'
}
}
Notice in the dependencies section there is a apt scope ? i only know of compile, package and provided scope. compile
includes the dependency at compile time and in your package, provided says only include the library at compile time and discard it at
package time so its not included in final build. and Package is the reverse, it includes the dependency in the package and not at compile time.
But what is apt dependency scope which we obviously need the com.neenbedankt.android-apt for it to work so i know its android based.
update:
why cant i use provided dependency scope instead of apt scope ? How do they differ ?
i created a tutorial on dagger dependency scopes for those who need more info.
From the android-apt project page:
The android-apt plugin assists in working with annotation processors in combination with Android Studio. It has two purposes:
Allow to configure a compile time only annotation processor as a dependency, not including the artifact in the final APK or library
Set up the source paths so that code that is generated from the annotation processor is correctly picked up by Android Studio.
You are using Dagger, which uses annotation processing to generate code. The annotation processing code shouldn't be included in the final APK, and you want the generated code to be visible to Android Studio. android-apt enables this behavior.
This sounds very similar to the provided scope, but apt differs from provided in a few key ways. The first difference is that code generated by an apt dependency is available to the IDE, whereas code generated by a provided dependency is not.
Another important difference is that the code in a library using the provided scope is on the IDE classpath (i.e. you can import the classes and attempt to use them), whereas code in an apt dependency is not. With provided, your code will crash at runtime if you don't actually provide the referenced dependencies with a compile scoped counterpart.
You can find a discussion about apt vs provided on this android-apt issue.
In the case of Dagger, there should be no reason to include the annotation processor and code generator in any of your code (which the provided scope would allow). Thus the apt scope is more appropriate.
Update for October 2016:
You probably don't need apt and the android-apt plugin anymore. Version 2.2 of the Android Gradle plugin has an annotationProcessor configuration that you should be using instead.
See more at What's next for android-apt?
Just to add how to change this in Studio 2.2 +
dependencies {
compile 'com.google.dagger:dagger:2.4'
annotationProcessor "com.google.dagger:dagger-compiler:2.4"
}
Add this in apps gradle module. No need to change any other thing.
Happy coding :)

Android Studio, NavDrawer and support library issues

I have a problem using the android support library in my Android Studio project using gradle.
If I add the support-library as dependency I will receive and "Error: Gradle: Execution failed for task ':AppName:dexDebug'.
I have done a some researches and found the problem using the support-library with other dependencies which are using the support libraries as well (greendao 1.3.0).
I would like to use a NavDrawer in my app, so I have to use these support library.
If I remove the support library, of course I will receive an inflate error for the "android.support.v4.widget.DrawerLayout".
Does somebody here has an idea?
I used two kind of dependency-imports
compile files('libs/android-support-v13.jar')
and
compile 'com.android.support:support-v4:13.0.0'
cause of a found post in a forum. But that doesn't work, too.
Thanks for your support.
Regards,
Marine
If your other dependencies also depend on the support lib, you need to make sure they are not using local dependencies (ie embedding the jar file). You should always use only
dependencies {
compile 'com.android.support:support-v4:x.y.z'
}
and not a local dependencies. Make sure all your dependencies do the same and Gradle will automatically detect that everything depends on the same library and only add it once to dex.
I tried it but I receive the dex error as well.
Attached you could see my current gradle build-file.
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:0.5.+'
}
}
apply plugin: 'android'
repositories {
mavenCentral()
}
dependencies {
compile 'com.android.support:support-v4:13.0.0'
compile 'com.google.android.gms:play-services:3.1.36'
compile 'de.greenrobot:greendao:1.3.0'
}
android {
compileSdkVersion 17
buildToolsVersion "17.0.0"
defaultConfig {
minSdkVersion 15
targetSdkVersion 18
}
sourceSets {
main {
java.srcDirs = ['src/main/java', 'src-gen/main/java']
}
}
}
The src-gen folder is used for my greendao generated classes.
Please let me know if you need some more information.
Edit:
I resolved it using the latest greendao version. Added: compile
de.greenrobot:greendao:1.3.1
instead of compile
de.greenrobot:greendao:1.3.0
Now it works.
Regards,
Marine_of_Hell

Categories

Resources