When adding This repository in in my Gradle get an error.
i try to build to cloud and got this error
apply plugin: 'com.android.application'
android {
compileSdkVersion 23
buildToolsVersion "23.0.1"
defaultConfig {
applicationId "com.mkurbanov.future"
minSdkVersion 14
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.0.1'
compile 'com.google.firebase:firebase-core:16.0.1'
compile 'com.google.firebase:firebase-storage:16.0.4'
compile 'com.firebaseui:firebase-ui-storage:4.1.0'
}
apply plugin: 'com.google.gms.google-services'*
The error:
Information:Gradle tasks [:app:generateDebugSources, :app:generateDebugAndroidTestSources, :app:compileDebugSources, :app:compileDebugAndroidTestSources]
Could not find google-services.json while looking in [src/nullnull/debug, src/debug/nullnull, src/nullnull, src/debug, src/nullnullDebug]
Could not find google-services.json while looking in [src/nullnull/release, src/release/nullnull, src/nullnull, src/release, src/nullnullRelease]
:app:preBuild UP-TO-DATE
:app:preDebugBuild UP-TO-DATE
:app:checkDebugManifest
:app:preReleaseBuild UP-TO-DATE
:app:prepareAndroidArchCoreRuntime110Library UP-TO-DATE
:app:prepareAndroidArchLifecycleLivedataCore110Library UP-TO-DATE
:app:prepareAndroidArchLifecycleRuntime110Library UP-TO-DATE
:app:prepareAndroidArchLifecycleViewmodel110Library UP-TO-DATE
:app:prepareComAndroidSupportAppcompatV72301Library UP-TO-DATE
:app:prepareComAndroidSupportSupportCompat2711Library UP-TO-DATE
:app:prepareComAndroidSupportSupportCoreUi2711Library UP-TO-DATE
:app:prepareComAndroidSupportSupportCoreUtils2711Library UP-TO-DATE
:app:prepareComAndroidSupportSupportFragment2711Library UP-TO-DATE
:app:prepareComAndroidSupportSupportMediaCompat2711Library UP-TO-DATE
:app:prepareComAndroidSupportSupportV42711Library UP-TO-DATE
:app:prepareComFirebaseuiFirebaseUiStorage410Library UP-TO-DATE
:app:prepareComGithubBumptechGlideGifdecoder471Library UP-TO-DATE
:app:prepareComGithubBumptechGlideGlide471Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesAdsIdentifier1501Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesBase1601Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesBasement1601Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesMeasurementBase1600Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesStats1501Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesTasks1601Library UP-TO-DATE
:app:prepareComGoogleFirebaseFirebaseAnalytics1601Library UP-TO-DATE
:app:prepareComGoogleFirebaseFirebaseAnalyticsImpl1611Library UP-TO-DATE
:app:prepareComGoogleFirebaseFirebaseCommon1603Library UP-TO-DATE
:app:prepareComGoogleFirebaseFirebaseCore1601Library UP-TO-DATE
:app:prepareComGoogleFirebaseFirebaseIid1600Library UP-TO-DATE
:app:prepareComGoogleFirebaseFirebaseIidInterop1600Library UP-TO-DATE
:app:prepareComGoogleFirebaseFirebaseMeasurementConnector1600Library UP-TO-DATE
:app:prepareComGoogleFirebaseFirebaseMeasurementConnectorImpl1601Library UP-TO-DATE
:app:prepareComGoogleFirebaseFirebaseStorage1604Library UP-TO-DATE
:app:prepareDebugDependencies
:app:compileDebugAidl UP-TO-DATE
:app:compileDebugRenderscript
:app:generateDebugBuildConfig UP-TO-DATE
:app:generateDebugAssets UP-TO-DATE
:app:mergeDebugAssets UP-TO-DATE
:app:generateDebugResValues UP-TO-DATE
:app:processDebugGoogleServices
Parsing json file: C:\Users\admin\AndroidStudioProjects\Future\app\google-services.json
:app:generateDebugResources
:app:mergeDebugResources UP-TO-DATE
:app:processDebugManifest
C:\Users\admin\AndroidStudioProjects\Future\app\src\main\AndroidManifest.xml Error:
uses-sdk:minSdkVersion 14 cannot be smaller than version 16 declared in library [com.firebaseui:firebase-ui-storage:4.1.0] C:\Users\admin\AndroidStudioProjects\Future\app\build\intermediates\exploded-aar\com.firebaseui\firebase-ui-storage\4.1.0\AndroidManifest.xml
Suggestion: use tools:overrideLibrary="com.firebase.ui.storage" to force usage
Error:Execution failed for task ':app:processDebugManifest'.
> Manifest merger failed : uses-sdk:minSdkVersion 14 cannot be smaller than version 16 declared in library [com.firebaseui:firebase-ui-storage:4.1.0] C:\Users\admin\AndroidStudioProjects\Future\app\build\intermediates\exploded-aar\com.firebaseui\firebase-ui-storage\4.1.0\AndroidManifest.xml
Suggestion: use tools:overrideLibrary="com.firebase.ui.storage" to force usage
Information:BUILD FAILED
Information:Total time: 15.324 secs
Information:1 error
Information:0 warnings
Information:See complete output in console
Build script:
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:1.3.0'
classpath 'com.google.gms:google-services:4.0.1'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
maven {
url "https://maven.google.com"
}
jcenter()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
The error and how to solve it are written in your stacktrace:
uses-sdk:minSdkVersion 14 cannot be smaller than version 16 declared in library [com.firebaseui:firebase-ui-storage:4.1.0] C:\Users\admin\AndroidStudioProjects\Future\app\build\intermediates\exploded-aar\com.firebaseui\firebase-ui-storage\4.1.0\AndroidManifest.xml
Suggestion: use tools:overrideLibrary="com.firebase.ui.storage" to force usage
now such a mistake:
ERROR: In <declare-styleable> FontFamilyFont, unable to find attribute android:fontWeight
Error:Execution failed for task ':app:processDebugResources'.
> com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command 'C:\Users\admin\AppData\Local\Android\sdk\build-tools\23.0.1\aapt.exe'' finished with non-zero exit value 1
Related
It's my first time using the Firebase, I've walked with each step in the video and document provided by Firebase for android, but I am facing this error when i run my project.
Information:Gradle tasks [:app:assembleDebug]
Could not find google-services.json while looking in [src/nullnull/debug, src/debug/nullnull, src/nullnull, src/debug, src/nullnullDebug]
Could not find google-services.json while looking in [src/nullnull/release, src/release/nullnull, src/nullnull, src/release, src/nullnullRelease]
:app:preBuild UP-TO-DATE
:app:preDebugBuild UP-TO-DATE
:app:checkDebugManifest
:app:preReleaseBuild UP-TO-DATE
:app:prepareComAndroidSupportAnimatedVectorDrawable2421Library UP-TO-DATE
:app:prepareComAndroidSupportAppcompatV72421Library UP-TO-DATE
:app:prepareComAndroidSupportSupportCompat2520Library UP-TO-DATE
:app:prepareComAndroidSupportSupportCoreUi2520Library UP-TO-DATE
:app:prepareComAndroidSupportSupportCoreUtils2520Library UP-TO-DATE
:app:prepareComAndroidSupportSupportFragment2520Library UP-TO-DATE
:app:prepareComAndroidSupportSupportMediaCompat2520Library UP-TO-DATE
:app:prepareComAndroidSupportSupportV42520Library UP-TO-DATE
:app:prepareComAndroidSupportSupportVectorDrawable2421Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesBasement1180Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesBasementLicense1180Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesTasks1180Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesTasksLicense1180Library UP-TO-DATE
:app:prepareComGoogleFirebaseFirebaseAnalytics1180Library UP-TO-DATE
:app:prepareComGoogleFirebaseFirebaseAnalyticsImpl1180Library UP-TO-DATE
:app:prepareComGoogleFirebaseFirebaseAnalyticsImplLicense1180Library UP-TO-DATE
:app:prepareComGoogleFirebaseFirebaseAnalyticsLicense1180Library UP-TO-DATE
:app:prepareComGoogleFirebaseFirebaseCommon1180Library UP-TO-DATE
:app:prepareComGoogleFirebaseFirebaseCommonLicense1180Library UP-TO-DATE
:app:prepareComGoogleFirebaseFirebaseCore1180Library UP-TO-DATE
:app:prepareComGoogleFirebaseFirebaseFirestore1180Library UP-TO-DATE
:app:prepareComGoogleFirebaseFirebaseIid1180Library UP-TO-DATE
:app:prepareComGoogleFirebaseFirebaseIidLicense1180Library UP-TO-DATE
:app:prepareDebugDependencies
:app:compileDebugAidl UP-TO-DATE
:app:compileDebugRenderscript UP-TO-DATE
:app:generateDebugBuildConfig UP-TO-DATE
:app:mergeDebugShaders UP-TO-DATE
:app:compileDebugShaders UP-TO-DATE
:app:generateDebugAssets UP-TO-DATE
:app:mergeDebugAssets UP-TO-DATE
:app:generateDebugResValues UP-TO-DATE
:app:processDebugGoogleServices
Parsing json file: C:\Users\myPc\AndroidStudioProjects\Try\app\google-services.json
:app:generateDebugResources
:app:mergeDebugResources UP-TO-DATE
:app:processDebugManifest UP-TO-DATE
:app:processDebugResources UP-TO-DATE
:app:generateDebugSources UP-TO-DATE
:app:incrementalDebugJavaCompilationSafeguard
:app:compileDebugJavaWithJavac
:app:compileDebugJavaWithJavac - is not incremental (e.g. outputs have changed, no previous execution, etc.).
:app:compileDebugNdk UP-TO-DATE
:app:compileDebugSources
:app:prePackageMarkerForDebug
:app:transformClassesWithDexForDebug
To run dex in process, the Gradle daemon needs a larger heap.
It currently has approximately 910 MB.
For faster builds, increase the maximum heap size for the Gradle daemon to more than 2048 MB.
To do this set org.gradle.jvmargs=-Xmx2048M in the project gradle.properties.
For more information see https://docs.gradle.org/current/userguide/build_environment.html
:app:mergeDebugJniLibFolders UP-TO-DATE
:app:transformNative_libsWithMergeJniLibsForDebug UP-TO-DATE
:app:processDebugJavaRes UP-TO-DATE
:app:transformResourcesWithMergeJavaResForDebug FAILED
Error:Execution failed for task ':app:transformResourcesWithMergeJavaResForDebug'.
com.android.build.api.transform.TransformException: com.android.builder.packaging.DuplicateFileException: Duplicate files copied in APK META-INF/maven/com.squareup.okhttp/okhttp/pom.xml
File1: C:\Users\myPc\.gradle\caches\modules-2\files- 2.1\com.squareup.okhttp\okhttp\2.7.2\20f6463eb19ac61960c5d91a094c2f4f0727dc2e\okhttp-2.7.2.jar
File2: C:\Users\myPc\AndroidStudioProjects\Try\app\build\intermediates\exploded-aar\com.google.firebase\firebase-firestore\11.8.0\jars\classes.jar
Information:BUILD FAILED
Information:Total time: 1 mins 1.894 secs
Information:1 error
Information:0 warnings
Information:See complete output in console
I have added the path and dependencies required:
This is my build.gradle(project:Try)
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.1.2'
classpath 'com.google.gms:google-services:3.2.0'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
jcenter()
maven {
url 'https://maven.google.com'
}
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
and this is my build.gradle(Module:app)
apply plugin: 'com.android.application'
android {
compileSdkVersion 24
buildToolsVersion "25.0.3"
defaultConfig {
applicationId "com.salmasamy.trytrytry"
minSdkVersion 19
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.2.1'
compile 'com.google.firebase:firebase-core:11.8.0'
compile 'com.google.firebase:firebase-firestore:11.8.0'
}
apply plugin: 'com.google.gms.google-services'
I have also added the google-services.json file in project->app folder and made sure there was no extra spaces, and that I have google play services and google repository with the right versions.
When I build the project everything is okay, but I get this only when I run it.
because you should use gradle 3.+
buildscript {
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.0.1'
classpath 'com.google.gms:google-services:3.1.1'
}
}
allprojects {
repositories {
maven { url 'https://maven.google.com' }
jcenter()
}
}
i am wroking on a app where am share content on sacial media but now i faced a problem like i spend 2-3 day for this error that why i am posting this question please help me
Information:Gradle tasks [:app:assembleDebug]
Observed package id 'add-ons;addon-google_apis-google-23' in inconsistent location 'C:\Users\Amit Basliyal\AppData\Local\Android\Sdk\add-ons\addon-google_apis-google-23-1' (Expected 'C:\Users\Amit Basliyal\AppData\Local\Android\Sdk\add-ons\addon-google_apis-google-23')
:app:preBuild UP-TO-DATE
:app:preDebugBuild UP-TO-DATE
:app:checkDebugManifest
:app:preReleaseBuild UP-TO-DATE
:app:prepareComAndroidSupportAnimatedVectorDrawable2340Library UP-TO-DATE
:app:prepareComAndroidSupportAppcompatV72340Library UP-TO-DATE
:app:prepareComAndroidSupportDesign2340Library UP-TO-DATE
:app:prepareComAndroidSupportMultidex101Library UP-TO-DATE
:app:prepareComAndroidSupportRecyclerviewV72340Library UP-TO-DATE
:app:prepareComAndroidSupportSupportV42340Library UP-TO-DATE
:app:prepareComAndroidSupportSupportVectorDrawable2340Library UP-TO-DATE
:app:prepareDebugDependencies
:app:compileDebugAidl UP-TO-DATE
:app:compileDebugRenderscript UP-TO-DATE
:app:generateDebugBuildConfig UP-TO-DATE
:app:mergeDebugShaders UP-TO-DATE
:app:compileDebugShaders UP-TO-DATE
:app:generateDebugAssets UP-TO-DATE
:app:mergeDebugAssets UP-TO-DATE
:app:generateDebugResValues UP-TO-DATE
:app:generateDebugResources UP-TO-DATE
:app:mergeDebugResources UP-TO-DATE
:app:processDebugManifest UP-TO-DATE
:app:processDebugResources UP-TO-DATE
:app:generateDebugSources UP-TO-DATE
:app:incrementalDebugJavaCompilationSafeguard UP-TO-DATE
:app:compileDebugJavaWithJavac UP-TO-DATE
:app:compileDebugNdk UP-TO-DATE
:app:compileDebugSources UP-TO-DATE
:app:prePackageMarkerForDebug
:app:transformClassesWithJarMergingForDebug UP-TO-DATE
:app:collectDebugMultiDexComponents UP-TO-DATE
:app:transformClassesWithMultidexlistForDebug UP-TO-DATE
:app:transformClassesWithDexForDebug
Error:Error converting bytecode to dex:
Cause: java.lang.RuntimeException: Exception parsing classes
Error:1 error; aborting
Error:Execution failed for task ':app:transformClassesWithDexForDebug'.
> 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 'C:\Program Files\Java\jdk1.8.0_91\bin\java.exe'' finished with non-zero exit value 1
Information:BUILD FAILED
Information:Total time: 14.241 secs
Information:3 errors
Information:0 warnings
Information:See complete output in console
and
my gradle is
apply plugin: 'com.android.application'
android {
compileSdkVersion 23
buildToolsVersion "23.0.3"
useLibrary 'org.apache.http.legacy'
defaultConfig {
applicationId "com.example.myapp"
minSdkVersion 16
targetSdkVersion 23
versionCode 1
versionName "1.0"
multiDexEnabled true
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
dexOptions {
jumboMode true
incremental true
dexInProcess false
javaMaxHeapSize "2g"
preDexLibraries = false
}
}
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
testCompile 'junit:junit:4.12'
compile 'com.squareup.okhttp:okhttp:2.0.0'
compile 'com.google.code.gson:gson:2.2.4'
compile 'com.facebook.android:facebook-android-sdk:4.5.0'
compile 'com.android.support:appcompat-v7:23.4.0'
compile 'com.android.support:design:23.4.0'
compile 'com.android.support:multidex:1.0.0'
compile 'com.google.android.gms:play-services:9.0.2'
compile 'com.google.android.gms:play-services-identity:9.0.2'
compile 'com.google.android.gms:play-services-maps:9.0.2'
compile 'com.google.android.gms:play-services-gcm:9.0.2'
compile 'com.google.android.gms:play-services-auth:9.0.2'
compile 'com.google.android.gms:play-services-appindexing:9.0.2'
}
apply plugin: 'com.google.gms.google-services'
and
build 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:2.1.2'
classpath 'com.google.gms:google-services:3.0.0'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
jcenter()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
I have a android project of e-commerce app. It is published on also app store. I have updated some thing in my app like com.google.android.gms:play-services:8.3.0 to com.google.android.gms:play-services:9.0.0. After that when i run app on local device its run perfact but when i generated Signed Apk this give error like below
Information:Gradle tasks [:app:assembleRelease]
:app:preBuild UP-TO-DATE
:app:preReleaseBuild UP-TO-DATE
:app:checkReleaseManifest
:app:preDebugBuild UP-TO-DATE
:niceSpinner:preBuild UP-TO-DATE
:niceSpinner:preReleaseBuild UP-TO-DATE
:niceSpinner:compileReleaseNdk UP-TO-DATE
:niceSpinner:compileLint
:niceSpinner:copyReleaseLint UP-TO-DATE
:niceSpinner:checkReleaseManifest
:niceSpinner:preDebugAndroidTestBuild UP-TO-DATE
:niceSpinner:preDebugBuild UP-TO-DATE
:niceSpinner:preDebugUnitTestBuild UP-TO-DATE
:niceSpinner:preReleaseUnitTestBuild UP-TO-DATE
:niceSpinner:prepareComAndroidSupportAppcompatV72311Library UP-TO-DATE
:niceSpinner:prepareComAndroidSupportSupportV42311Library UP-TO-DATE
:niceSpinner:prepareReleaseDependencies
:niceSpinner:compileReleaseAidl UP-TO-DATE
:niceSpinner:compileReleaseRenderscript UP-TO-DATE
:niceSpinner:generateReleaseBuildConfig UP-TO-DATE
:niceSpinner:mergeReleaseShaders UP-TO-DATE
:niceSpinner:compileReleaseShaders UP-TO-DATE
:niceSpinner:generateReleaseAssets UP-TO-DATE
:niceSpinner:mergeReleaseAssets UP-TO-DATE
:niceSpinner:generateReleaseResValues UP-TO-DATE
:niceSpinner:generateReleaseResources UP-TO-DATE
:niceSpinner:mergeReleaseResources UP-TO-DATE
:niceSpinner:processReleaseManifest UP-TO-DATE
:niceSpinner:processReleaseResources UP-TO-DATE
:niceSpinner:generateReleaseSources UP-TO-DATE
:niceSpinner:incrementalReleaseJavaCompilationSafeguard UP-TO-DATE
:niceSpinner:compileReleaseJavaWithJavac UP-TO-DATE
:niceSpinner:extractReleaseAnnotations UP-TO-DATE
:niceSpinner:mergeReleaseProguardFiles UP-TO-DATE
:niceSpinner:packageReleaseRenderscript UP-TO-DATE
:niceSpinner:packageReleaseResources UP-TO-DATE
:niceSpinner:processReleaseJavaRes UP-TO-DATE
:niceSpinner:transformResourcesWithMergeJavaResForRelease UP-TO-DATE
:niceSpinner:transformClassesAndResourcesWithSyncLibJarsForRelease UP-TO-DATE
:niceSpinner:mergeReleaseJniLibFolders UP-TO-DATE
:niceSpinner:transformNative_libsWithMergeJniLibsForRelease UP-TO-DATE
:niceSpinner:transformNative_libsWithSyncJniLibsForRelease UP-TO-DATE
:niceSpinner:bundleRelease UP-TO-DATE
:app:prepareComAndroidSupportAnimatedVectorDrawable2340Library UP-TO-DATE
:app:prepareComAndroidSupportAppcompatV72340Library UP-TO-DATE
:app:prepareComAndroidSupportCardviewV72321Library UP-TO-DATE
:app:prepareComAndroidSupportDesign2340Library UP-TO-DATE
:app:prepareComAndroidSupportMediarouterV72300Library UP-TO-DATE
:app:prepareComAndroidSupportMultidex101Library UP-TO-DATE
:app:prepareComAndroidSupportRecyclerviewV72340Library UP-TO-DATE
:app:prepareComAndroidSupportSupportV42340Library UP-TO-DATE
:app:prepareComAndroidSupportSupportVectorDrawable2340Library UP-TO-DATE
:app:prepareComBignerdranchAndroidExpandablerecyclerview203Library UP-TO-DATE
:app:prepareComDaimajiaSliderLibrary115Library UP-TO-DATE
:app:prepareComDaimajiaSwipelayoutLibrary120Library UP-TO-DATE
:app:prepareComFacebookAndroidFacebookAndroidSdk450Library UP-TO-DATE
:app:prepareComGithubShellSoftwareFab112Library UP-TO-DATE
:app:prepareComGithubShellSoftwareUitools110Library UP-TO-DATE
:app:prepareComGithubShellSoftwareViewmover110Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServices900Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesAds900Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesAdsLite900Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesAnalytics900Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesAnalyticsImpl900Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesAppindexing900Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesAppinvite900Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesAuth900Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesAuthBase900Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesBase900Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesBasement900Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesCast900Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesDrive900Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesFitness900Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesGames900Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesGcm900Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesIdentity900Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesIid900Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesLocation900Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesMaps900Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesNearby900Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesPanorama900Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesPlus900Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesSafetynet900Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesTagmanager900Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesTagmanagerApi900Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesTasks900Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesVision900Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesWallet900Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesWearable900Library UP-TO-DATE
:app:prepareComGoogleFirebaseFirebaseAnalytics900Library UP-TO-DATE
:app:prepareComGoogleFirebaseFirebaseAnalyticsImpl900Library UP-TO-DATE
:app:prepareComGoogleFirebaseFirebaseAuth900Library UP-TO-DATE
:app:prepareComGoogleFirebaseFirebaseAuthCommon900Library UP-TO-DATE
:app:prepareComGoogleFirebaseFirebaseAuthModule900Library UP-TO-DATE
:app:prepareComGoogleFirebaseFirebaseCommon900Library UP-TO-DATE
:app:prepareComGoogleFirebaseFirebaseConfig900Library UP-TO-DATE
:app:prepareComGoogleFirebaseFirebaseCore900Library UP-TO-DATE
:app:prepareComGoogleFirebaseFirebaseCrash900Library UP-TO-DATE
:app:prepareComGoogleFirebaseFirebaseDatabase900Library UP-TO-DATE
:app:prepareComGoogleFirebaseFirebaseDatabaseConnection900Library UP-TO-DATE
:app:prepareComGoogleFirebaseFirebaseIid900Library UP-TO-DATE
:app:prepareComGoogleFirebaseFirebaseMessaging900Library UP-TO-DATE
:app:prepareComGoogleFirebaseFirebaseStorage900Library UP-TO-DATE
:app:prepareComGoogleFirebaseFirebaseStorageCommon900Library UP-TO-DATE
:app:prepareComIntuitSdpSdpAndroid102Library UP-TO-DATE
:app:prepareComMakeramenRoundedimageview221Library UP-TO-DATE
:app:prepareComMarshalchenUltimaterecyclerviewLibrary0318Library UP-TO-DATE
:app:prepareComMiguelcatalanMaterialsearchview130Library UP-TO-DATE
:app:prepareComMikepenzActionitembadge318Library UP-TO-DATE
:app:prepareComMikepenzIconicsCore220Library UP-TO-DATE
:app:prepareComRengwuxianMaterialedittextLibrary203Library UP-TO-DATE
:app:prepareComWdullaerMaterialdatetimepicker202Library UP-TO-DATE
:app:prepareComWeiwangcnBetterspinnerLibraryMaterial110Library UP-TO-DATE
:app:prepareInSrainCubeUltraPtr1010Library UP-TO-DATE
:app:prepareNeedDepartmentalStoreNiceSpinnerUnspecifiedLibrary UP-TO-DATE
:app:prepareReleaseDependencies
:app:compileReleaseAidl
:app:compileReleaseRenderscript
:app:generateReleaseBuildConfig
:app:mergeReleaseShaders
:app:compileReleaseShaders
:app:generateReleaseAssets
:app:mergeReleaseAssets
:app:processReleaseManifest
:app:fabricGenerateResourcesRelease
:app:generateReleaseResValues UP-TO-DATE
:app:processReleaseGoogleServices
Parsing json file: /Users/dp/Desktop/current Project/NeedDepartmentalStore/app/google-services.json
:app:generateReleaseResources
:app:mergeReleaseResources
:app:processReleaseResources
:app:generateReleaseSources
:app:incrementalReleaseJavaCompilationSafeguard
:app:compileReleaseJavaWithJavac
:app:compileReleaseJavaWithJavac - is not incremental (e.g. outputs have changed, no previous execution, etc.).
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
:app:compileReleaseNdk UP-TO-DATE
:app:compileReleaseSources
:app:lintVitalRelease
:app:prePackageMarkerForRelease
:app:transformClassesWithJarMergingForRelease
:app:collectReleaseMultiDexComponents
:app:transformClassesWithMultidexlistForRelease
ProGuard, version 5.2.1
Reading program jar [/Users/dp/Desktop/current Project/NeedDepartmentalStore/app/build/intermediates/transforms/jarMerging/release/jars/1/1f/combined.jar]
Reading library jar [/Users/dp/Library/Android/sdk/build-tools/23.0.3/lib/shrinkedAndroid.jar]
Preparing output jar [/Users/dp/Desktop/current Project/NeedDepartmentalStore/app/build/intermediates/multi-dex/release/componentClasses.jar]
Copying resources from program jar [/Users/dp/Desktop/current Project/NeedDepartmentalStore/app/build/intermediates/transforms/jarMerging/release/jars/1/1f/combined.jar]
:app:transformClassesWithDexForRelease
To run dex in process, the Gradle daemon needs a larger heap.
It currently has approximately 910 MB.
For faster builds, increase the maximum heap size for the Gradle daemon to more than 2048 MB.
To do this set org.gradle.jvmargs=-Xmx2048M in the project gradle.properties.
For more information see https://docs.gradle.org/current/userguide/build_environment.html
Error:UNEXPECTED TOP-LEVEL ERROR:
Error:java.lang.OutOfMemoryError: GC overhead limit exceeded
Error: at java.util.zip.InflaterInputStream.<init>(InflaterInputStream.java:88)
Error: at java.util.zip.ZipFile$ZipFileInflaterInputStream.<init>(ZipFile.java:393)
Error: at java.util.zip.ZipFile.getInputStream(ZipFile.java:374)
Error: at com.android.dx.cf.direct.ClassPathOpener.processArchive(ClassPathOpener.java:270)
Error: at com.android.dx.cf.direct.ClassPathOpener.processOne(ClassPathOpener.java:166)
Error: at com.android.dx.cf.direct.ClassPathOpener.process(ClassPathOpener.java:144)
Error: at com.android.dx.command.dexer.Main.processOne(Main.java:672)
Error: at com.android.dx.command.dexer.Main.processAllFiles(Main.java:569)
Error: at com.android.dx.command.dexer.Main.runMultiDex(Main.java:366)
Error: at com.android.dx.command.dexer.Main.run(Main.java:275)
Error: at com.android.dx.command.dexer.Main.main(Main.java:245)
Error: at com.android.dx.command.Main.main(Main.java:106)
:app:transformClassesWithDexForRelease FAILED
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 '/Library/Java/JavaVirtualMachines/jdk1.8.0_73.jdk/Contents/Home/bin/java'' finished with non-zero exit value 3
Information:BUILD FAILED
Information:Total time: 4 mins 2.184 secs
Information:15 errors
Information:0 warnings
Information:See complete output in console
Below is app.gradle file
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 23
buildToolsVersion '23.0.3'
defaultConfig {
applicationId "com.dp.needdepartmentalstore"
minSdkVersion 14
targetSdkVersion 23
versionCode 28
versionName "5.15"
multiDexEnabled true
manifestPlaceholders = [manifestApplicationId : "${applicationId}",
onesignal_app_id : "16c778cf-8ebc-47a8-9ba8-6815f0223a0e",
onesignal_google_project_number: "253919422974"]
}
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.mikepenz:actionitembadge:3.1.8#aar') {
transitive = true
}
compile('com.weiwangcn.betterspinner:library-material:1.1.0') {
exclude group: 'com.android.support', module: 'appcompat-v7'
}
compile project(':niceSpinner')
compile files('libs/PGSDK_v1.0.jar')
compile files('libs/App42_ANDROID_SDK_3.8.jar')
// compile('com.crashlytics.sdk.android:crashlytics:2.5.5#aar') {
// transitive = true;
// }
// compile('com.instabug.library:instabugsupport:1+') {
// exclude group: 'com.mcxiaoke.volley', module: 'library'
// }
compile 'com.android.support:support-v4:23.4.0'
compile 'com.android.support:design:23.4.0'
compile 'com.daimajia.slider:library:1.1.5#aar'
compile 'com.squareup.picasso:picasso:2.5.2'
compile 'com.mcxiaoke.volley:library:1.0.19'
compile 'com.nineoldandroids:library:2.4.0'
compile 'com.makeramen:roundedimageview:2.2.1'
compile 'com.android.support:cardview-v7:23.2.1'
compile 'com.facebook.android:facebook-android-sdk:4.5.0'
compile 'com.bignerdranch.android:expandablerecyclerview:2.0.3'
compile 'com.marshalchen.ultimaterecyclerview:library:0.3.18'
compile 'com.miguelcatalan:materialsearchview:1.3.0'
compile 'com.wdullaer:materialdatetimepicker:2.0.2'
compile 'com.google.android.gms:play-services:9.0.0'
compile 'de.greenrobot:eventbus:2.4.0'
compile 'com.github.shell-software:fab:1.1.2'
compile 'com.google.android.gms:play-services-analytics:9.0.0'
//compile 'com.onesignal:OneSignal:2.+#aar'
compile 'com.daimajia.swipelayout:library:1.2.0#aar'
compile 'com.intuit.sdp:sdp-android:1.0.2'
compile 'com.google.android.gms:play-services-maps:9.0.0'
}
apply plugin: 'com.google.gms.google-services'
below is my high level gradle file
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.1.0'
classpath 'com.google.gms:google-services:3.0.0'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
jcenter()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
I can not solve this error. Please help to resolve this error
Can you try this,
Add this in your app.gradle file inside android tag and try
dexOptions {
incremental true
javaMaxHeapSize "4g"
}
Original answer by Scott Barta
The solution is in your error text.
To run dex in process, the Gradle daemon needs a larger heap. It
currently has approximately 910 MB. For faster builds, increase the
maximum heap size for the Gradle daemon to more than 2048 MB. To do
this set org.gradle.jvmargs=-Xmx2048M in the project
gradle.properties.
I am getting this error while running/building the APK of my application.
Information:Gradle tasks [:app:assembleDebug]
:app:preBuild
:linkedin-sdk:preBuild
:app:preBuild UP-TO-DATE
:linkedin-sdk:preBuild UP-TO-DATE
:app:preDebugBuild UP-TO-DATE
:linkedin-sdk:preReleaseBuild
:app:checkDebugManifest
:linkedin-sdk:preReleaseBuild UP-TO-DATE
:linkedin-sdk:compileReleaseNdk UP-TO-DATE
:app:preReleaseBuild
:linkedin-sdk:compileLint
:app:preReleaseBuild UP-TO-DATE
:app:preDebugAndroidTestBuild UP-TO-DATE
:linkedin-sdk:copyReleaseLint UP-TO-DATE
:app:generateDebugBuildConfig
:linkedin-sdk:checkReleaseManifest
:linkedin-sdk:preDebugAndroidTestBuild UP-TO-DATE
:linkedin-sdk:preDebugBuild UP-TO-DATE
:linkedin-sdk:preDebugUnitTestBuild UP-TO-DATE
:linkedin-sdk:preReleaseUnitTestBuild UP-TO-DATE
:linkedin-sdk:prepareComAndroidSupportSupportV42103Library
:app:generateDebugBuildConfig UP-TO-DATE
:app:generateDebugAssets UP-TO-DATE
:app:generateDebugResValues UP-TO-DATE
:app:processDebugGoogleServices
:linkedin-sdk:prepareComAndroidSupportSupportV42103Library UP-TO-DATE
:linkedin-sdk:prepareReleaseDependencies
:linkedin-sdk:compileReleaseAidl
:app:compileDebugNdk UP-TO-DATE
:app:processDebugJavaRes UP-TO-DATE
:app:validateDebugSigning
:linkedin-sdk:compileReleaseAidl UP-TO-DATE
:linkedin-sdk:compileReleaseRenderscript UP-TO-DATE
:linkedin-sdk:generateReleaseBuildConfig UP-TO-DATE
:linkedin-sdk:generateReleaseAssets UP-TO-DATE
:linkedin-sdk:mergeReleaseAssets UP-TO-DATE
:linkedin-sdk:generateReleaseResValues UP-TO-DATE
:linkedin-sdk:generateReleaseResources UP-TO-DATE
:linkedin-sdk:mergeReleaseResources UP-TO-DATE
:linkedin-sdk:processReleaseManifest UP-TO-DATE
:linkedin-sdk:processReleaseResources UP-TO-DATE
:linkedin-sdk:generateReleaseSources UP-TO-DATE
:linkedin-sdk:compileReleaseJavaWithJavac UP-TO-DATE
:linkedin-sdk:extractReleaseAnnotations UP-TO-DATE
:linkedin-sdk:mergeReleaseProguardFiles UP-TO-DATE
:linkedin-sdk:packageReleaseRenderscript UP-TO-DATE
:linkedin-sdk:packageReleaseResources UP-TO-DATE
:linkedin-sdk:processReleaseJavaRes UP-TO-DATE
:linkedin-sdk:transformResourcesWithMergeJavaResForRelease UP-TO-DATE
:linkedin-sdk:transformClassesAndResourcesWithSyncLibJarsForRelease UP-TO-DATE
:linkedin-sdk:mergeReleaseJniLibFolders UP-TO-DATE
:linkedin-sdk:transformNative_libsWithMergeJniLibsForRelease UP-TO-DATE
:linkedin-sdk:transformNative_libsWithSyncJniLibsForRelease UP-TO-DATE
:linkedin-sdk:bundleRelease UP-TO-DATE
:app:prepareComAndroidSupportAppcompatV72311Library UP-TO-DATE
:app:prepareComAndroidSupportCardviewV72311Library UP-TO-DATE
:app:prepareComAndroidSupportDesign2311Library UP-TO-DATE
:app:prepareComAndroidSupportMediarouterV72220Library UP-TO-DATE
:app:prepareComAndroidSupportMultidex101Library UP-TO-DATE
:app:prepareComAndroidSupportRecyclerviewV72311Library UP-TO-DATE
:app:prepareComAndroidSupportSupportV42311Library UP-TO-DATE
:app:prepareComAppyvetMaterialrangebar13Library UP-TO-DATE
:app:prepareComFacebookAndroidFacebookAndroidSdk470Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServices830Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesAds830Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesAnalytics830Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesAppindexing830Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesAppinvite830Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesAppstate830Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesAuth830Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesBase830Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesBasement830Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesCast830Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesDrive830Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesFitness830Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesGames830Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesGcm830Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesIdentity830Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesLocation830Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesMaps830Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesMeasurement830Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesNearby830Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesPanorama830Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesPlus830Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesSafetynet830Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesVision830Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesWallet830Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesWearable830Library UP-TO-DATE
:app:prepareComPkmmteViewCircularimageview11Library UP-TO-DATE
:app:prepareComShehabicDroppyDroppy0252Library UP-TO-DATE
:app:prepareComSplitwiseTokenautocomplete202Library UP-TO-DATE
:app:prepareComStripeStripeAndroid104Library UP-TO-DATE
:app:prepareTlandroidappLinkedinSdkUnspecifiedLibrary UP-TO-DATE
:app:prepareDebugDependencies
:app:compileDebugAidl UP-TO-DATE
:app:compileDebugRenderscript UP-TO-DATE
:app:mergeDebugAssets UP-TO-DATE
:app:generateDebugResources
:app:mergeDebugResources UP-TO-DATE
:app:processDebugManifest UP-TO-DATE
:app:processDebugResources UP-TO-DATE
:app:generateDebugSources UP-TO-DATE
:app:compileDebugJavaWithJavac UP-TO-DATE
:app:compileDebugSources UP-TO-DATE
:app:transformClassesWithJarMergingForDebug UP-TO-DATE
:app:collectDebugMultiDexComponents UP-TO-DATE
:app:transformClassesWithMultidexlistForDebug UP-TO-DATE
:app:transformClassesWithDexForDebug
Uncaught translation error: java.util.concurrent.ExecutionException: java.lang.OutOfMemoryError: GC overhead limit exceeded
1 error; aborting
Error:Execution failed for task ':app:transformClassesWithDexForDebug'.
> com.android.build.api.transform.TransformException: com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command 'C:\Program Files\Java\jdk1.7.0_79\bin\java.exe'' finished with non-zero exit value 1
Information:BUILD FAILED
Information:Total time: 2 mins 18.454 secs
Information:1 error
Information:0 warnings
Information:See complete output in console
I tried almost every solution available on internet but it was of no use. Here is my build.gradle file:
apply plugin: 'com.android.application'
android {
compileSdkVersion 23
buildToolsVersion '23.0.2'
defaultConfig {
applicationId "com.truelancer.app"
minSdkVersion 19
targetSdkVersion 23
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
}
sourceSets { main { res.srcDirs = ['src/main/res', 'src/main/res/xml'] } }
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.pkmmte.view:circularimageview:1.1'
compile 'com.android.support:appcompat-v7:23.1.1'
compile 'com.shehabic.droppy:Droppy:0.2.5.2#aar'
compile 'com.android.support:design:23.1.1'
compile 'com.squareup.picasso:picasso:2.5.2'
compile 'com.android.support:multidex:1.0.1'
compile 'com.android.support:appcompat-v7:23.1.1'
compile 'com.android.support:recyclerview-v7:23.1.1'
compile 'com.android.support:cardview-v7:23.1.1'
compile 'com.splitwise:tokenautocomplete:2.0.2#aar'
compile 'com.appyvet:materialrangebar:1.3'
compile 'com.google.android.gms:play-services:8.3.0'
compile 'com.google.android.gms:play-services-analytics:8.3.0'
compile 'com.android.support:multidex:1.0.1'
compile 'com.facebook.android:facebook-android-sdk:4.7.0'
compile project(':linkedin-sdk')
compile 'com.stripe:stripe-android:+'
}
apply plugin: 'com.google.gms.google-services'
and here is the project level build.gradle:
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
jcenter()
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:1.3.0'
classpath 'com.google.gms:google-services:1.5.0'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
jcenter()
mavenCentral()
}
}
The linkedIn library also has one gradle file and here it is:
allprojects {
repositories {
mavenCentral()
}
}
buildscript {
repositories {
mavenCentral()
}
}
apply plugin: 'android-library'
android {
sourceSets {
androidTest {
setRoot('src/test')
}
}
compileSdkVersion 17
buildToolsVersion '23.0.2'
defaultConfig {
minSdkVersion 8
targetSdkVersion 16
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
lintOptions {
abortOnError false
}
}
configurations {
}
dependencies {
compile 'com.android.support:support-annotations:20.0.0'
compile fileTree(dir: 'libs', include: ['*.jar'])
compile files('libs/volley.jar')
androidTestCompile('junit:junit:4.12')
}
Note: My app is Multidex application and I have already extended Multidex class.
Sorry for bothering you guys. Thanks for your concern and all the answers above. I solved it myself by adding in my gradle file.
dexOptions {
javaMaxHeapSize "4g"
}
There is a duplicate dependency in your build.gradle file
You have added
compile 'com.android.support:multidex:1.0.1'
twice in your build file. Remove one of them, clean your project and try rebuilding it. It should work fine.
This usually happens when you have duplicate dependencies added. You can do gradle dependencies command to see if there exist duplicates, and remove them easily.
You have 2 duplicate dependency :
compile 'com.android.support:multidex:1.0.1'
compile 'com.google.android.gms:play-services:8.3.0'
compile 'com.google.android.gms:play-services-analytics:8.3.0'
remove analytics or services one. and also multidex one as you have written it twice
its because of you are using duplicate dependency
compile 'com.google.android.gms:play-services:8.3.0'
compile 'com.google.android.gms:play-services-analytics:8.3.0'
compile 'com.android.support:multidex:1.0.1'
remove
compile 'com.google.android.gms:play-services-analytics:8.3.0'
compile 'com.android.support:multidex:1.0.1'
I'm trying to implement Google sign in for Android and I'm following the instructoins via
https://developers.google.com/identity/sign-in/android/start-integrating
But while building the application I'm receiving the following error.
Information:Gradle tasks [:app:generateDebugSources,
:app:generateDebugAndroidTestSources, :app:assembleDebug]
:app:preBuild UP-TO-DATE :app:preDebugBuild UP-TO-DATE
:app:checkDebugManifest :app:preReleaseBuild UP-TO-DATE
:app:prepareComAndroidSupportAppcompatV72301Library UP-TO-DATE
:app:prepareComAndroidSupportDesign2301Library UP-TO-DATE
:app:prepareComAndroidSupportSupportV42301Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesAds810Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesAnalytics810Library
UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesAppindexing810Library
UP-TO-DATE :app:prepareComGoogleAndroidGmsPlayServicesBase810Library
UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesBasement810Library
UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesIdentity810Library
UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesMeasurement810Library
UP-TO-DATE :app:prepareComGoogleAndroidGmsPlayServicesPlus810Library
UP-TO-DATE :app:prepareDebugDependencies :app:compileDebugAidl
UP-TO-DATE :app:compileDebugRenderscript UP-TO-DATE
:app:generateDebugBuildConfig UP-TO-DATE :app:generateDebugAssets
UP-TO-DATE :app:mergeDebugAssets UP-TO-DATE
:app:generateDebugResValues UP-TO-DATE :app:processDebugGoogleServices
No matching client found for package name 'com.questo.rugved.questo'
:app:generateDebugResources :app:mergeDebugResources UP-TO-DATE
:app:processDebugManifest UP-TO-DATE :app:processDebugResources
UP-TO-DATE :app:generateDebugSources UP-TO-DATE
:app:preDebugAndroidTestBuild UP-TO-DATE
:app:prepareDebugAndroidTestDependencies
:app:compileDebugAndroidTestAidl UP-TO-DATE
:app:processDebugAndroidTestManifest UP-TO-DATE
:app:compileDebugAndroidTestRenderscript UP-TO-DATE
:app:generateDebugAndroidTestBuildConfig UP-TO-DATE
:app:generateDebugAndroidTestAssets UP-TO-DATE
:app:mergeDebugAndroidTestAssets UP-TO-DATE
:app:generateDebugAndroidTestResValues UP-TO-DATE
:app:generateDebugAndroidTestResources UP-TO-DATE
:app:mergeDebugAndroidTestResources UP-TO-DATE
:app:processDebugAndroidTestResources UP-TO-DATE
:app:generateDebugAndroidTestSources UP-TO-DATE
:app:compileDebugJavaWithJavac UP-TO-DATE :app:compileDebugNdk
UP-TO-DATE :app:compileDebugSources UP-TO-DATE
:app:transformClassesAndResourcesWithExtractJarsForDebug
:app:transformClassesWithDexForDebug UNEXPECTED TOP-LEVEL EXCEPTION:
Error:Execution failed for task
':app:transformClassesWithDexForDebug'.
com.android.build.transform.api.TransformException:
com.android.ide.common.process.ProcessException:
org.gradle.process.internal.ExecException: Process 'command
'/usr/lib/jvm/java-7-oracle/bin/java'' finished with non-zero exit
value 2 Information:BUILD FAILED Information:Total time: 1 mins 39.994
secs Information:1 error Information:0 warnings Information:See
complete output in console
My top level gradle is
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:1.3.0'
classpath 'com.google.gms:google-services:1.4.0-beta3'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
jcenter()
}
}
My app level gradle is
<pre>
apply plugin: 'com.android.application'
apply plugin: 'com.google.gms.google-services'
android {
compileSdkVersion 23
buildToolsVersion '23.0.1'
defaultConfig {
applicationId "com.questo.rugved.questo"
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'])
compile 'com.android.support:appcompat-v7:23.0.1'
compile 'com.android.support:design:23.+'
compile 'com.google.android.gms:play-services-identity:8.1.0'
compile 'com.google.android.gms:play-services-plus:8.1.0'
}
please help.
Maybe this link helps you. link
That helped me:
android {
...
defaultConfig {
...
multiDexEnabled true
}
}
This problem occurs because of multiple inclusion of dependencies. You are including a dependency that is already specified in your build.gradle file. For example:
compile 'com.google.android.gms:play-services:9.0.2'
compile 'com.google.android.gms:play-services-identity:9.0.2'
the above specification of dependency will generate this problem, because play-services includes everything, including play-services-identity, & so, here the same dependency is included for multiple times.
The recommended option is to only include those dependencies that you actually need. If you need play services location & maps, only include these dependencies as:
compile 'com.google.android.gms:play-services-location:9.0.2'
compile 'com.google.android.gms:play-services-maps:9.0.2'
Without including everything with 'com.google.android.gms:play-services:9.0.2'.
In your specific case, I suspect the conflict is arising between google-services of the top level gradle file and play-services-identity & play-services-plus in the app level gradle file. Using only those services that you specifically need resolving multiple inclusion will resolve your issue.
In general, you should not use "multiDexEnabled true" if you don't have a strong & legitimate reason. Using it without knowing the actual problem means that you are bypassing a problem. You are allowing multiple overlapping dependencies yielding a potential source of api conflicts & bigger apk size.
Adding
dexOptions {
incremental = true;
preDexLibraries = false
javaMaxHeapSize "4g" // 2g should be also OK
}
in with in android in build.gradle works for me.
Had the same problem.
Mine was fixed by setting the JAVA_HOME variable to java 8 jdk
export JAVA_HOME="/usr/lib/jvm/java-8-openjdk-amd64/"