Execution failed for task ':transformDexArchiveWithExternalLibsDexMergerForDebug' - android

I have an ionic application shows error when i run ionic cordova build android
BUILD FAILED in 4s (node:5692) UnhandledPromiseRejectionWarning:
Unhandled promise rejection (rejection id: 1): Error:
/home/bharathi/ionic/hourli/platforms/android/gradlew: Command failed
with exit code 1 Error output: FAILURE: Build failed with an
exception.
What went wrong: Execution failed for task ':transformDexArchiveWithExternalLibsDexMergerForDebug'.
com.android.builder.dexing.DexArchiveMergerException: Unable to merge dex
projects.properties
target=android-26
android.library.reference.1=CordovaLib
cordova.system.library.1=com.android.support:appcompat-v7:23+
cordova.gradle.include.1=com.synconset.imagepicker/app-ignorelinterrors.gradle
cordova.gradle.include.2=com.synconset.imagepicker/app-androidtarget.gradle
cordova.gradle.include.3=cordova-plugin-badge/app-badge.gradle
cordova.system.library.2=com.facebook.android:facebook-android-sdk:4.+
cordova.system.library.3=com.google.android.gms:play-services-auth:11.6.2
cordova.system.library.4=com.google.android.gms:play-services-identity:11.6.2
cordova.system.library.5=com.android.support:support-v4:+
cordova.gradle.include.4=cordova-plugin-local-notification/app-localnotification.gradle
cordova.system.library.6=com.android.support:support-v4:24.1.1+
cordova.system.library.7=com.android.support:support-v4:26.+
cordova.system.library.8=com.android.support:support-v13:26.+
cordova.system.library.9=me.leolin:ShortcutBadger:1.1.17#aar
cordova.system.library.10=com.google.firebase:firebase-messaging:11.6.2
cordova.gradle.include.5=phonegap-plugin-push/app-push.gradle
build.gradle
defaultConfig {
multiDexEnabled true
}
i have added multiDexEnabled in build.gradle,still getting the same error when i try to build.I tried after
ionic cordova platform rm android
ionic cordova platform add android
but still getting the same error

It occured for me. Fixed with:
cordova clean

After 2 days trying to fix it I found a solution, in my case the following plugins caused a crash: cordova-admob-sdk, cordova-plugin-firebase and I changed manually the play-services-ads version in "project.properties" and "build.gradle" files from "com.google.android.gms:play-services-ads:+" to "com.google.android.gms:play-services-ads:16.0.0"

Related

Failed to install the app in android emulator in React Native

I'm trying to run my react native CLI app in an android emulator but it getting errors to install in the emulator.
* What went wrong:
Execution failed for task ':app:processDebugResources'.
> A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$ActionFacade
> Android resource linking failed
E:\Program Files\React Native CLI\testDemo\android\CLI\testDemo\node_modules\react-native-image-crop-picker\android\build\intermediates\library_manifest\debug\AndroidManifest.xml:10:5-14:15: AAPT: error: unexpected element <queries> found in <manifest>.
And already installed this dependency react-native-image-crop-picker in react native, I have perfectly set up the environment variables which are mentioned by Facebook. And this error is showing up
error Failed to install the app. Make sure you have the Android development environment set up: https://reactnative.dev/docs/environment-setup. Run CLI with --verbose flag for more details.
Error: Command failed: gradlew.bat app:installDebug -PreactNativeDevServerPort=8081
Manifest File has no error you see it
Kindly please what should I do to resolve this issue.
Acording to here its look like known issue.Try to upgrade gradle and rebuild.
buildscript
{
...
dependencies {
// classpath 'com.android.tools.build:gradle:4.0.0'
classpath 'com.android.tools.build:gradle:4.0.1'
}
...
}

React Native Failed to build after Installing react-navigation and react-native-gesture-handler

I did the following
react-native init project-name
yarn add react-navigation react-native-gesture-handler and
react-native run-android
The dependencies installed successfully but the app failed to build with the following errors
> Task :react-native-gesture-handler:packageDebugResources FAILED
17 actionable tasks: 8 executed, 9 up-to-date
> FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':react-native-gesture-handler:packageDebugResources'.
> Could not resolve all files for configuration ':react-native-gesture-handler:_
internal_aapt2_binary'.
> Failed to transform artifact 'aapt2-windows.jar (com.android.tools.build:aa
pt2:3.4.1-5326820)' to match attributes {artifactType=_internal-android-aapt2-bi
nary, org.gradle.usage=java-runtime-jars}.
> org.gradle.api.GradleException: Could not read path 'C:\Users\DevLewa\.g
radle\caches\transforms-2\files-2.1\3d408b3640f7dfba25695085d22596b0\aapt2-3.4.1
-5326820-windows'.
I have searched all through github issues but found no helping information, how do I resolve this, I have being on it since morning today.
Thanks
I had the same problem with some of my initialized projects using reac-native cli. it would be solved by running: react-native link in your project directory. I hope it would work for you as me.
If it was helpful please vote me up:)

Ionic 4 Build Issue when add cordova-firebase plugin

When I create basic IONIC 4 application and run > ionic cordova build android
it works fine and apk generated.
When I add plugin firebase > ionic cordova plugin add cordova-plugin-firebase
It failed to build application.
ERROR:
\platforms\android\gradlew: Command failed with exit code 1 Error output:
FAILURE: Build failed with an exception.
What went wrong:
Failed to capture fingerprint of input files for task ':app:preDebugBuild' property 'compileManifests' during up-to-date check.
The library com.google.android.gms:play-services-measurement-base is being requested by various other libraries at [[16.5.0,16.5.0], [16.4.0,16.4.0]], but resolves to 16.5.0. Disable the plugin and check your dependencies tree using ./gradlew :app:dependencies.

ionic: phonegap-push-plugin conflict

I am working with ionic's phonegap-push-plugin
after installing this plugin I an unable to make build
getting following error:
BUILD FAILED in 0s
21 actionable tasks: 1 executed, 20 up-to-date
(node:30863) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): Error: /home/earth/UnicusGit/unicusApp/platforms/android/gradlew: Command failed with exit code 1 Error output:
FAILURE: Build failed with an exception.
What went wrong:
Execution failed for task ':app:processDebugGoogleServices'.
Please fix the version conflict either by updating the version of the google-services plugin (information about the latest version is available at https://bintray.com/android/android-tools/com.google.gms.google-services/) or updating the version of com.google.android.gms to 10.+.
I have tried below command for updating version of com.google.android.gms to 10.+.
cordova plugin add cordova-android-play-services-gradle-release --variable PLAY_SERVICES_VERSION=10.+
but it does not work for me.
For this error, please check your FCm version while installing phonegap plugin, It help me to resolve my conflict.
I have used following command for specifying version of fcm version:
ionic cordova plugin add phonegap-plugin-push --variable FCM_VERSION=17.3.2

Android Build failed after adding Crosswalk to Ionic

Got excited about Ionic adding Crosswalk and now my project won't build. The project was compiling and working before updating and adding Crosswalk. Anyone have any suggestions on how I can correct the error below? I prefer not to rollback. Thank goodness for version control :)
System information:
OS: Windows 8
Node Version: v0.10.32
Cordova CLI: 4.2.0
Ionic Version: 1.0.0-beta.14
Ionic CLI Version: 1.3.1
AngularJS v1.3.8
WARNING [Project: :org.apache.cordova.engine.crosswalk:382300-xwalk_core_library] Current NDK support is deprecated. Alternative will be provided in the future.
:mergeDebugResourcesC:\Users\platforms\android\build\intermediates\exploded-aar\android.org.apache.cordova.engine
.crosswalk\rsgapp382300-xwalk_core_library\unspecified\debug\res\drawable-hdpi-v4\color_picker_advanced_select_handle.png
ERROR: Unable to open PNG file
Error: Failed to run command:
C:\Users\AppData\Local\Android\sdk\build-tools\21.0.2\aapt.exe s-i C:\Users\platforms\android\build\intermediates\exploded-aar\android.org.apache.cordova.engine.crosswalk 382300-xwalk_core_library\unspecified\debug\res\drawable-hdpi-v4\color_picker_advanced_select_handle.png -o C:\Users\platforms\android\build\intermediates\res\debug\drawable-hdpi-v4\color_picker_advanced_select_handle.png
Error Code: 42
Output: C:\Users\platforms\android\build\intermediates\exploded-aar\android.org.apache.cordova.engine.crosswalk382300-xwalk_core_library\unspecified\debug\res\drawable-hdpi-v4\color_pick
er_advanced_select_handle.png
ERROR: Unable to open PNG file
:mergeDebugResources FAILED
FAILURE: Build failed with an exception.
What went wrong: Execution failed for task ':mergeDebugResources'.
Error: Failed to run command: C:\Users\AppData\Local\Android\sdk\build-tools\21.0.2\aapt.exe s -i C:\Users\platforms\android\build\intermediates\exploded-aar\android.org.apache.cordova.engine.crosswalk 382300-xwalk_core_library\unspecified\debug\res\drawable-hdpi-v4\color_picker_advanced_select_handle.png -o C:\Users\platforms\android\build\intermediates\res\debug\drawable-hdpi-v4\color_picker_advanced_select_handle.png
Error Code: 42
Output: C:\Users\platforms\android\build\intermediates\exploded-aar\android.org.apache.cordova.engine.crosswalk382300-xwalk_core_library\unspecified\debug\res\drawable-hdpi-v4\color_picker_advanced_select_handle.png
ERROR: Unable to open PNG file
Looks like you were getting similar errors to this question, which was that on Windows, path names are restricted to 260 characters, so moving to a directory with a shorter path name should fix your issues.

Categories

Resources