Unable to load javacv and googlecode in openCV Project - java

I am doing facerecognition in android using openCV but unable to load googlecode and javacv libraries.
Already having javacpp.jar and javacv.jar in
jniLibs
folder
Also used
compile 'com.googlecode.javacpp:javacpp:0.7'
in build.gradle.
My build.gradle is as follows:
apply plugin: 'com.android.application'
android {
compileSdkVersion 24
buildToolsVersion "24.0.3"
defaultConfig {
applicationId "com.example.rsehdev.opencv"
minSdkVersion 18
targetSdkVersion 24
versionCode 1
versionName "1.1"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
sourceSets { main { jni.srcDirs = ['src/main/jni', 'src/main/jniLibs/'] } }
}
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
compile 'com.android.support:appcompat-v7:24.2.1'
testCompile 'junit:junit:4.12'
compile project(':openCVLibrary320')
compile 'com.googlecode.javacpp:javacpp:0.7'
//compile 'com.googlecode.javacv:javacv:0.7'
}

Related

Not able to build APK, duplicate entry: android/support/v4/text/TextUtilsCompat.class

My application can be deployed successfully into my mobile device, but when I try exporting an APK, that can't build properly.
I tried a lot of thing, but can't fix that issue.
If someone have an idea, would be a pleasure :).
Here is my gradle file:
apply plugin: 'com.android.application'
android {
compileSdkVersion 23
buildToolsVersion "23.0.2"
defaultConfig {
applicationId "com.softcaze.clopin"
minSdkVersion 19
targetSdkVersion 23
versionCode 1
versionName "1.0"
multiDexEnabled true
testInstrumentationRunner
"android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'),
'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2',
{
exclude group: 'com.android.support', module: 'support-annotations'
})
compile ('com.google.android.gms:play-services-ads:10.0.0')
compile project(path: ':HoloGraphLibrary')
compile 'com.android.support:appcompat-v7:23.4.0'
compile 'com.android.support:design:23.4.0'
compile 'android.arch.persistence.room:runtime:1.0.0'
//compile 'com.android.support:support-v4:23.4.0'
testCompile 'junit:junit:4.12'
annotationProcessor 'android.arch.persistence.room:compiler:1.0.0'
}
And the error I get is:
Error:Execution failed for task ':app:transformClassesWithJarMergingForDebug'.
com.android.build.api.transform.TransformException: java.util.zip.ZipException: duplicate entry: android/support/v4/text/TextUtilsCompat.class
And the gradle file for : compile project(path: ':HoloGraphLibrary') is
apply plugin: 'com.android.library'
android {
compileSdkVersion 19
buildToolsVersion "25.0.2"
sourceSets {
main {
java.srcDirs = ['src']
res.srcDirs = ['res']
manifest.srcFile 'AndroidManifest.xml'
}
}
}
I can't find a duplicate dependency.

duplicate entry: com/google/android/gms/internal/zzfj.class

Please help me: Here is Screenshot of Error:
Error:Execution failed for task ':app:transformClassesWithJarMergingForDebug'.
com.android.build.api.transform.TransformException: java.util.zip.ZipException: duplicate entry: com/google/android/gms/internal/zzfj.class]1]1
Gradle File: https://drive.google.com/open?id=0BxZ4QxQmqfMHV05oVFc0QmxuTlU
apply plugin: 'com.android.application'
android {
compileSdkVersion 25
buildToolsVersion "25.0.2"
useLibrary 'org.apache.http.legacy'
defaultConfig {
multiDexEnabled true
applicationId "aa.bb"
manifestPlaceholders = [onesignal_app_id : "xxx",
// Project number pulled from dashboard, local value is ignored.
onesignal_google_project_number: "REMOTE"]
minSdkVersion 18
targetSdkVersion 25
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
repositories {
mavenCentral()
maven {
url "https://jitpack.io"
}
maven {
url "https://mint.splunk.com/gradle/"
}
}
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
compile project(':ResideMenu')
compile 'com.google.android.gms:play-services-ads:11.0.4'
compile 'com.android.support:appcompat-v7:25.3.1'
compile 'com.android.support.constraint:constraint-layout:1.0.2'
compile 'com.android.support:design:25.3.1'
compile 'com.android.support:cardview-v7:25.3.1'
compile 'com.mcxiaoke.volley:library-aar:1.0.0'
compile 'com.android.support:recyclerview-v7:25.3.1'
compile 'com.onesignal:OneSignal:[3.5.3,4.0.0)'
compile 'com.squareup.picasso:picasso:2.3.2'
compile 'org.apmem.tools:layouts:1.10#aar'
compile 'com.github.bumptech.glide:glide:3.7.0'
compile 'com.splunk.mint:mint:5.0.0'
compile 'com.android.support:multidex:1.0.1'
compile 'com.github.siyamed:android-shape-imageview:0.9.+#aar'
compile 'com.github.justzak:dilatingdotsprogressbar:1.0.1'
compile 'com.kaopiz:kprogresshud:1.1.0'
testCompile 'junit:junit:4.12'
}

Error: :app:transformClassesWithJarMergingForDebug

I decided to integrate appodeal into the application, did everything according to the instructions, but the result is still the same:
Error:Execution failed for task ':app:transformClassesWithJarMergingForDebug'. com.android.build.api.transform.TransformException: java.util.zip.ZipException: duplicate entry: android/support/v7/widget/DefaultItemAnimator$7.class
I googled this question, but I still could not find a solution.
Here is gradle:
apply plugin: 'com.android.application'
android {
compileSdkVersion 25
buildToolsVersion "25.0.3"
defaultConfig {
applicationId "com.successdev.bookwindev.bookwin"
vectorDrawables.generatedDensities = ['hdpi', 'xxhdpi']
minSdkVersion 17
targetSdkVersion 25
multiDexEnabled true
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
compile project(':caldroidcustom')
compile 'com.github.johnkil.android-robototextview:robototextview:3.0.0'
compile 'com.android.support:appcompat-v7:25.3.1'
compile 'com.android.support:support-v4:25.3.1'
compile 'com.android.support:design:25.3.1'
compile 'com.android.support:recyclerview-v7:25.3.1'
compile 'com.android.support:cardview-v7:25.3.1'
compile 'com.android.support:palette-v7:25.3.1'
compile 'com.aurelhubert:ahbottomnavigation:1.1.8'
compile 'com.bignerdranch.android:expandablerecyclerview:3.0.0-RC1'
compile 'com.iceteck.silicompressorr:silicompressor:2.0'
compile 'com.theartofdev.edmodo:android-image-cropper:2.4.6'
compile project(':cheetah-mobile-3.4.7')
compile 'com.google.android.gms:play-services:11.0.2'
compile 'com.google.android.gms:play-services-ads:11.0.2'
compile 'com.google.android.gms:play-services-location:11.0.2'
testCompile 'junit:junit:4.12'
}
P.S Sorry for my clumsy English =)
Add this to your app's build.gradle:
configurations.all {
resolutionStrategy {
force 'com.android.support:recyclerview-v7:25.3.1'
}
}

Compatibility error when importing picasso library to android studio

this is my build.gradle file
apply plugin: 'com.android.application'
android {
compileSdkVersion 23
buildToolsVersion "25.0.3"
defaultConfig {
applicationId "com.villegas.juliana.dreavel_app"
minSdkVersion 21
targetSdkVersion 23
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
compile 'com.android.support:appcompat-v7:23.4.0'
compile 'com.android.support.constraint:constraint-layout:1.0.0-alpha9'
compile 'com.google.firebase:firebase-database:10.0.1'
compile 'com.squareup.picasso:picasso:2.5.2'
testCompile 'junit:junit:4.12'
}
apply plugin: 'com.google.gms.google-services'
when i copy the picasso dependency it throws this error in this line
compile 'com.android.support:appcompat-v7:23.4.0'
error : All com.android.support libraries must use the exact same version specification (mixing versions can lead to runtime crashes). Found versions 24.0.0, 23.4.0. Examples include com.android.support:support-v4:24.0.0 and com.android.support:animated-vector-drawable:23.4.0 more... (Ctrl+F1)

app:transformClassesWithJarMergingForDebug'. > com.android.build.api.transform.TransformException: java.util.zip.ZipException: duplicate entry

Please need your help...
this my app build.gradle
apply plugin: 'com.android.application'
android {
compileSdkVersion 23
buildToolsVersion '25.0.0'
defaultConfig {
applicationId "com.wiimii"
minSdkVersion 16
targetSdkVersion 23
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'
}
}
}
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
compile 'com.android.support:appcompat-v7:23.4.0'
compile 'com.android.support.constraint:constraint-layout:1.0.2'
compile 'com.google.firebase:firebase-core:9.2.1'
compile 'com.google.firebase:firebase-messaging:9.2.1'
testCompile 'junit:junit:4.12'
compile files('libs/httpcore-4.2.3.jar')
compile files('libs/httpclient-4.0.3.jar')
compile files('libs/httpmime-4.3.jar')
}
apply plugin: 'com.google.gms.google-services'
When i press on "build apk" i get this error:
Error:Execution failed for task ':app:transformClassesWithJarMergingForDebug'.
com.android.build.api.transform.TransformException: java.util.zip.ZipException: duplicate entry: org/apache/http/annotation/Immutable.class
**Finally this the way I fix the problem:**
apply plugin: 'com.android.application'
android {
compileSdkVersion 23
buildToolsVersion '25.0.0'
defaultConfig {
applicationId "com.wiimii"
minSdkVersion 16
targetSdkVersion 23
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'
}
}
//this I adding to fix the http... jar file
packagingOptions {
exclude 'META-INF/DEPENDENCIES.txt'
exclude 'META-INF/LICENSE.txt'
exclude 'META-INF/NOTICE.txt'
exclude 'META-INF/NOTICE'
exclude 'META-INF/LICENSE'
exclude 'META-INF/DEPENDENCIES'
exclude 'META-INF/notice.txt'
exclude 'META-INF/license.txt'
exclude 'META-INF/dependencies.txt'
exclude 'META-INF/LGPL2.1'
}
//necessary
configurations {
all*.exclude group: 'com.android.support', module: 'support-v4'
}
}
dependencies {
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
//also need this for deal with com.android.support.test
exclude group: 'com.android.support', module: 'support-annotations'
})
compile 'com.android.support.constraint:constraint-layout:1.0.2'
compile 'com.google.firebase:firebase-core:9.2.1'
compile 'com.google.firebase:firebase-messaging:9.2.1'
testCompile 'junit:junit:4.12'
compile files('libs/httpcore-4.3.3.jar')
compile files('libs/httpclient-4.3.6.jar')
compile files('libs/httpmime-4.3.6.jar')
//add this jar file manually to libs directory
compile files('libs/android-support-v4.jar')
}
apply plugin: 'com.google.gms.google-services'

Categories

Resources