I have just created a new helloworld project and hit build and deploy on my AVD and getting this error
full stack trace of gradle console is as follows
Executing tasks: [:helloWorld:assembleDebug]
Relying on packaging to define the extension of the main artifact has been deprecated and is scheduled to be removed in Gradle 2.0
:helloWorld:compileDebugNdk UP-TO-DATE
:helloWorld:preBuild UP-TO-DATE
:helloWorld:preDebugBuild UP-TO-DATE
:helloWorld:preReleaseBuild UP-TO-DATE
:helloWorld:prepareComAndroidSupportAppcompatV71900Library UP-TO-DATE
:helloWorld:prepareDebugDependencies
:helloWorld:compileDebugAidl UP-TO-DATE
:helloWorld:compileDebugRenderscript UP-TO-DATE
:helloWorld:generateDebugBuildConfig UP-TO-DATE
:helloWorld:mergeDebugAssets UP-TO-DATE
:helloWorld:mergeDebugResources UP-TO-DATE
:helloWorld:processDebugManifest UP-TO-DATE
:helloWorld:processDebugResources UP-TO-DATE
:helloWorld:generateDebugSources UP-TO-DATE
:helloWorld:compileDebugJava UP-TO-DATE
:helloWorld:preDexDebug
trouble writing output: null
FAILED
FAILURE: Build failed with an exception.
What went wrong:
Execution failed for task ':helloWorld:preDexDebug'.
> com.android.ide.common.internal.LoggedErrorException: Failed to run command:
C:\Users\ADMIN\AppData\Local\Android\android-studio\sdk\build-tools\android-4.4\dx.bat --dex --output C:\Users\ADMIN\AndroidStudioProjects\HelloWorld\helloWorld\build\pre-dexed\debug\classes-03192f978c99c1af96ffa2bf67c8f95252f876bd.jar C:\Users\ADMIN\AndroidStudioProjects\HelloWorld\helloWorld\build\exploded-bundles\ComAndroidSupportAppcompatV71900.aar\classes.jar
Error Code:
2
Output:
trouble writing output: null
Related
I am new to android studio and Gradle. I have a project where I am loading a large SQLite database (from assets folder). When I press run and select an emulator, android studio starts on the build and executes gradle tasks. I am getting an error on one of these tasks which says:
Error:Execution failed for task ':app:packageInstantRunResourcesDebug'.
> org.gradle.tooling.BuildException (no error message)
and in the complete error output in console it says this:
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:packageInstantRunResourcesDebug'.
> org.gradle.tooling.BuildException (no error message)
* 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 21s
I don't know if this is due to the large database. This is the stack trace of the tasks being built:
Executing tasks: [:app:assembleDebug]
:app:buildInfoDebugLoader
:app:preBuild UP-TO-DATE
:app:preDebugBuild UP-TO-DATE
:app:compileDebugAidl UP-TO-DATE
:app:compileDebugRenderscript UP-TO-DATE
:app:checkDebugManifest UP-TO-DATE
:app:generateDebugBuildConfig UP-TO-DATE
:app:prepareLintJar UP-TO-DATE
:app:generateDebugResValues UP-TO-DATE
:app:generateDebugResources UP-TO-DATE
:app:mergeDebugResources UP-TO-DATE
:app:createDebugCompatibleScreenManifests UP-TO-DATE
:app:processDebugManifest UP-TO-DATE
:app:splitsDiscoveryTaskDebug UP-TO-DATE
:app:processDebugResources UP-TO-DATE
:app:generateDebugSources
:app:javaPreCompileDebug UP-TO-DATE
:app:compileDebugJavaWithJavac UP-TO-DATE
:app:mergeDebugShaders UP-TO-DATE
:app:compileDebugShaders UP-TO-DATE
:app:generateDebugAssets UP-TO-DATE
:app:mergeDebugAssets UP-TO-DATE
:app:packageInstantRunResourcesDebug FAILED
:app:buildInfoGeneratorDebug
You need to disable Instant Run feature. Instruction for latest stable Android Studio:
File -> Settings -> Build, Execution, Deployment -> Instant Run -> [Remove checkbox] ""Enable Instant Run to hot sap code...""
This is the output I get
ionic cordova build android --stacktrace
> cordova build android
✖ Running command - failed!
[ERROR] Cordova encountered an error.
You may get more insight by running the Cordova command above directly.
[ERROR] An error occurred while running cordova build android (exit code 1):
(truncated) ... ld UP-TO-DATE
:CordovaLib:compileReleaseNdk UP-TO-DATE
:CordovaLib:copyReleaseLint UP-TO-DATE
:CordovaLib:mergeReleaseProguardFiles UP-TO-DATE
:CordovaLib:packageReleaseRenderscript UP-TO-DATE
:CordovaLib:checkReleaseManifest
:CordovaLib:prepareReleaseDependencies
:CordovaLib:compileReleaseRenderscript UP-TO-DATE
:CordovaLib:generateReleaseResValues UP-TO-DATE
:CordovaLib:generateReleaseResources UP-TO-DATE
:CordovaLib:packageReleaseResources UP-TO-DATE
:CordovaLib:compileReleaseAidl UP-TO-DATE
:CordovaLib:generateReleaseBuildConfig UP-TO-DATE
:CordovaLib:mergeReleaseShaders UP-TO-DATE
:CordovaLib:compileReleaseShaders UP-TO-DATE
:CordovaLib:generateReleaseAssets UP-TO-DATE
:CordovaLib:mergeReleaseAssets UP-TO-DATE
:CordovaLib:processReleaseManifest UP-TO-DATE
:CordovaLib:processReleaseResources UP-TO-DATE
:CordovaLib:generateReleaseSources UP-TO-DATE
:CordovaLib:incrementalReleaseJavaCompilationSafeguard UP-TO-DATE
:CordovaLib:compileReleaseJavaWithJavac UP-TO-DATE
:CordovaLib:processReleaseJavaRes UP-TO-DATE
:CordovaLib:transformResourcesWithMergeJavaResForRelease UP-TO-DATE
:CordovaLib:transformClassesAndResourcesWithSyncLibJarsForRelease UP-TO-DATE
:CordovaLib:mergeReleaseJniLibFolders UP-TO-DATE
:CordovaLib:transformNative_libsWithMergeJniLibsForRelease UP-TO-DATE
:CordovaLib:transformNative_libsWithSyncJniLibsForRelease UP-TO-DATE
:CordovaLib:bundleRelease UP-TO-DATE
:prepareComAndroidSupportSupportCompat2600Alpha1Library UP-TO-DATE
:prepareComAndroidSupportSupportCoreUi2600Alpha1Library UP-TO-DATE
:prepareComAndroidSupportSupportCoreUtils2600Alpha1Library UP-TO-DATE
:prepareComAndroidSupportSupportFragment2600Alpha1Library UP-TO-DATE
:prepareComAndroidSupportSupportMediaCompat2600Alpha1Library UP-TO-DATE
:prepareComAndroidSupportSupportV42600Alpha1Library UP-TO-DATE
:prepareComGoogleAndroidGmsPlayServicesAds1026Library UP-TO-DATE
:prepareComGoogleAndroidGmsPlayServicesAdsLite1026Library UP-TO-DATE
:prepareComGoogleAndroidGmsPlayServicesBase1026Library UP-TO-DATE
:prepareComGoogleAndroidGmsPlayServicesBasement1026Library UP-TO-DATE
:prepareComGoogleAndroidGmsPlayServicesClearcut1026Library UP-TO-DATE
:prepareComGoogleAndroidGmsPlayServicesGass1026Library UP-TO-DATE
:prepareComGoogleAndroidGmsPlayServicesTasks1026Library UP-TO-DATE
:prepareOrgXwalkXwalk_core_library22525614Library UP-TO-DATE
:prepareArmv7DebugDependencies
:compileArmv7DebugAidl UP-TO-DATE
:compileArmv7DebugRenderscript
:generateArmv7DebugBuildConfig UP-TO-DATE
:mergeArmv7DebugShaders UP-TO-DATE
:compileArmv7DebugShaders UP-TO-DATE
:generateArmv7DebugAssets UP-TO-DATE
:mergeArmv7DebugAssets UP-TO-DATE
:createXwalkCommandLineFileArmv7Debug
:generateArmv7DebugResValues UP-TO-DATE
:generateArmv7DebugResources
:mergeArmv7DebugResources
:processArmv7DebugManifest
:processArmv7DebugResources
:generateArmv7DebugSources
:incrementalArmv7DebugJavaCompilationSafeguard UP-TO-DATE
:compileArmv7DebugJavaWithJavac UP-TO-DATE
:compileArmv7DebugNdk UP-TO-DATE
:compileArmv7DebugSources UP-TO-DATE
:prePackageMarkerForArmv7Debug
:transformClassesWithDexForArmv7Debug UP-TO-DATE
:mergeArmv7DebugJniLibFolders UP-TO-DATE
:transformNative_libsWithMergeJniLibsForArmv7Debug UP-TO-DATE
:processArmv7DebugJavaRes UP-TO-DATE
:transformResourcesWithMergeJavaResForArmv7Debug FAILED
BUILD FAILED
Total time: 40.152 secs
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':transformResourcesWithMergeJavaResForArmv7Debug'.
> com.android.build.api.transform.TransformException: com.android.builder.packaging.DuplicateFileException: Duplicate files copied in APK META-INF/maven/com.squareup.okhttp3/okhttp/pom.properties
File1: C:\Users\A2\.gradle\caches\modules-2\files-2.1\com.squareup.okhttp3\okhttp\3.8.0\5a11f020cce2d11eb71ba916700600e18c4547e7\okhttp-3.8.0.jar
File2: C:\Users\A2\Desktop\posApAp\posApp\platforms\android\build\intermediates\exploded-aar\com.google.android.gms\play-services-basement\10.2.6\jars\classes.jar
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
Error: cmd: Command failed with exit code 1 Error output:
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':transformResourcesWithMergeJavaResForArmv7Debug'.
> com.android.build.api.transform.TransformException: com.android.builder.packaging.DuplicateFileException: Duplicate files copied in APK META-INF/maven/com.squareup.okhttp3/okhttp/pom.properties
File1: C:\Users\A2\.gradle\caches\modules-2\files-2.1\com.squareup.okhttp3\okhttp\3.8.0\5a11f020cce2d11eb71ba916700600e18c4547e7\okhttp-3.8.0.jar
File2: C:\Users\A2\Desktop\posApAp\posApp\platforms\android\build\intermediates\exploded-aar\com.google.android.gms\play-services-basement\10.2.6\jars\classes.jar
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
Can somebody please let me know how to sort this issue? Thank you.
It says Duplicate class copied. How to solve this issue. I tried exclude in build.gradle but it's not helping.
I encountered same issue while building my app and I solved it by
Update android SDK
Remove platform using proper command
ionic cordova platform remove android (if you are using latest CLI)
then add android platform again and build it.
if it still dont work, try downgrading nodejs to previous version and build.
Solved the question.
I needed to do exclude META-INF
Error:Execution failed for task ':app:processDebugResources'.
com.android.ide.common.process.ProcessException: Failed to execute aapt
I recently updated my version of android studio, when i create an activity now i get this error. Can someone explain this error to me?
Executing tasks: [:app:generateDebugSources, :app:generateDebugAndroidTestSources, :app:mockableAndroidJar, :app:prepareDebugUnitTestDependencies]
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\eche\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.
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:prepareComAndroidSupportAppcompatV72310Library
:app:prepareComAndroidSupportConstraintConstraintLayout101Library
:app:prepareComAndroidSupportDesign2310Library
:app:prepareComAndroidSupportRecyclerviewV72310Library
:app:prepareComAndroidSupportSupportV42310Library
: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
AGPBI: {"kind":"error","text":"No resource identifier found for attribute \u0027srcCompat\u0027 in package \u0027com.drawscape.drawscape\u0027","sources":[{"file":"C:\Users\eche\Documents\Drawscape 2.05\app\src\main\res\layout\activity_adminoptions.xml","position":{"startLine":24}}],"original":"","tool":"AAPT"}
C:\Users\eche\Documents\Drawscape 2.05\app\build\intermediates\res\merged\debug\layout\activity_adminoptions.xml:25: error: No resource identifier found for attribute 'srcCompat' in package 'com.drawscape.drawscape'
FAILED
FAILURE: Build failed with an exception.
What went wrong:
Execution failed for task ':app:processDebugResources'.
com.android.ide.common.process.ProcessException: Failed to execute aapt
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: 5.875 secs
I am unable to figure this out, I have tried installing SDK tools in my SDK manager for versions 20 through 24. I keep getting this error when I run
ionic build android
FAILURE: Build failed with an exception.
What went wrong:
Execution failed for task ':CordovaLib:compileDebugJavaWithJavac'.
Compilation failed; see the compiler error output for details.
Most articles I have seen with this error points to updating SDK tools which is not helping me.
Full output
Daves-MacBook-Pro:App dvero$ ionic build android
Running command: /Users/dvero/App/hooks/before_prepare/011_readonly.js
/Users/dvero/App
4.0.0
Running command:/Users/dvero/App/hooks/after_prepare/010_add_platform_class.js
/Users/dvero/App
add to body class: platform-android
ANDROID_HOME=/Users/dvero/Library/Android/sdk
JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.7.0_80.jdk/Contents/Home
Running: /Users/dvero/App/platforms/android/gradlew cdvBuildDebug -b
/Users/dvero/App/platforms/android/build.gradle -Dorg.gradle.daemon=true
embedded
org.xwalk:xwalk_core_library:16+
:copyCSSFiles
:copyIMGFiles
:copyJSFiles
:fixReferences UP-TO-DATE
:preBuild
:preArmv7DebugBuild
:checkArmv7DebugManifest
:preX86DebugBuild
:CordovaLib:compileLint
:CordovaLib:copyDebugLint UP-TO-DATE
:CordovaLib:mergeDebugProguardFiles UP-TO-DATE
:CordovaLib:preBuild UP-TO-DATE
:CordovaLib:preDebugBuild UP-TO-DATE
:CordovaLib:checkDebugManifest
:CordovaLib:prepareDebugDependencies
:CordovaLib:compileDebugAidl UP-TO-DATE
:CordovaLib:compileDebugRenderscript UP-TO-DATE
:CordovaLib:generateDebugBuildConfig UP-TO-DATE
:CordovaLib:generateDebugAssets UP-TO-DATE
:CordovaLib:mergeDebugAssets UP-TO-DATE
:CordovaLib:generateDebugResValues UP-TO-DATE
:CordovaLib:generateDebugResources UP-TO-DATE
:CordovaLib:packageDebugResources UP-TO-DATE
:CordovaLib:processDebugManifest UP-TO-DATE
:CordovaLib:processDebugResources UP-TO-DATE
:CordovaLib:generateDebugSources UP-TO-DATE
:CordovaLib:processDebugJavaRes UP-TO-DATE
:CordovaLib:compileDebugJavaWithJavac/Users/dvero/App/platforms/android/CordovaLib/src/org/apache/cordova/ResumeCallback.java:42: error: finished has private access in CallbackContext
if (finished) {
^
/Users/dvero/App/platforms/android/CordovaLib/src/org/apache/cordova/ResumeCallback.java:46: error: finished has private access in CallbackContext
finished = true;
^
/Users/dvero/App/platforms/android/CordovaLib/src/org/apache/cordova/ResumeCallback.java:74: error: cannot find symbol
appPlugin.sendResumeEvent(new PluginResult(PluginResult.Status.OK, result));
^
symbol: method sendResumeEvent(PluginResult)
location: variable appPlugin of type CoreAndroid
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
3 errors
FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':CordovaLib:compileDebugJavaWithJavac'.
> Compilation failed; see the compiler error output for details.
* 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: 3.126 secs
ERROR building one of the platforms: Error code 1 for command: /Users/dvero/App/platforms/android/gradlew with args: cdvBuildDebug,-b,/Users/dvero/App/platforms/android/build.gradle,-Dorg.gradle.daemon=true
You may not have the required environment or OS to build this project
Error: Error code 1 for command: /Users/dvero/App/platforms/android/gradlew with args: cdvBuildDebug,-b,/Users/dvero/App/platforms/android/build.gradle,-Dorg.gradle.daemon=true
Try:
cordova platform update android
and after
ionic build android
It worked for me
Hi I have installed the latest version of Android Studio on Windows 7 32-bit.
I have created a welcome app, but when I try to test it using AVD it's not launching, instead it's showing the error below:
Executing tasks: [:app:assembleDebug, :app:assembleDebugTest]
Configuration on demand is an incubating feature.
:app:preBuild
:app:compileDebugNdk UP-TO-DATE
:app:preDebugBuild
:app:checkDebugManifest
:app:preReleaseBuild
:app:prepareComAndroidSupportAppcompatV72102Library UP-TO-DATE
:app:prepareComAndroidSupportSupportV42102Library 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
:app:processDebugManifest UP-TO-DATE
:app:processDebugResources
:app:generateDebugSources
:app:compileDebugJava
:app:preDexDebug
The system cannot find the path specified.
The system cannot find the path specified.
FAILED
The system cannot find the path specified.
The system cannot find the path specified.
FAILURE: Build failed with an exception.
What went wrong:
Execution failed for task ':app:preDexDebug'.
> com.android.ide.common.internal.LoggedErrorException: Failed to run command:
E:\Android\AndroidStudio\sdk\build-tools\21.1.1\dx.bat --dex --output E:\Android\AndroidStudio\WorkLocation\MyApplication\app\build\intermediates\pre-dexed\debug\classes-0f52de9bbc91bb9956813aaf2c6f0ff9d0160fa0.jar E:\Android\AndroidStudio\WorkLocation\MyApplication\app\build\intermediates\exploded-aar\com.android.support\appcompat-v7\21.0.2\classes.jar
Error Code: 1
Output: The system cannot find the path specified.
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: 24.154 secs
**Failed to complete Gradle execution
Cause:**
Does anyone know how to fix this?