Reputation: 895
Kindly help me, I have searched a lot but couldn't find any solution of this error.
build.gragle:
apply plugin: 'com.android.application'
android {
signingConfigs {
config {
keyAlias 'leadtrak'
keyPassword 'leadtrak1'
storeFile file('/home/sheraz/AndroidStudioProjects/LeadTrak/LeadTrack/docs/LeadTrakKeyStore.jks')
storePassword 'leadtrak1'
}
}
compileSdkVersion 24
buildToolsVersion "24.0.1"
useLibrary 'org.apache.http.legacy'
defaultConfig {
applicationId "leadtrak.activities"
minSdkVersion 9
targetSdkVersion 9
}
buildTypes {
release {
signingConfig signingConfigs.config
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
}
}
lintOptions {
checkReleaseBuilds false
abortOnError false
}
}
dependencies {
compile 'com.android.support:support-v4:24.2.1'
compile 'com.google.android.gms:play-services:+'
compile files('libs/acra-4.4.0.jar')
compile files('libs/commons-codec.jar')
compile files('libs/ksoap2.jar')
compile files('libs/sqlcipher.jar')
compile files('libs/twilioclient-android.jar')
compile files('libs/zip4j_1.3.1.jar')
}
Error log:
Error:warning: Ignoring InnerClasses attribute for an anonymous inner class Error:(net.lingala.zip4j.util.ArchiveMaintainer$1) that doesn't come with an Error:associated EnclosingMethod attribute. This class was probably produced by a Error:compiler that did not target the modern .class file format. The recommended Error:solution is to recompile the class from source, using an up-to-date compiler Error:and without specifying any "-target" type options. The consequence of ignoring Error:this warning is that reflective operations on this class will incorrectly Error:indicate that it is not an inner class. Error:warning: Ignoring InnerClasses attribute for an anonymous inner class Error:(net.lingala.zip4j.unzip.Unzip$1) that doesn't come with an Error:associated EnclosingMethod attribute. This class was probably produced by a Error:compiler that did not target the modern .class file format. The recommended Error:solution is to recompile the class from source, using an up-to-date compiler Error:and without specifying any "-target" type options. The consequence of ignoring Error:this warning is that reflective operations on this class will incorrectly Error:indicate that it is not an inner class. Error:warning: Ignoring InnerClasses attribute for an anonymous inner class Error:(net.lingala.zip4j.unzip.Unzip$2) that doesn't come with an Error:associated EnclosingMethod attribute. This class was probably produced by a Error:compiler that did not target the modern .class file format. The recommended Error:solution is to recompile the class from source, using an up-to-date compiler Error:and without specifying any "-target" type options. The consequence of ignoring Error:this warning is that reflective operations on this class will incorrectly Error:indicate that it is not an inner class. Error:warning: Ignoring InnerClasses attribute for an anonymous inner class Error:(net.lingala.zip4j.util.ArchiveMaintainer$2) that doesn't come with an Error:associated EnclosingMethod attribute. This class was probably produced by a Error:compiler that did not target the modern .class file format. The recommended Error:solution is to recompile the class from source, using an up-to-date compiler Error:and without specifying any "-target" type options. The consequence of ignoring Error:this warning is that reflective operations on this class will incorrectly Error:indicate that it is not an inner class. Error:warning: Ignoring InnerClasses attribute for an anonymous inner class Error:(net.lingala.zip4j.zip.ZipEngine$1) that doesn't come with an Error:associated EnclosingMethod attribute. This class was probably produced by a Error:compiler that did not target the modern .class file format. The recommended Error:solution is to recompile the class from source, using an up-to-date compiler Error:and without specifying any "-target" type options. The consequence of ignoring Error:this warning is that reflective operations on this class will incorrectly Error:indicate that it is not an inner class. Error:The number of method references in a .dex file cannot exceed 64K. Learn how to resolve this issue at https://developer.android.com/tools/building/multidex.html Error:Execution failed for task ':app:transformClassesWithDexForRelease'.
com.android.build.api.transform.TransformException: com.android.ide.common.process.ProcessException: java.util.concurrent.ExecutionException: com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command '/usr/lib/jvm/java-8-oracle/bin/java'' finished with non-zero exit value 2
Upvotes: 5
Views: 12592
Reputation: 1
I got an error similar to this when checking out a project from SVN
what caused it was when SVN finished the check out Android Studio asked if i wanted to create it as a project - and I clicked yes , turns out it already was a project and trying to make it a project within a project broke Gradle's ability to build it - but checking the project out and just opening the folder worked for me
Upvotes: 0
Reputation: 5705
I think this is your main problem
The number of method references in a .dex file cannot exceed 64K.
To solve this put the following lines in your app level gradle file.
Put this line in defaultConfig block
multiDexEnabled true
And add the following dependencies
compile 'com.android.support:multidex:1.0.1'
After this rebuild your project. Hopefully this should resolve your error.
And try avoiding + symbol while adding dependencies in your project as you are doing with play services dependencies
To remove OutOfMemory error add this inside your android block
in app level gradle file.
dexOptions {
//incremental true
javaMaxHeapSize "4g"
}
Upvotes: 11
Reputation: 505
Can you replace and check
defaultConfig {
applicationId "leadtrak.activities"
minSdkVersion 9
targetSdkVersion 9
multiDexEnabled true
}
dexOptions {
javaMaxHeapSize "4g"
}
signingConfigs {
release {
keyAlias 'leadtrak'
keyPassword 'leadtrak1'
storeFile file('/home/sheraz/AndroidStudioProjects/LeadTrak/LeadTrack/docs/LeadTrakKeyStore.jks')
storePassword 'leadtrak1'
}
}
buildTypes {
release {
signingConfig signingConfigs.release
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard- android.txt'), 'proguard-rules.txt'
}
}
dependencies {
compile 'com.android.support:multidex:1.0.0'
compile 'com.android.support:support-v4:24.2.1'
compile 'com.google.android.gms:play-services:+'
compile files('libs/acra-4.4.0.jar')
compile files('libs/commons-codec.jar')
compile files('libs/ksoap2.jar')
compile files('libs/sqlcipher.jar')
compile files('libs/twilioclient-android.jar')
compile files('libs/zip4j_1.3.1.jar')
}
Upvotes: 0