objectbox / objectbox-java

Android Database - first and fast, lightweight on-device vector database
https://objectbox.io
Apache License 2.0
4.41k stars 302 forks source link

aused by: com.android.tools.r8.utils.AbortException: Error: Program type already present: javax.annotation.CheckForSigned #773

Closed ksamti closed 5 years ago

ksamti commented 5 years ago

after integrating objectbox in encountred the follwing errors:

Objectboxerrorbuild

project gradle /****/ // Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript { ext.objectboxVersion = '2.3.4'

repositories {
    google()
    jcenter()
}
dependencies {
    classpath 'com.android.tools.build:gradle:3.2.0'
    classpath 'com.google.gms:google-services:3.2.0' // google-services plugin
    classpath "io.objectbox:objectbox-gradle-plugin:$objectboxVersion"

    // NOTE: Do not place your application dependencies here; they belong
    // in the individual module build.gradle files
}

}

allprojects { repositories { google() jcenter() maven { url "https://maven.google.com" // Google's Maven repository

    }

}

}

task clean(type: Delete) { delete rootProject.buildDir } /****/ APP gradle /***/

buildscript {

repositories {
    maven { url 'https://maven.fabric.io/public' }
    jcenter()
    google()
}

dependencies {
    // These docs use an open ended version so that our plugin
    // can be updated quickly in response to Android tooling updates

    // We recommend changing it to the latest version from our changelog:
    // https://docs.fabric.io/android/changelog.html#fabric-gradle-plugin
    classpath 'io.fabric.tools:gradle:1.+'
}

}

repositories { maven { url "https://maven.google.com" }

maven {
    url 'https://maven.fabric.io/public'
}
maven {
    url "http://dl.bintray.com/lukaville/maven"
}

} apply plugin: 'com.android.application' apply plugin: 'io.fabric' android { compileSdkVersion 27 defaultConfig {

    testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
    resValue "string", "google_maps_key", (project.findProperty("GOOGLE_MAPS_API_KEY") ?: "")
    //Multidex
    multiDexEnabled true

}
buildTypes {
    release {
        minifyEnabled false
        proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
    }

}

lintOptions {
    disable 'MissingTranslation'
    checkReleaseBuilds false
}
compileOptions {
    sourceCompatibility = '1.8'
    targetCompatibility = '1.8'
}

/*  dexOptions {
      incremental true
      javaMaxHeapSize "12g"
  }*/

} configurations { compile.exclude group: 'androidx.annotation', module: 'annotation' } dependencies { implementation fileTree(include: ['*.jar'], dir: 'libs') implementation 'com.android.support:appcompat-v7:27.0.0' implementation 'com.android.support.constraint:constraint-layout:1.0.2' implementation 'com.android.support:support-v4:27.0.0' 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'

// Android Support Design
implementation 'com.android.support:design:27.0.0'

// card View Support
implementation 'com.android.support:cardview-v7:27.0.0'

// retrofit, gson
implementation 'com.google.code.gson:gson:2.8.0'
implementation 'com.squareup.retrofit2:retrofit:2.3.0'
implementation 'com.squareup.retrofit2:converter-gson:2.3.0'
implementation 'com.squareup.okhttp3:logging-interceptor:3.7.0'
implementation 'com.squareup.okhttp3:okhttp:3.8.0'
implementation 'com.squareup.okhttp3:okhttp-urlconnection:3.7.0'
implementation('com.squareup.retrofit2:converter-simplexml:2.3.0') {
    exclude group: 'xpp3', module: 'xpp3' exclude group: 'stax', module: 'stax-api' exclude group: 'stax', module: 'stax'
}
implementation 'com.squareup.retrofit2:converter-scalars:2.1.0'
implementation "com.squareup.okhttp3:okhttp-urlconnection:3.0.0-RC1"
//cardview
implementation 'com.android.support:cardview-v7:27.0.0'

// butter knife
implementation 'com.jakewharton:butterknife:8.8.1'
annotationProcessor 'com.jakewharton:butterknife-compiler:8.8.1'

//sugar orm
implementation 'com.github.satyan:sugar:1.5'

// api grantland for auto fit text view
implementation 'me.grantland:autofittextview:0.2.+'

//barcode
implementation 'com.journeyapps:zxing-android-embedded:3.5.0'
implementation 'com.google.zxing:core:3.0.1'

//joda date time lib
implementation 'net.danlew:android.joda:2.9.9'

//module swipe refresh
implementation project(path: ':lib')

//dialogs
implementation project(':ldialogs')

// Datetime lib project
implementation project(path: ':datetimelib')

// Swipe menu listview
implementation 'com.baoyz.swipemenulistview:library:1.3.0'

// Google Play services
//implementation 'com.google.android.gms:play-services:12.0.1'

//multidex
implementation 'com.android.support:multidex:1.0.1'

//pdf viewer
implementation 'com.github.barteksc:android-pdf-viewer:2.0.3'

// progress dialog
implementation 'com.github.d-max:spots-dialog:0.4@aar'
implementation 'com.kaopiz:kprogresshud:1.1.0'
implementation 'tech.gusavila92:java-android-websocket-client:1.2.0'

// Crashlytics
implementation('com.crashlytics.sdk.android:crashlytics:2.6.8@aar') {
    transitive = true;
}
implementation 'org.jsoup:jsoup:1.10.1'
implementation files('libs/DataCollection.jar')

//retrofit progress
implementation 'me.jessyan:progressmanager:1.5.0'
implementation 'io.github.lizhangqu:coreprogress:1.0.2'

//seek bar
implementation 'org.adw.library:discrete-seekbar:1.0.1'

// bug finder
implementation 'com.bugfender.sdk:android:1.+'
implementation files('libs/guavalib.jar')

// File Picker
implementation 'com.nbsp:library:1.8'
implementation files('libs/commons-io-2.4.jar')
implementation 'com.google.android.gms:play-services-vision:15.0.0'
implementation 'com.google.android.gms:play-services-maps:15.0.0'
implementation 'com.google.android.gms:play-services-location:15.0.0';

implementation 'com.google.android.gms:play-services-analytics:15.0.2'
implementation 'com.google.android.gms:play-services-auth:15.0.1'
implementation 'com.google.firebase:firebase-appindexing:15.0.1'
implementation 'com.google.android.gms:play-services-ads:15.0.1'
implementation 'com.google.android.gms:play-services-gcm:15.0.1'
implementation 'com.google.android.gms:play-services-plus:15.0.1'
//fcm
implementation 'com.google.firebase:firebase-messaging:15.0.2'

}

apply plugin: "com.google.gms.google-services" apply plugin: 'io.objectbox' // Apply last. /****/

Any help will be appreciated thanks :)

greenrobot-team commented 5 years ago

Look at the output of the Gradle task :buildEnvironment (for plugins) and :app:dependencies (for "regular" dependencies) and check if there are conflicting dependency versions. You might have to exclude or force a specific version of com.google.code.findbugs:jsr305.

ksamti commented 5 years ago

Indeed ,there are a conflict in CheckForSigned class , i exluded com.google.code.findbugs:jsr305 and the compile works fine .thanks a lot