I build new Project in android studio Java language and Run 'app' failed show error.
I installed New program and installed new windows but Run failed show error.
Executing tasks: [:app:assembleDebug] in project D:\File\Android Project\MyApplication
> Task :app:preBuild UP-TO-DATE
> Task :app:preDebugBuild UP-TO-DATE
> Task :app:generateDebugBuildConfig UP-TO-DATE
> Task :app:javaPreCompileDebug UP-TO-DATE
> Task :app:compileDebugAidl NO-SOURCE
> Task :app:compileDebugRenderscript NO-SOURCE
> Task :app:mainApkListPersistenceDebug UP-TO-DATE
> Task :app:generateDebugResValues UP-TO-DATE
> Task :app:generateDebugResources UP-TO-DATE
> Task :app:mergeDebugResources UP-TO-DATE
> Task :app:createDebugCompatibleScreenManifests UP-TO-DATE
> Task :app:extractDeepLinksDebug UP-TO-DATE
> Task :app:processDebugManifest UP-TO-DATE
> Task :app:processDebugResources UP-TO-DATE
> Task :app:compileDebugJavaWithJavac UP-TO-DATE
> Task :app:compileDebugSources UP-TO-DATE
> Task :app:mergeDebugShaders UP-TO-DATE
> Task :app:compileDebugShaders UP-TO-DATE
> Task :app:generateDebugAssets UP-TO-DATE
> Task :app:mergeDebugAssets UP-TO-DATE
> Task :app:processDebugJavaRes NO-SOURCE
> Task :app:dexBuilderDebug
> Task :app:mergeDebugJavaResource FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:mergeDebugJavaResource'.
> A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$ActionFacade
> com.google.common.base.VerifyException (no error message)
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
* Get more help at https://help.gradle.org
BUILD FAILED in 6s
15 actionable tasks: 2 executed, 13 up-to-date
This code will solve problem
android {
packagingOptions {
pickFirst "META-INF/DEPENDENCIES"
}
}
or
android {
packagingOptions {
exclude "META-INF/DEPENDENCIES"
}
}
flutter clean
flutter pub get
This works for me.
Related
I cannot debug my Ionic Capacitor application to android emulator. I am using Macbook Pro with M1 Pro chip.
after I ran this command:
ionic cap run android -l --external
This is what I got at then end:
[capacitor] ✖ Running Gradle build - failed!
[capacitor] [error]
[capacitor] > Configure project :app
[capacitor] WARNING:: Configuration 'compile' is obsolete and has been replaced with 'implementation' and 'api'.
[capacitor] It will be removed in version 7.0 of the Android Gradle plugin.
[capacitor] For more information, see http://d.android.com/r/tools/update-dependency-configurations.html.
[capacitor]
[capacitor] > Configure project :capacitor-cordova-android-plugins
[capacitor] WARNING:: Configuration 'compile' is obsolete and has been replaced with 'implementation' and 'api'.
[capacitor] It will be removed in version 7.0 of the Android Gradle plugin.
[capacitor] For more information, see http://d.android.com/r/tools/update-dependency-configurations.html.
[capacitor] WARNING:: Using flatDirs should be avoided because it doesn't support any meta-data formats.
[capacitor] Currently detected usages:
[capacitor] - repository flatDir used in: project ':app', project ':capacitor-cordova-android-plugins'
[capacitor] - repository flatDir2 used in: project ':app', project ':capacitor-cordova-android-plugins'
[capacitor] WARNING:: Please remove usages of `jcenter()` Maven repository from your build scripts and migrate your build to other Maven repositories.
[capacitor] This repository is deprecated and it will be shut down in the future.
[capacitor] See http://developer.android.com/r/tools/jcenter-end-of-service for more information.
[capacitor] Currently detected usages in: root project 'android', project ':app', project ':byteowls-capacitor-filesharer', ...
[capacitor]
[capacitor] > Task :app:preBuild UP-TO-DATE
[capacitor] > Task :app:preDebugBuild UP-TO-DATE
[capacitor] > Task :byteowls-capacitor-filesharer:preBuild UP-TO-DATE
[capacitor] > Task :byteowls-capacitor-filesharer:preDebugBuild UP-TO-DATE
[capacitor] > Task :capacitor-android:preBuild UP-TO-DATE
[capacitor] > Task :capacitor-android:preDebugBuild UP-TO-DATE
[capacitor] > Task :capacitor-android:compileDebugAidl NO-SOURCE
[capacitor] > Task :byteowls-capacitor-filesharer:compileDebugAidl NO-SOURCE
[capacitor] > Task :capacitor-app:preBuild UP-TO-DATE
[capacitor] > Task :capacitor-app:preDebugBuild UP-TO-DATE
[capacitor] > Task :capacitor-app:compileDebugAidl NO-SOURCE
[capacitor] > Task :capacitor-camera:preBuild UP-TO-DATE
[capacitor] > Task :capacitor-camera:preDebugBuild UP-TO-DATE
[capacitor] > Task :capacitor-camera:compileDebugAidl NO-SOURCE
[capacitor] > Task :capacitor-cordova-android-plugins:preBuild UP-TO-DATE
[capacitor] > Task :capacitor-cordova-android-plugins:preDebugBuild UP-TO-DATE
[capacitor] > Task :capacitor-cordova-android-plugins:compileDebugAidl NO-SOURCE
[capacitor] > Task :capacitor-haptics:preBuild UP-TO-DATE
[capacitor] > Task :capacitor-haptics:preDebugBuild UP-TO-DATE
[capacitor] > Task :capacitor-haptics:compileDebugAidl NO-SOURCE
[capacitor] > Task :capacitor-keyboard:preBuild UP-TO-DATE
[capacitor] > Task :capacitor-keyboard:preDebugBuild UP-TO-DATE
[capacitor] > Task :capacitor-keyboard:compileDebugAidl NO-SOURCE
[capacitor] > Task :capacitor-push-notifications:preBuild UP-TO-DATE
[capacitor] > Task :capacitor-push-notifications:preDebugBuild UP-TO-DATE
[capacitor] > Task :capacitor-push-notifications:compileDebugAidl NO-SOURCE
[capacitor] > Task :capacitor-status-bar:preBuild UP-TO-DATE
[capacitor] > Task :capacitor-status-bar:preDebugBuild UP-TO-DATE
[capacitor] > Task :capacitor-status-bar:compileDebugAidl NO-SOURCE
[capacitor] > Task :app:compileDebugAidl NO-SOURCE
[capacitor] > Task :byteowls-capacitor-filesharer:packageDebugRenderscript NO-SOURCE
[capacitor] > Task :capacitor-android:packageDebugRenderscript NO-SOURCE
[capacitor] > Task :capacitor-app:packageDebugRenderscript NO-SOURCE
[capacitor] > Task :capacitor-camera:packageDebugRenderscript NO-SOURCE
[capacitor] > Task :capacitor-cordova-android-plugins:packageDebugRenderscript NO-SOURCE
[capacitor] > Task :capacitor-haptics:packageDebugRenderscript NO-SOURCE
[capacitor] > Task :capacitor-keyboard:packageDebugRenderscript NO-SOURCE
[capacitor] > Task :capacitor-push-notifications:packageDebugRenderscript NO-SOURCE
[capacitor] > Task :capacitor-status-bar:packageDebugRenderscript NO-SOURCE
[capacitor] > Task :app:compileDebugRenderscript NO-SOURCE
[capacitor] > Task :app:generateDebugBuildConfig UP-TO-DATE
[capacitor] > Task :app:javaPreCompileDebug UP-TO-DATE
[capacitor] > Task :byteowls-capacitor-filesharer:writeDebugAarMetadata UP-TO-DATE
[capacitor] > Task :capacitor-android:writeDebugAarMetadata UP-TO-DATE
[capacitor] > Task :capacitor-app:writeDebugAarMetadata UP-TO-DATE
[capacitor] > Task :capacitor-camera:writeDebugAarMetadata UP-TO-DATE
[capacitor] > Task :capacitor-haptics:writeDebugAarMetadata UP-TO-DATE
[capacitor] > Task :capacitor-cordova-android-plugins:writeDebugAarMetadata
[capacitor] > Task :capacitor-keyboard:writeDebugAarMetadata UP-TO-DATE
[capacitor] > Task :capacitor-push-notifications:writeDebugAarMetadata UP-TO-DATE
[capacitor] > Task :capacitor-status-bar:writeDebugAarMetadata UP-TO-DATE
[capacitor] > Task :app:generateDebugResValues UP-TO-DATE
[capacitor] > Task :app:generateDebugResources UP-TO-DATE
[capacitor] > Task :byteowls-capacitor-filesharer:compileDebugRenderscript NO-SOURCE
[capacitor] > Task :byteowls-capacitor-filesharer:generateDebugResValues UP-TO-DATE
[capacitor] > Task :byteowls-capacitor-filesharer:generateDebugResources UP-TO-DATE
[capacitor] > Task :byteowls-capacitor-filesharer:packageDebugResources UP-TO-DATE
[capacitor] > Task :capacitor-android:compileDebugRenderscript NO-SOURCE
[capacitor] > Task :capacitor-android:generateDebugResValues UP-TO-DATE
[capacitor] > Task :capacitor-android:generateDebugResources UP-TO-DATE
[capacitor] > Task :capacitor-android:packageDebugResources UP-TO-DATE
[capacitor] > Task :capacitor-app:compileDebugRenderscript NO-SOURCE
[capacitor] > Task :capacitor-app:generateDebugResValues UP-TO-DATE
[capacitor] > Task :capacitor-app:generateDebugResources UP-TO-DATE
[capacitor] > Task :capacitor-app:packageDebugResources UP-TO-DATE
[capacitor] > Task :capacitor-camera:compileDebugRenderscript NO-SOURCE
[capacitor] > Task :capacitor-camera:generateDebugResValues UP-TO-DATE
[capacitor] > Task :capacitor-camera:generateDebugResources UP-TO-DATE
[capacitor] > Task :capacitor-camera:packageDebugResources UP-TO-DATE
[capacitor] > Task :capacitor-cordova-android-plugins:compileDebugRenderscript NO-SOURCE
[capacitor] > Task :capacitor-cordova-android-plugins:generateDebugResValues
[capacitor] > Task :capacitor-cordova-android-plugins:generateDebugResources
[capacitor] > Task :capacitor-cordova-android-plugins:packageDebugResources
[capacitor] > Task :capacitor-haptics:compileDebugRenderscript NO-SOURCE
[capacitor] > Task :capacitor-haptics:generateDebugResValues UP-TO-DATE
[capacitor] > Task :capacitor-haptics:generateDebugResources UP-TO-DATE
[capacitor] > Task :capacitor-haptics:packageDebugResources UP-TO-DATE
[capacitor] > Task :capacitor-keyboard:compileDebugRenderscript NO-SOURCE
[capacitor] > Task :capacitor-keyboard:generateDebugResValues UP-TO-DATE
[capacitor] > Task :capacitor-keyboard:generateDebugResources UP-TO-DATE
[capacitor] > Task :capacitor-keyboard:packageDebugResources UP-TO-DATE
[capacitor] > Task :capacitor-push-notifications:compileDebugRenderscript NO-SOURCE
[capacitor] > Task :capacitor-push-notifications:generateDebugResValues UP-TO-DATE
[capacitor] > Task :capacitor-push-notifications:generateDebugResources UP-TO-DATE
[capacitor] > Task :app:checkDebugAarMetadata UP-TO-DATE
[capacitor] > Task :capacitor-push-notifications:packageDebugResources UP-TO-DATE
[capacitor] > Task :capacitor-status-bar:compileDebugRenderscript NO-SOURCE
[capacitor] > Task :capacitor-status-bar:generateDebugResValues UP-TO-DATE
[capacitor] > Task :capacitor-status-bar:generateDebugResources UP-TO-DATE
[capacitor] > Task :capacitor-status-bar:packageDebugResources UP-TO-DATE
[capacitor] > Task :app:mergeDebugResources UP-TO-DATE
[capacitor] > Task :app:createDebugCompatibleScreenManifests UP-TO-DATE
[capacitor] > Task :app:extractDeepLinksDebug UP-TO-DATE
[capacitor] > Task :byteowls-capacitor-filesharer:extractDeepLinksDebug UP-TO-DATE
[capacitor] > Task :byteowls-capacitor-filesharer:processDebugManifest UP-TO-DATE
[capacitor] > Task :capacitor-android:extractDeepLinksDebug UP-TO-DATE
[capacitor] > Task :capacitor-android:processDebugManifest UP-TO-DATE
[capacitor] > Task :capacitor-app:extractDeepLinksDebug UP-TO-DATE
[capacitor] > Task :capacitor-app:processDebugManifest UP-TO-DATE
[capacitor] > Task :capacitor-camera:extractDeepLinksDebug UP-TO-DATE
[capacitor] > Task :capacitor-camera:processDebugManifest UP-TO-DATE
[capacitor] > Task :capacitor-cordova-android-plugins:extractDeepLinksDebug
[capacitor] > Task :capacitor-haptics:extractDeepLinksDebug UP-TO-DATE
[capacitor] > Task :capacitor-haptics:processDebugManifest UP-TO-DATE
[capacitor] > Task :capacitor-keyboard:extractDeepLinksDebug UP-TO-DATE
[capacitor] > Task :capacitor-keyboard:processDebugManifest UP-TO-DATE
[capacitor] > Task :capacitor-push-notifications:extractDeepLinksDebug UP-TO-DATE
[capacitor] > Task :capacitor-push-notifications:processDebugManifest UP-TO-DATE
[capacitor] > Task :capacitor-status-bar:extractDeepLinksDebug UP-TO-DATE
[capacitor] > Task :capacitor-cordova-android-plugins:processDebugManifest
[capacitor] > Task :capacitor-status-bar:processDebugManifest UP-TO-DATE
[capacitor] > Task :byteowls-capacitor-filesharer:compileDebugLibraryResources UP-TO-DATE
[capacitor] > Task :byteowls-capacitor-filesharer:parseDebugLocalResources UP-TO-DATE
[capacitor] > Task :capacitor-android:parseDebugLocalResources UP-TO-DATE
[capacitor] > Task :capacitor-android:generateDebugRFile UP-TO-DATE
[capacitor] > Task :app:processDebugMainManifest FAILED
[capacitor]
[capacitor] FAILURE: Build failed with an exception.
[capacitor]
[capacitor] * What went wrong:
[capacitor] Execution failed for task ':app:processDebugMainManifest'.
[capacitor] > Unable to make field private final java.lang.String java.io.File.path accessible: module java.base does not "opens java.io" to unnamed module #7a5491eb
[capacitor]
[capacitor] * Try:
[capacitor] > Run with --stacktrace option to get the stack trace.
[capacitor] > Run with --info or --debug option to get more log output.
[capacitor] > Run with --scan to get full insights.
[capacitor]
[capacitor] * Get more help at https://help.gradle.org
[capacitor]
[capacitor] Deprecated Gradle features were used in this build, making it incompatible with Gradle 8.0.
[capacitor]
[capacitor] You can use '--warning-mode all' to show the individual deprecation warnings and determine if they come from your own scripts or plugins.
[capacitor]
[capacitor] See https://docs.gradle.org/7.4.2/userguide/command_line_interface.html#sec:command_line_warnings
[capacitor]
[capacitor] BUILD FAILED in 2s
[capacitor] 57 actionable tasks: 6 executed, 51 up-to-date
[capacitor]
[capacitor] Waiting for the debugger to disconnect...
[ERROR] An error occurred while running subprocess capacitor.
After some researches, people are saying that the java JDK version is wrong (Or is it?).
How can I know match the JDK version for my project and Android Studio?
This is my java version:
openjdk version "17.0.3" 2022-04-19
OpenJDK Runtime Environment Temurin-17.0.3+7 (build 17.0.3+7)
OpenJDK 64-Bit Server VM Temurin-17.0.3+7 (build 17.0.3+7, mixed mode)
How to fix this error?
Ensure you are using Java 11 SE Version for Capacitor 4 , here you can find the instruction for Gradle And JAVA
https://capacitorjs.com/docs/updating/4-0
First-time Gradle project user in eclipse, and running a gradle build on the defaault project presents me with this output:
> Task :compileJava UP-TO-DATE
> Task :processResources NO-SOURCE
> Task :classes UP-TO-DATE
> Task :jar UP-TO-DATE
> Task :assemble UP-TO-DATE
> Task :compileTestJava UP-TO-DATE
> Task :processTestResources NO-SOURCE
> Task :testClasses UP-TO-DATE
> Task :test UP-TO-DATE
> Task :check UP-TO-DATE
> Task :build UP-TO-DATE
BUILD SUCCESSFUL in 940ms
4 actionable tasks: 4 up-to-date
Why are two of them 'NO-SOURCE' and how do I solve this?
It's not an error. It just means that there is nothing inside src\main\resources and src\test\resources folder.
If you put some resources like a property file, image etc. that is needed for your application, it should go away.
I'm having this error above whenever i try to build an APK:
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: Error while executing java process with main class com.android.dx.command.Main with arguments {--dex --num-threads=4 --multi-dex --main-dex-list C:\Users\admin\Desktop\FlagQuiz\app\build\intermediates\multi-dex\debug\maindexlist.txt --output C:\Users\admin\Desktop\FlagQuiz\app\build\intermediates\transforms\dex\debug\folders\1000\1f\main C:\Users\admin\Desktop\FlagQuiz\app\build\intermediates\transforms\jarMerging\debug\jars\1\1f\combined.jar}
This is my gradle build file:
apply plugin: 'com.android.application'
android {
compileSdkVersion 25
buildToolsVersion "25.0.3"
defaultConfig {
applicationId "com.example.quiz"
multiDexEnabled true
minSdkVersion 15
targetSdkVersion 25
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_5
targetCompatibility JavaVersion.VERSION_1_5
}
}
dexOptions {
javaMaxHeapSize "2g"
preDexLibraries = false
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
'proguard-rules.pro'
lintOptions {
disable 'MissingTranslation'
// checkRleaeseBuilds false
abortOnError false
}
}
}
}
dependencies {
compile project(':BaseGameUtils')
compile 'com.google.android.gms:play-services:11.0.4'
compile 'com.google.firebase:firebase-core:11.0.2'
compile 'com.google.firebase:firebase-crash:11.0.2'
compile 'com.google.android.gms:play-services-auth:11.0.4'
compile 'com.android.support:multidex:1.0.1'
}
//apply plugin: 'com.google.gms.google-services' <-- I commented it according to some solutions but it's didn't solve the problem
How i can solve this error, i've followed some solutions here and in some forums but nothing worked with me..
Thank you for any help!!
Gradle console:
Executing tasks: [:BaseGameUtils:assembleDebug, :app:assembleDebug]
Configuration on demand is an incubating feature.
NDK is missing a "platforms" directory.
If you are using NDK, verify the ndk.dir is set to a valid NDK directory. It is currently set to C:\Users\admin\AppData\Local\Android\sdk\ndk-bundle.
If you are not using NDK, unset the NDK variable from ANDROID_NDK_HOME or local.properties to remove this warning.
The setTestClassesDir(File) method has been deprecated and is scheduled to be removed in Gradle 5.0. Please use the setTestClassesDirs(FileCollection) method instead.
The getTestClassesDir() method has been deprecated and is scheduled to be removed in Gradle 5.0. Please use the getTestClassesDirs() method instead.
The ConfigurableReport.setDestination(Object) method has been deprecated and is scheduled to be removed in Gradle 5.0. Please use the method ConfigurableReport.setDestination(File) instead.
NDK is missing a "platforms" directory.
If you are using NDK, verify the ndk.dir is set to a valid NDK directory. It is currently set to C:\Users\admin\AppData\Local\Android\sdk\ndk-bundle.
If you are not using NDK, unset the NDK variable from ANDROID_NDK_HOME or local.properties to remove this warning.
:BaseGameUtils:preBuild UP-TO-DATE
:BaseGameUtils:preDebugBuild UP-TO-DATE
:BaseGameUtils:checkDebugManifest
:BaseGameUtils:preDebugAndroidTestBuild UP-TO-DATE
:BaseGameUtils:preDebugUnitTestBuild UP-TO-DATE
:BaseGameUtils:preReleaseBuild UP-TO-DATE
:BaseGameUtils:preReleaseUnitTestBuild UP-TO-DATE
:BaseGameUtils:prepareComAndroidSupportAnimatedVectorDrawable2540Library
:BaseGameUtils:prepareComAndroidSupportAppcompatV72540Library
:BaseGameUtils:prepareComAndroidSupportSupportCompat2540Library
:BaseGameUtils:prepareComAndroidSupportSupportCoreUi2540Library
:BaseGameUtils:prepareComAndroidSupportSupportCoreUtils2540Library
:BaseGameUtils:prepareComAndroidSupportSupportFragment2540Library
:BaseGameUtils:prepareComAndroidSupportSupportMediaCompat2540Library
:BaseGameUtils:prepareComAndroidSupportSupportV42540Library
:BaseGameUtils:prepareComAndroidSupportSupportVectorDrawable2540Library
:BaseGameUtils:prepareComGoogleAndroidGmsPlayServicesAuth1102Library
:BaseGameUtils:prepareComGoogleAndroidGmsPlayServicesAuthBase1102Library
:BaseGameUtils:prepareComGoogleAndroidGmsPlayServicesBase1102Library
:BaseGameUtils:prepareComGoogleAndroidGmsPlayServicesBasement1102Library
:BaseGameUtils:prepareComGoogleAndroidGmsPlayServicesDrive1026Library
:BaseGameUtils:prepareComGoogleAndroidGmsPlayServicesGames1026Library
:BaseGameUtils:prepareComGoogleAndroidGmsPlayServicesPlus1026Library
:BaseGameUtils:prepareComGoogleAndroidGmsPlayServicesTasks1102Library
:BaseGameUtils:prepareComGoogleFirebaseFirebaseAnalytics1102Library
:BaseGameUtils:prepareComGoogleFirebaseFirebaseAnalyticsImpl1102Library
:BaseGameUtils:prepareComGoogleFirebaseFirebaseCommon1102Library
:BaseGameUtils:prepareComGoogleFirebaseFirebaseCore1102Library
:BaseGameUtils:prepareComGoogleFirebaseFirebaseIid1102Library
:BaseGameUtils:prepareDebugDependencies
:BaseGameUtils:compileDebugAidl UP-TO-DATE
:BaseGameUtils:compileDebugNdk NO-SOURCE
:BaseGameUtils:compileLint UP-TO-DATE
:BaseGameUtils:copyDebugLint NO-SOURCE
:BaseGameUtils:compileDebugRenderscript UP-TO-DATE
:BaseGameUtils:generateDebugBuildConfig UP-TO-DATE
:BaseGameUtils:generateDebugResValues UP-TO-DATE
:BaseGameUtils:generateDebugResources UP-TO-DATE
:BaseGameUtils:mergeDebugResources UP-TO-DATE
:BaseGameUtils:processDebugManifest UP-TO-DATE
:BaseGameUtils:processDebugResources UP-TO-DATE
:BaseGameUtils:generateDebugSources UP-TO-DATE
:BaseGameUtils:incrementalDebugJavaCompilationSafeguard UP-TO-DATE
:BaseGameUtils:javaPreCompileDebug
:BaseGameUtils:compileDebugJavaWithJavac UP-TO-DATE
:BaseGameUtils:extractDebugAnnotations UP-TO-DATE
:BaseGameUtils:mergeDebugShaders UP-TO-DATE
:BaseGameUtils:compileDebugShaders UP-TO-DATE
:BaseGameUtils:generateDebugAssets UP-TO-DATE
:BaseGameUtils:mergeDebugAssets UP-TO-DATE
:BaseGameUtils:mergeDebugProguardFiles UP-TO-DATE
:BaseGameUtils:packageDebugRenderscript NO-SOURCE
:BaseGameUtils:packageDebugResources UP-TO-DATE
:BaseGameUtils:processDebugJavaRes NO-SOURCE
:BaseGameUtils:transformResourcesWithMergeJavaResForDebug UP-TO-DATE
:BaseGameUtils:transformClassesAndResourcesWithSyncLibJarsForDebug UP-TO-DATE
:BaseGameUtils:mergeDebugJniLibFolders UP-TO-DATE
:BaseGameUtils:transformNativeLibsWithMergeJniLibsForDebug UP-TO-DATE
:BaseGameUtils:transformNativeLibsWithSyncJniLibsForDebug UP-TO-DATE
:BaseGameUtils:bundleDebug UP-TO-DATE
:BaseGameUtils:compileDebugSources UP-TO-DATE
:BaseGameUtils:assembleDebug UP-TO-DATE
:BaseGameUtils:checkReleaseManifest
:BaseGameUtils:prepareReleaseDependencies
:BaseGameUtils:compileReleaseAidl UP-TO-DATE
:BaseGameUtils:compileReleaseNdk NO-SOURCE
:BaseGameUtils:copyReleaseLint NO-SOURCE
:BaseGameUtils:compileReleaseRenderscript UP-TO-DATE
:BaseGameUtils:generateReleaseBuildConfig UP-TO-DATE
:BaseGameUtils:generateReleaseResValues UP-TO-DATE
:BaseGameUtils:generateReleaseResources UP-TO-DATE
:BaseGameUtils:mergeReleaseResources UP-TO-DATE
:BaseGameUtils:processReleaseManifest UP-TO-DATE
:BaseGameUtils:processReleaseResources UP-TO-DATE
:BaseGameUtils:generateReleaseSources UP-TO-DATE
:BaseGameUtils:incrementalReleaseJavaCompilationSafeguard UP-TO-DATE
:BaseGameUtils:javaPreCompileRelease
:BaseGameUtils:compileReleaseJavaWithJavac UP-TO-DATE
:BaseGameUtils:extractReleaseAnnotations UP-TO-DATE
:BaseGameUtils:mergeReleaseShaders UP-TO-DATE
:BaseGameUtils:compileReleaseShaders UP-TO-DATE
:BaseGameUtils:generateReleaseAssets UP-TO-DATE
:BaseGameUtils:mergeReleaseAssets UP-TO-DATE
:BaseGameUtils:mergeReleaseProguardFiles UP-TO-DATE
:BaseGameUtils:packageReleaseRenderscript NO-SOURCE
:BaseGameUtils:packageReleaseResources UP-TO-DATE
:BaseGameUtils:processReleaseJavaRes NO-SOURCE
:BaseGameUtils:transformResourcesWithMergeJavaResForRelease UP-TO-DATE
:BaseGameUtils:transformClassesAndResourcesWithSyncLibJarsForRelease UP-TO-DATE
:BaseGameUtils:mergeReleaseJniLibFolders UP-TO-DATE
:BaseGameUtils:transformNativeLibsWithMergeJniLibsForRelease UP-TO-DATE
:BaseGameUtils:transformNativeLibsWithSyncJniLibsForRelease UP-TO-DATE
:BaseGameUtils:bundleRelease UP-TO-DATE
:app:preBuild UP-TO-DATE
:app:preDebugBuild UP-TO-DATE
:app:checkDebugManifest
:app:preReleaseBuild UP-TO-DATE
:app:prepareComAndroidSupportAnimatedVectorDrawable2540Library
:app:prepareComAndroidSupportAppcompatV72540Library
:app:prepareComAndroidSupportMediarouterV72520Library
:app:preDebugAndroidTestBuild UP-TO-DATE
:app:prepareComAndroidSupportMultidex101Library
:app:prepareComAndroidSupportPaletteV72520Library
:app:prepareComAndroidSupportSupportCompat2540Library
:app:prepareComAndroidSupportSupportCoreUi2540Library
:app:prepareComAndroidSupportSupportCoreUtils2540Library
:app:prepareComAndroidSupportSupportFragment2540Library
:app:prepareComAndroidSupportSupportMediaCompat2540Library
:app:prepareComAndroidSupportSupportV42540Library
:app:prepareComAndroidSupportSupportVectorDrawable2540Library
:app:prepareComGoogleAndroidGmsPlayServices1104Library
:app:prepareComGoogleAndroidGmsPlayServicesAds1104Library
:app:prepareComGoogleAndroidGmsPlayServicesAdsLite1104Library
:app:prepareComGoogleAndroidGmsPlayServicesAnalytics1104Library
:app:prepareComGoogleAndroidGmsPlayServicesAnalyticsImpl1104Library
:app:prepareComGoogleAndroidGmsPlayServicesAppinvite1104Library
:app:prepareComGoogleAndroidGmsPlayServicesAuth1104Library
:app:prepareComGoogleAndroidGmsPlayServicesAuthApiPhone1104Library
:app:prepareComGoogleAndroidGmsPlayServicesAuthBase1104Library
:app:prepareComGoogleAndroidGmsPlayServicesAwareness1104Library
:app:prepareComGoogleAndroidGmsPlayServicesBase1104Library
:app:prepareComGoogleAndroidGmsPlayServicesBasement1104Library
:app:prepareComGoogleAndroidGmsPlayServicesCast1104Library
:app:prepareComGoogleAndroidGmsPlayServicesCastFramework1104Library
:app:prepareComGoogleAndroidGmsPlayServicesClearcut1104Library
:app:prepareComGoogleAndroidGmsPlayServicesDrive1104Library
:app:prepareComGoogleAndroidGmsPlayServicesFitness1104Library
:app:prepareComGoogleAndroidGmsPlayServicesGames1104Library
:app:prepareComGoogleAndroidGmsPlayServicesGass1104Library
:app:prepareComGoogleAndroidGmsPlayServicesGcm1104Library
:app:prepareComGoogleAndroidGmsPlayServicesIdentity1104Library
:app:prepareComGoogleAndroidGmsPlayServicesIid1104Library
:app:prepareComGoogleAndroidGmsPlayServicesInstantapps1104Library
:app:prepareComGoogleAndroidGmsPlayServicesLocation1104Library
:app:prepareComGoogleAndroidGmsPlayServicesMaps1104Library
:app:prepareComGoogleAndroidGmsPlayServicesNearby1104Library
:app:prepareComGoogleAndroidGmsPlayServicesPanorama1104Library
:app:prepareComGoogleAndroidGmsPlayServicesPlaces1104Library
:app:prepareComGoogleAndroidGmsPlayServicesPlus1104Library
:app:prepareComGoogleAndroidGmsPlayServicesSafetynet1104Library
:app:prepareComGoogleAndroidGmsPlayServicesTagmanager1104Library
:app:prepareComGoogleAndroidGmsPlayServicesTagmanagerApi1104Library
:app:prepareComGoogleAndroidGmsPlayServicesTagmanagerV4Impl1104Library
:app:prepareComGoogleAndroidGmsPlayServicesTasks1104Library
:app:prepareComGoogleAndroidGmsPlayServicesVision1104Library
:app:prepareComGoogleAndroidGmsPlayServicesVisionCommon1104Library
:app:prepareComGoogleAndroidGmsPlayServicesWallet1104Library
:app:prepareComGoogleAndroidGmsPlayServicesWearable1104Library
:app:prepareComGoogleFirebaseFirebaseAnalytics1104Library
:app:prepareComGoogleFirebaseFirebaseAnalyticsImpl1104Library
:app:prepareComGoogleFirebaseFirebaseAppindexing1104Library
:app:prepareComGoogleFirebaseFirebaseAuth1104Library
:app:prepareComGoogleFirebaseFirebaseCommon1104Library
:app:prepareComGoogleFirebaseFirebaseConfig1104Library
:app:prepareComGoogleFirebaseFirebaseCore1102Library
:app:prepareComGoogleFirebaseFirebaseCrash1104Library
:app:prepareComGoogleFirebaseFirebaseDatabase1104Library
:app:prepareComGoogleFirebaseFirebaseDatabaseConnection1104Library
:app:prepareComGoogleFirebaseFirebaseDynamicLinks1104Library
:app:prepareComGoogleFirebaseFirebaseIid1104Library
:app:prepareComGoogleFirebaseFirebaseMessaging1104Library
:app:prepareComGoogleFirebaseFirebaseStorage1104Library
:app:prepareComGoogleFirebaseFirebaseStorageCommon1104Library
:app:prepareDebugDependencies
:app:compileDebugAidl UP-TO-DATE
:app:compileDebugRenderscript UP-TO-DATE
:app:generateDebugBuildConfig 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:javaPreCompileDebug
:app:compileDebugJavaWithJavac UP-TO-DATE
:app:compileDebugNdk NO-SOURCE
:app:compileDebugSources UP-TO-DATE
:app:mergeDebugShaders
:app:compileDebugShaders
:app:generateDebugAssets
:app:mergeDebugAssets
:app:transformClassesWithJarMergingForDebug
:app:transformClassesWithMultidexlistForDebug
:app:transformClassesWithDexForDebug
Running dex as a separate process.
To run dex in process, the Gradle daemon needs a larger heap.
It currently has 1024 MB.
For faster builds, increase the maximum heap size for the Gradle daemon to at least 2560 MB (based on the dexOptions.javaMaxHeapSize = 2g).
To do this set org.gradle.jvmargs=-Xmx2560M in the project gradle.properties.
For more information see https://docs.gradle.org/current/userguide/build_environment.html
:app:transformClassesWithDexForDebug FAILED
FAILURE: Build failed with an exception.
* What went wrong:
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: Error while executing java process with main class com.android.dx.command.Main with arguments {--dex --num-threads=4 --multi-dex --main-dex-list C:\Users\admin\Desktop\FlagQuiz\app\build\intermediates\multi-dex\debug\maindexlist.txt --output C:\Users\admin\Desktop\FlagQuiz\app\build\intermediates\transforms\dex\debug\folders\1000\1f\main C:\Users\admin\Desktop\FlagQuiz\app\build\intermediates\transforms\jarMerging\debug\jars\1\1f\combined.jar}
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
* Get more help at https://help.gradle.org
BUILD FAILED in 1m 3s
154 actionable tasks: 102 executed, 52 up-to-date
I have just downloaded Android Studio 2.2.2 and I try to build example projects. Blank activity project builds, deploys and runs successfully on my phone.
Then I try to build Google Maps project. I obtained an API key, copied it into google_maps_api.xml and didn't change anything else. Then, if I press Build -> Build APK, it fails with the following messages in Gradle Console:
Executing tasks: [:app:assembleDebug]
Incremental java compilation is an incubating feature.
:app:preBuild UP-TO-DATE
:app:preDebugBuild UP-TO-DATE
:app:checkDebugManifest
:app:preReleaseBuild UP-TO-DATE
:app:prepareComAndroidSupportAnimatedVectorDrawable2500Library UP-TO-DATE
:app:prepareComAndroidSupportAppcompatV72500Library UP-TO-DATE
:app:prepareComAndroidSupportMediarouterV72400Library UP-TO-DATE
:app:prepareComAndroidSupportPaletteV72400Library UP-TO-DATE
:app:prepareComAndroidSupportSupportCompat2500Library UP-TO-DATE
:app:prepareComAndroidSupportSupportCoreUi2500Library UP-TO-DATE
:app:prepareComAndroidSupportSupportCoreUtils2500Library UP-TO-DATE
:app:prepareComAndroidSupportSupportFragment2500Library UP-TO-DATE
:app:prepareComAndroidSupportSupportMediaCompat2500Library UP-TO-DATE
:app:prepareComAndroidSupportSupportV42500Library UP-TO-DATE
:app:prepareComAndroidSupportSupportVectorDrawable2500Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServices980Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesAds980Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesAdsLite980Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesAnalytics980Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesAnalyticsImpl980Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesAppindexing980Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesAppinvite980Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesAuth980Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesAuthBase980Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesAwareness980Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesBase980Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesBasement980Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesCast980Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesCastFramework980Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesClearcut980Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesDrive980Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesFitness980Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesGames980Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesGass980Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesGcm980Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesIdentity980Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesIid980Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesInstantapps980Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesLocation980Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesMaps980Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesNearby980Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesPanorama980Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesPlaces980Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesPlus980Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesSafetynet980Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesTagmanager980Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesTagmanagerApi980Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesTasks980Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesVision980Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesWallet980Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesWearable980Library UP-TO-DATE
:app:prepareComGoogleFirebaseFirebaseAnalytics980Library UP-TO-DATE
:app:prepareComGoogleFirebaseFirebaseAnalyticsImpl980Library UP-TO-DATE
:app:prepareComGoogleFirebaseFirebaseAuth980Library UP-TO-DATE
:app:prepareComGoogleFirebaseFirebaseAuthCommon980Library UP-TO-DATE
:app:prepareComGoogleFirebaseFirebaseAuthModule980Library UP-TO-DATE
:app:prepareComGoogleFirebaseFirebaseCommon980Library UP-TO-DATE
:app:prepareComGoogleFirebaseFirebaseConfig980Library UP-TO-DATE
:app:prepareComGoogleFirebaseFirebaseCrash980Library UP-TO-DATE
:app:prepareComGoogleFirebaseFirebaseDatabase980Library UP-TO-DATE
:app:prepareComGoogleFirebaseFirebaseDatabaseConnection980Library UP-TO-DATE
:app:prepareComGoogleFirebaseFirebaseIid980Library UP-TO-DATE
:app:prepareComGoogleFirebaseFirebaseMessaging980Library UP-TO-DATE
:app:prepareComGoogleFirebaseFirebaseStorage980Library UP-TO-DATE
:app:prepareComGoogleFirebaseFirebaseStorageCommon980Library UP-TO-DATE
:app:prepareDebugDependencies
:app:compileDebugAidl UP-TO-DATE
:app:compileDebugRenderscript UP-TO-DATE
:app:generateDebugBuildConfig 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:mergeDebugShaders UP-TO-DATE
:app:compileDebugShaders UP-TO-DATE
:app:generateDebugAssets UP-TO-DATE
:app:mergeDebugAssets UP-TO-DATE
:app:transformClassesWithDexForDebug FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:transformClassesWithDexForDebug'.
> com.android.build.api.transform.TransformException: com.android.ide.common.process.ProcessException: java.util.concurrent.ExecutionException: com.android.dex.DexIndexOverflowException: method ID not in [0, 0xffff]: 65536
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
BUILD FAILED
Total time: 53.036 secs
First I noticed "Incremental java compilation is an incubating feature" message. Maybe incremental compilation is the reason of the failure? If so, how can I disable it? I didn't find anything about it in build.gradle and other gradle-related files.
And if incremental build is not the reason, then what is it and how to fix it? This:
Execution failed for task ':app:transformClassesWithDexForDebug'.
> com.android.build.api.transform.TransformException: com.android.ide.common.process.ProcessException: java.util.concurrent.ExecutionException: com.android.dex.DexIndexOverflowException: method ID not in [0, 0xffff]: 65536
looks like a gradle internal error. Am I right? Here is my build.gradle:
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.2.2'
// 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
}
com.android.dex.DexIndexOverflowException: method ID not in [0, 0xffff]: 65536
You must enable multidex for your project as total number of methods in your build exceeds 65536. See Configure Apps with Over 64K Methods
I don't even know where to start or even how to ask.
Information:Gradle tasks [:app:assembleDebug]
:app:preBuild UP-TO-DATE
:app:preDebugBuild UP-TO-DATE
:app:checkDebugManifest
:app:preReleaseBuild UP-TO-DATE
:app:prepareComAndroidSupportAppcompatV72311Library UP-TO-DATE
:app:prepareComAndroidSupportSupportV42311Library 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:generateDebugResources UP-TO-DATE
:app:mergeDebugResources FAILED
Error:Execution failed for task ':app:mergeDebugResources'.
java.lang.ArrayIndexOutOfBoundsException (no error message)
Information:BUILD FAILED
Information:Total time: 1.241 secs
Information:1 error
Information:0 warnings
Information:See complete output in console
I've never updated Android Studio, and I saw some similar problems and non of the solutions they gave worked for me.
I tried to change the class path from
dependencies {
classpath 'com.android.tools.build:gradle:1.5.0'
}
to
dependencies {
classpath 'com.android.tools.build:gradle:0.4.3'
}
I don't know where to go from there