I am using this library https://github.com/mikepenz/MaterialDrawer
when I try run my project I get the following error:
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_31.jdk/Contents/Home/bin/java''
finished with non-zero exit value 2
If I try use jdk1.7
Error:Execution failed for task ':app:dexDebug'.
com.android.ide.common.process.ProcessException:
org.gradle.process.internal.ExecException: Process 'command
'C:\Program Files\Java\jdk1.7.0_45\bin\java.exe'' finished with
non-zero exit value 2
Here is my build.gradle
buildscript {
repositories {
maven { url 'https://maven.fabric.io/public' }
}
dependencies {
classpath 'io.fabric.tools:gradle:1.+'
}
}
apply plugin: 'com.android.application'
apply plugin: 'io.fabric'
repositories {
maven { url 'https://maven.fabric.io/public' }
}
android {
compileSdkVersion 22
buildToolsVersion "22.0.1"
defaultConfig {
applicationId "com.test"
minSdkVersion 14
targetSdkVersion 22
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
productFlavors {
}
packagingOptions {
exclude 'META-INF/DEPENDENCIES'
exclude 'META-INF/NOTICE'
exclude 'META-INF/LICENSE'
exclude 'META-INF/LICENSE.txt'
exclude 'META-INF/NOTICE.txt'
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:22.1.1'
compile 'com.android.support:recyclerview-v7:+'
compile 'com.google.android.gms:play-services:7.5.0'
compile 'com.google.code.gson:gson:2.3'
compile 'com.mcxiaoke.volley:library:1.0.+'
compile fileTree(dir: 'libs/httpclient', include: ['*.jar'])
compile 'com.afollestad:material-dialogs:0.7.6.0'
compile 'com.blunderer:materialdesignlibrary:2.0.0'
compile 'com.github.navasmdc:MaterialDesign:1.5#aar'
//https://github.com/mikepenz
compile('com.mikepenz:materialdrawer:3.1.2#aar') {
transitive = true
}
compile('com.mikepenz:aboutlibraries:5.0.7#aar') {
transitive = true
}
compile('com.crashlytics.sdk.android:crashlytics:2.4.0#aar') {
transitive = true;
}
}
I also tries these solutions, but it does not work:
defaultConfig {
...
multiDexEnabled = true
}
and
dependencies {
...
compile 'com.android.tools.build:gradle:1.1.2'
...
}
Your issue should be fixed by specifying -
defaultConfig {
// Enabling multidex support.
multiDexEnabled true
}
You can read more about it at 65K Method Limit
Related
I am getting this error while i run program in the Android studio.. There is no anyother is here i guess.
Error:Execution failed for task ':app:createDebugMainDexClassList'.
com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command 'C:\Program Files (x86)\Java\jdk1.7.0_06\bin\java.exe'' finished with non-zero exit value 1
Here it is my gradle file copy..
apply plugin: 'com.android.application'
android {
compileSdkVersion 25
buildToolsVersion "25.0.1"
useLibrary 'org.apache.http.legacy'
defaultConfig {
applicationId "app.example.com"
minSdkVersion 14
targetSdkVersion 25
versionCode 1
versionName "1.0"
multiDexEnabled true
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_7
targetCompatibility JavaVersion.VERSION_1_7
}
lintOptions { abortOnError false }
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile files('libs/socialauth-4.9.jar')
compile 'com.android.support:recyclerview-v7:+'
compile project(':linkedin-sdk')
compile 'com.squareup.picasso:picasso:2.5.2'
compile 'org.lucasr.twowayview:twowayview:0.1.4'
compile 'de.hdodenhof:circleimageview:1.2.1'
compile 'com.android.support:appcompat-v7:+'
compile 'com.android.support:design:+'
compile 'com.google.android.gms:play-services:7.3.0'
compile 'com.android.support:multidex:1.0.1'
compile 'com.nostra13.universalimageloader:universal-image-loader:1.9.5'
compile ('org.apache.httpcomponents:httpmime:4.3.5')
{
exclude group: 'org.apache.httpcomponents', module: 'httpclient'
}
}
what's the issue ?
its seems to be multidex issue. just add maximum heap size and multidex library dependency.
android {
dexOptions {
incremental = true;
preDexLibraries = false
javaMaxHeapSize "4g"
}
}
defaultConfig {
multiDexEnabled true
}
also put Dependency
compile 'com.android.support:multidex:1.0.0'
you will also need to extend your application class to MultiDexApplication
public class App extends MultiDexApplication {
#Override
public void onCreate()
{
super.onCreate();
// Initialize
}
#Override
protected void attachBaseContext(Context base)
{
super.attachBaseContext(base);
MultiDex.install(this);
}
}
Don't forgot to make an entry of app class in manifest.
Use this in app build.gradle worked for me
defaultConfig {
// Enabling multidex support.
multiDexEnabled true
}
When I try to generate Signed APK, I am getting the following error
Error:Execution failed for task ':app:transformClassesWithJarMergingForRelease'. > com.android.build.api.transform.TransformException: java.util.zip.ZipException: duplicate entry: com/google/gson/annotations/Expose.class
The Debug APK is working perfectly. After I include Facebook SDK then only I am facing this issue... Can anyone help me how to solve this issue
buildscript {
repositories {
maven { url 'https://maven.fabric.io/public' }
}
dependencies {
classpath 'io.fabric.tools:gradle:1.21.5'
}
}
apply plugin: 'com.android.application'
apply plugin: 'io.fabric'
repositories {
maven { url 'https://maven.fabric.io/public' }
}
android {
compileSdkVersion 25
buildToolsVersion "25.0.2"
defaultConfig {
applicationId "mani.com.howhighru"
minSdkVersion 15
targetSdkVersion 25
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'
}
}
dexOptions {
javaMaxHeapSize "4g"
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:multidex:1.0.1'
compile 'com.google.android.gms:play-services:10.2.0'
compile 'com.googlecode.json-simple:json-simple:1.1'
compile 'com.facebook.android:facebook-android-sdk:[4,5)'
testCompile 'junit:junit:4.12'
compile('com.twitter.sdk.android:twitter:2.3.1#aar') {
transitive = true;
}
}
The error i got is:
Error:Execution failed for task ':app:packageAllDebugClassesForMultiDex'.
java.util.zip.ZipException: duplicate entry: com/google/android/gms/internal/zzqr.class
I have been stuck for hours on this issue.
Here is my Build.Gradle (app file) .
apply plugin: 'com.android.application'
apply plugin: 'io.fabric'
repositories {
maven { url 'https://maven.fabric.io/public' }
}
buildscript {
dependencies {
classpath 'io.fabric.tools:gradle:1.+'
}
repositories {
maven { url 'https://maven.fabric.io/public' }
}
}
android {
compileSdkVersion 23
buildToolsVersion "23.0.2"
defaultConfig {
applicationId "org.my.app"
minSdkVersion 19
targetSdkVersion 23
versionCode 140
versionName "1.4.0"
multiDexEnabled true
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:multidex:1.0.1'
compile 'com.android.support:appcompat-v7:23.2.0'
compile 'com.google.android.gms:play-services-maps:8.4.0'
compile 'com.google.android.gms:play-services-location:7.0.0'
// Android SDK
compile 'com.facebook.android:facebook-android-sdk:4.+'
// Audience Network SDK. Only versions 4.6.0 and above are available
compile 'com.facebook.android:audience-network-sdk:4.+'
compile('com.crashlytics.sdk.android:crashlytics:2.5.5#aar') {
transitive = true;
}
compile 'com.facebook.fresco:fresco:0.9.0+'
compile('com.crashlytics.sdk.android:crashlytics-ndk:1.1.2#aar') {
transitive = true;
}
}
crashlytics {
enableNdk true
androidNdkOut 'src/main/obj'
androidNdkLibsOut 'src/main/libs'
}
You are adding the same class with different versions twice.
You are using the Google play services modules with different releases:
Use:
compile 'com.google.android.gms:play-services-maps:8.4.0'
compile 'com.google.android.gms:play-services-location:8.4.0'
I'm trying to put my finger in android functional testing. Making a first easy Application test case as the following :
public class ApplicationTest extends ApplicationTestCase<App> {
private App myApp;
public ApplicationTest() {
super(App.class);
}
protected void setUp() throws Exception {
super.setUp();
createApplication();
myApp = getApplication();
}
public void testCorrectVersion() throws Exception {
PackageInfo info = myApp.getPackageManager().getPackageInfo(myApp.getPackageName(), 0);
assertNotNull(info);
MoreAsserts.assertMatchesRegex("\\d\\.\\d", info.versionName);
}
}
I just run it with left click and then click on green arrow "Run
Application"
I selected "Debug" variant
And the test Artifact "Android Instrumental Test"
I have "Geny Motion", and want to run the test with it.
Gradle sync well
=> but I run the test case, I get the following error at the end :
:app:transformClassesWithMultidexlistForDebugAndroidTest FAILED
Error:Execution failed for task ':app:transformClassesWithMultidexlistForDebugAndroidTest'.
com.android.build.api.transform.TransformException: com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command '/Library/Java/JavaVirtualMachines/jdk1.7.0_75.jdk/Contents/Home/bin/java'' finished with non-zero exit value 1
Here is my app gradle file :
apply plugin: 'com.android.application'
apply plugin: 'com.google.gms.google-services'
android {
signingConfigs {
release {
if (System.getenv()["CI"]) { // CI=true is exported by Greenhouse
storeFile file(System.getenv()["GH_KEYSTORE_PATH"])
storePassword System.getenv()["GH_KEYSTORE_PASSWORD"]
keyAlias System.getenv()["GH_KEY_ALIAS"]
keyPassword System.getenv()["GH_KEY_PASSWORD"]
} else {
release
}
}
}
compileSdkVersion ANDROID_BUILD_SDK_VERSION
buildToolsVersion ANDROID_BUILD_TOOLS_VERSION
defaultConfig {
applicationId "fr.millezimsolutions.app.millezimu"
targetSdkVersion ANDROID_BUILD_TARGET_SDK_VERSION
minSdkVersion ANDROID_BUILD_MIN_SDK_VERSION
versionCode ANDROID_BUILD_VERSION_CODE
versionName ANDROID_BUILD_APP_VERSION_NAME
multiDexEnabled true
}
buildTypes {
release {
debuggable false
renderscriptOptimLevel 3
signingConfig android.signingConfigs.release
zipAlignEnabled true
minifyEnabled true
shrinkResources true
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro', 'proguard-rules-new.pro'
}
debug {
debuggable true
renderscriptOptimLevel 3
applicationIdSuffix ".debug"
versionNameSuffix "debug"
}
}
configurations{
all*.exclude group: 'cglib'
all*.exclude group: 'commons-collections'
}
dexOptions {
incremental false
preDexLibraries = false
jumboMode = true
javaMaxHeapSize "4g"
}
packagingOptions {
exclude 'META-INF/LICENSE.txt'
exclude 'META-INF/NOTICE.txt'
exclude 'META-INF/LICENSE'
exclude 'META-INF/NOTICE'
exclude 'META-INF/LICENSE-FIREBASE.txt'
exclude 'META-INF/INDEX.LIST'
exclude 'LICENSE.txt'
exclude 'NOTICE'
exclude 'META-INF/DEPENDENCIES'
exclude 'META-INF/license.txt'
exclude 'META-INF/notice.txt'
exclude 'META-INF/ASL2.0'
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_7
targetCompatibility JavaVersion.VERSION_1_7
}
useLibrary 'org.apache.http.legacy'
configurations.all {
resolutionStrategy.force 'com.google.code.gson:gson:2.5'
resolutionStrategy.force 'com.google.guava:guava:19.0'
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
// SUPPORT
compile 'com.android.support:appcompat-v7:23.1.1'
// WORKERS
compile 'de.greenrobot:eventbus:2.4.1'
compile 'com.nostra13.universalimageloader:universal-image-loader:1.9.5'
// SOCIAL NETWORK
compile 'org.twitter4j:twitter4j-core:4.0.4'
compile 'com.facebook.android:facebook-android-sdk:4.8.2'
// TEST
//testCompile 'org.robolectric:robolectric:3.0'
//testCompile "org.robolectric:robolectric:3.0"
testCompile 'junit:junit:4.+'
androidTestCompile 'junit:junit:4.+'
androidTestCompile 'io.appium:java-client:3.3.0'
androidTestCompile 'org.apache.commons:commons-lang3:3.4'
androidTestCompile 'com.google.code.gson:gson:2.5'
// Set this dependency if you want to use the Hamcrest matcher library
testCompile 'org.hamcrest:hamcrest-library:1.3'
// MULTIDEX
compile 'com.android.support:multidex:1.0.1'
// VIEW
compile 'com.android.support:design:23.1.1'
compile 'de.hdodenhof:circleimageview:2.0.0'
compile 'me.relex:circleindicator:1.1.7#aar'
compile 'com.lsjwzh:recyclerviewpager:1.0.8'
compile 'pl.droidsonroids.gif:android-gif-drawable:1.1.11'
compile('com.afollestad.material-dialogs:core:0.8.5.3#aar') {
transitive = true
}
compile project(':MaterialWidget')
compile project(':MultiHeaderRecyclerView')
compile 'com.android.support:cardview-v7:23.1.1'
compile 'me.zhanghai.android.materialprogressbar:library:1.1.4'
// TEXT
compile 'uk.co.chrisjenx:calligraphy:2.1.0'
compile 'com.github.bluejamesbond:textjustify-android:2.1.1'
// FIREBASE
compile 'com.firebaseui:firebase-ui:0.3.0'
compile 'com.firebase:geofire:1.1.1'
compile('com.firebase:firebase-client-android:2.5.0') {
exclude module: 'httpclient'
}
// UTILS
compile 'com.google.code.gson:gson:2.5'
// compile 'me.dm7.barcodescanner:zbar:1.6.3'
compile('com.google.http-client:google-http-client-jackson:1.21.0') {
exclude module: 'xpp3'
exclude group: 'stax'
}
compile 'org.apache.commons:commons-lang3:3.4'
// OAUTH
compile 'com.google.oauth-client:google-oauth-client-java6:1.21.0'
// TIME
compile 'joda-time:joda-time:2.9.1'
compile 'org.ocpsoft.prettytime:prettytime:4.0.1.Final'
// AMAZON WS
compile 'com.amazonaws:aws-android-sdk-core:2.2.9'
compile 'com.amazonaws:aws-android-sdk-cognito:2.2.9'
compile 'com.amazonaws:aws-android-sdk-s3:2.2.9'
// GOOGLE
compile 'com.google.android.gms:play-services:8.3.0'
// RATING STORE
compile project(':AppRate')
// DEBUG
compile 'com.github.brianPlummer:tinydancer:0.0.9'
compile 'com.splunk.mint:mint:4.4.0'
compile 'com.google.android.gms:play-services-analytics:8.3.0'
// debugCompile 'com.squareup.leakcanary:leakcanary-android:1.3.1'
// releaseCompile 'com.squareup.leakcanary:leakcanary-android-no-op:1.3.1'
compile 'com.squareup.leakcanary:leakcanary-android-no-op:1.3.1'
}
if (!System.getenv()["CI"]) {
// Routine pour acceder aux clés de signature
def Properties props = new Properties()
def propFile = file('../../signing.properties')
if (propFile.canRead()) {
props.load(new FileInputStream(propFile))
if (props != null && props.containsKey('STORE_FILE') && props.containsKey('STORE_PASSWORD') &&
props.containsKey('KEY_ALIAS') && props.containsKey('KEY_PASSWORD')) {
android.signingConfigs.release.storeFile = file(props['STORE_FILE'])
android.signingConfigs.release.storePassword = props['STORE_PASSWORD']
android.signingConfigs.release.keyAlias = props['KEY_ALIAS']
android.signingConfigs.release.keyPassword = props['KEY_PASSWORD']
} else {
android.buildTypes.release.signingConfig = null
}
} else {
android.buildTypes.release.signingConfig = null
}
}
println(getVersion().toString())
}
And here is the project gradle file :
buildscript {
repositories {
jcenter()
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.0.0-alpha3'
classpath 'com.google.gms:google-services:1.5.0-beta2'
classpath 'com.github.ben-manes:gradle-versions-plugin:0.11.3'
}
}
allprojects {
repositories {
jcenter()
mavenCentral()
maven {
url "https://jitpack.io"
}
maven {
url 'https://oss.sonatype.org/content/repositories/snapshots/'
}
maven {
url "https://mint.splunk.com/gradle/"
}
}
}
ext {
ANDROID_BUILD_MIN_SDK_VERSION = 16
ANDROID_BUILD_TARGET_SDK_VERSION = 23
ANDROID_BUILD_TOOLS_VERSION = "23.0.1"
ANDROID_BUILD_SDK_VERSION = 23
ANDROID_BUILD_VERSION_CODE = getAppVersionCode()
ANDROID_BUILD_APP_VERSION_NAME = getAppUVersionName()
ANDROID_DEFAULT_BUILD_VERSION_CODE = "24"
ANDROID_DEFAULT_BUILD_APP_VERSION_NAME = 0.4
}
apply plugin: 'com.github.ben-manes.versions'
I'look around for a while, but very difficult to see what it could be.
Error:Execution failed for task ':app:dexDebug'.
com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command 'C:\Program Files\Java\jdk1.7.0_51\bin\java.exe'' finished with non-zero exit value 1
hello i get this error, which i have no idea how to fix.
these are my gradles:
app gradle:
apply plugin: 'com.android.application'
android {
compileSdkVersion 22
buildToolsVersion "23.0.0 rc2"
defaultConfig {
applicationId "com.example.daniel.testing6"
minSdkVersion 15
targetSdkVersion 22
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'])
compile project(path: ':backend', configuration: 'android-endpoints')
//configurations { all*.exclude group: 'com.android.support', module: 'support-v4' }
compile 'com.android.support:appcompat-v7:22.2.1'
compile 'com.google.android.gms:play-services:8.1.0'
compile 'com.android.support:multidex:1.0.0'
compile 'com.android.support:design:22.2.1'
}
backend gradle:
// If you would like more information on the gradle-appengine-plugin please refer to the github page
// https://github.com/GoogleCloudPlatform/gradle-appengine-plugin
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.google.appengine:gradle-appengine-plugin:1.9.18'
}
}
repositories {
jcenter();
}
apply plugin: 'java'
apply plugin: 'war'
apply plugin: 'appengine'
sourceCompatibility = JavaVersion.VERSION_1_7
targetCompatibility = JavaVersion.VERSION_1_7
dependencies {
appengineSdk 'com.google.appengine:appengine-java-sdk:1.9.18'
compile 'com.google.appengine:appengine-endpoints:1.9.18'
compile 'com.google.appengine:appengine-endpoints-deps:1.9.18'
compile 'javax.servlet:servlet-api:2.5'
compile 'com.googlecode.objectify:objectify:4.0b3'
compile 'com.ganyo:gcm-server:1.0.2'
}
appengine {
downloadSdk = true
appcfg {
oauth2 = true
}
endpoints {
getClientLibsOnBuild = true
getDiscoveryDocsOnBuild = true
}
}
project gradle:
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:1.2.3'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
jcenter()
}
}
does any one know how to fix it???