Hie...I am trying to connect to Parse.com but I keep getting the same error over and over again.
Error:Execution failed for task ':app:packageAllDebugClassesForMultiDex'.
java.util.zip.ZipException: duplicate entry: com/parse/AbstractQueryController$1.class
I tried everything I found but nothing seems to help. Any help will be greatly appreciated. Thank you.
apply plugin: 'com.android.application'
android {
compileSdkVersion 23
buildToolsVersion "23.0.1"
defaultConfig {
applicationId "com.example.kudzai.picabay"
minSdkVersion 15
targetSdkVersion 23
versionCode 1
versionName "1.0"
multiDexEnabled true
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:23.1.0'
compile 'com.android.support:design:23.1.0'
compile 'com.android.support:multidex:1.+'
compile 'com.parse:parse-android:1.+'
compile files('libs/bolts-android-1.2.1.jar')
}
Try this build.gradle
apply plugin: 'com.android.application'
apply plugin: 'com.parse'
buildscript {
repositories {
mavenCentral()
maven { url 'https://maven.parse.com/repo' }
}
dependencies {
classpath 'com.parse.tools:gradle:1.+'
}
}
android {
compileSdkVersion 23
buildToolsVersion "23.0.1"
defaultConfig {
applicationId "com.example.kudzai.picabay"
minSdkVersion 15
targetSdkVersion 23
versionCode 1
versionName "1.0"
multiDexEnabled true
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile 'com.android.support:appcompat-v7:23.1.0'
compile 'com.android.support:design:23.1.0'
compile 'com.android.support:multidex:1.+'
compile 'com.parse.bolts:bolts-android:1.2.1'
compile 'com.parse:parse-android:1.10.3'
}
Related
Android Studio displayed this error message when I added the following line to the build.gradle line to the dependencies: compile 'com.android.volley:volley:1.0.0'
apply plugin: 'com.android.application'
android {
compileSdkVersion rootProject.ext.compileSdkVersion
buildToolsVersion rootProject.ext.buildToolsVersion
defaultConfig {
applicationId "com.parse.starter"
minSdkVersion rootProject.ext.minSdkVersion
targetSdkVersion rootProject.ext.targetSdkVersion
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile 'com.android.support:appcompat-v7:22.2.0'
compile 'com.parse.bolts:bolts-tasks:1.3.0'
compile 'com.parse:parse-android:1.13.0'
compile 'com.android.support.constraint:constraint-layout:1.0.0-beta4'
compile 'com.google.code.gson:gson:2.8.0'
compile 'org.jetbrains:annotations-java5:15.0'
compile 'com.android.volley:volley:1.0.0'
}
See if you have jcenter() in your repositories in your project gradle.
For example:
allprojects {
repositories {
jcenter()
maven {
}
ivy {
}
}
}
I'm trying to run my application but it is giving above mentioned error. Unable to find solution. Kindly help. Following is my Gradle code.
apply plugin: 'com.android.application'
android {
compileSdkVersion 24
buildToolsVersion "24.0.0"
defaultConfig {
applicationId "com.example.mabdullahali.trenditch"
minSdkVersion 15
targetSdkVersion 24
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:24.1.1'
}
Add dexOptions in gradle.
Hope this will help you .let me know.
apply plugin: 'com.android.application'
android {
compileSdkVersion 24
buildToolsVersion "24.0.0"
defaultConfig {
applicationId "com.example.mabdullahali.trenditch"
minSdkVersion 15
targetSdkVersion 24
versionCode 1
versionName "1.0"
}
dexOptions {
incremental = true;
preDexLibraries = false
javaMaxHeapSize = "4g"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:24.1.1'
}
change the value
buildToolsVersion "24.0.0"
to
buildToolsVersion "23.0.1"
or installed Build Tool version seen in SDK Manager
apply plugin: 'com.android.application'
android {
compileSdkVersion 23
buildToolsVersion "23.0.3"
defaultConfig {
applicationId "com.example.aman.myapplication"
minSdkVersion 15
targetSdkVersion 23
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:23.3.0'
}
well i can't figure it out i have tried every possible solution i found but nothing worked like this one
Error:(23, 17) Failed to resolve: junit:junit:4.12
the main difference between those two questions is my error is (26,17) and his is (23,17)
here is my build.glade code
apply plugin: 'com.android.application'
repositories {
maven { url 'http://repo1.maven.org/maven2' }
jcenter { url "http://jcenter.bintray.com/" }
}
android {
compileSdkVersion 23
buildToolsVersion "23.0.2"
defaultConfig {
applicationId "com.example.vaio.myapplication2"
minSdkVersion 15
targetSdkVersion 23
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:23.1.1'
compile 'com.android.support:design:23.1.1'
}
i've imported a module in my application. When i try to run it, console show me this error:
**Error:Execution failed for task ':app:dexDebug'.
com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command '/Library/Java/JavaVirtualMachines/jdk1.8.0_65.jdk/Contents/Home/bin/java'' finished with non-zero exit value 2**
I've 2 gradle.
1st gradle (my application)
apply plugin: 'test.test.myapplication'
android {
compileSdkVersion 21
buildToolsVersion "21.1.2"
defaultConfig {
applicationId "alo.com.geoapp"
minSdkVersion 8
targetSdkVersion 19
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
productFlavors {
}
}dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:21.0.3'
compile files('libs/gson-2.2.2.jar')
compile project(':sdktools')}
2nd gradle (module imported)
apply plugin: 'com.android.library'
android {
compileSdkVersion 21
buildToolsVersion "20.0.0"
defaultConfig {
minSdkVersion 8
targetSdkVersion 19
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile files('libs/SKMaps.jar')
compile 'com.google.code.gson:gson:2.2.4'
compile 'com.google.guava:guava:18.0'
compile 'joda-time:joda-time:2.4'}
i've already tried to update my jdk (from 7.* to 8.*), but not resolve.
thank you!
If you have more than 65k methods you should use multidex (http://developer.android.com/tools/building/multidex.html).
on your gradle:
multiDexEnabled true
To check if you have more than 65 methods you should use proguard feature, or more simply use this lib just to check how many methods https://github.com/KeepSafe/dexcount-gradle-plugin?utm_source=Android+Weekly&utm_campaign=553bcbfc02-Android_Weekly_174&utm_medium=email&utm_term=0_4eb677ad19-553bcbfc02-337295057
Your compilesdkversion and targetsdkversion are different update your Targetsdkversion and compilesdkversion same version
apply plugin: 'test.test.myapplication'
android {
compileSdkVersion 21
buildToolsVersion "21.1.2"
defaultConfig {
applicationId "alo.com.geoapp"
minSdkVersion 8
targetSdkVersion 21 //here
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
productFlavors {
}
}
dependencies
{
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:21.0.3'
compile files('libs/gson-2.2.2.jar')
compile project(':sdktools')
}