1. Please check the Below Code For
1. When i am Using
Firebase(com.google.firebase:firebase-messaging:10.0.1) and GMS
(compile 'com.google.android.gms:play-services:10.0.1'
) then it gives me error
Error:Execution failed for task ':app:preDexDebug'. com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command '/Library/Java/JavaVirtualMachines/jdk1.8.0_25.jdk/Contents/Home/bin/java'' finished with non-zero exit value 3
2. so i have added this line in gradle File
`
defaultConfig
{
multiDexEnabled true
}
and in dependacies
compile 'com.android.support:multidex:1.0.0'
dexOptions {
javaMaxHeapSize "2g"
}
3.so Code Working fine For Updated Version. and not working for Kitkat 4.4.2 device reason is Appcompact, Material Design not Working on that.So i have added below line code in gradle file
aaptOptions {
additionalParameters "--no-version-vectors"
}
4. And also have dome some changes with menifest file in
<application
android:name="android.support.multidex.MultiDexApplication"
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:supportsRtl="true"
android:theme="@style/AppTheme">
5.Please Check the my Gradle file which working fine For Me you need to do changes .
apply plugin: 'com.android.application'
android {
compileSdkVersion 25
buildToolsVersion "25.0.2"
defaultConfig {
applicationId "com.xyz.projectName"
minSdkVersion 16
targetSdkVersion 25
versionCode 1
versionName "1.0"
multiDexEnabled true
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
dexOptions {
//if 2g or 4g
javaMaxHeapSize "2g"
}
// important to run code on kitkat
aaptOptions {
additionalParameters "--no-version-vectors"
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
testCompile 'junit:junit:4.12'
// multidex
compile 'com.android.support:multidex:1.0.0'
compile 'com.android.support:appcompat-v7:25.1.0'
compile 'com.android.support:design:25.1.0'
compile 'com.android.support:recyclerview-v7:25.1.0'
// ImageLoader
compile 'com.nostra13.universalimageloader:universal-image-loader:1.9.5'
// Map
compile 'com.google.android.gms:play-services:10.0.1'
compile 'com.google.maps.android:android-maps-utils:0.3+'
// Spinner
compile 'com.jaredrummler:material-spinner:1.1.0'
// Volley
compile 'com.android.volley:volley:1.0.0'
//Firebase
compile 'com.google.firebase:firebase-messaging:10.0.1'
compile 'com.google.firebase:firebase-core:10.0.1'
//CropImage
compile project(':CropImage')
}
apply plugin: 'com.google.gms.google-services'
compile project(
. – Quean