How to use ngcordova facebook and push notification plugins in single ionic app - ionic-framework

when i am using ngCordova facebook and pushNotification plugins in same app and build the app then find the following error.
========================================================================
UNEXPECTED TOP-LEVEL EXCEPTION:
com.android.dex.DexException: Multiple dex files define Landroid/support/annotation/AnimRes;
at com.android.dx.merge.DexMerger.readSortableTypes(DexMerger.java:596)
at com.android.dx.merge.DexMerger.getSortedTypes(DexMerger.java:554)
at com.android.dx.merge.DexMerger.mergeClassDefs(DexMerger.java:535)
at com.android.dx.merge.DexMerger.mergeDexes(DexMerger.java:171)
at com.android.dx.merge.DexMerger.merge(DexMerger.java:189)
at com.android.dx.command.dexer.Main.mergeLibraryDexBuffers(Main.java:502)
at com.android.dx.command.dexer.Main.runMonoDex(Main.java:334)
at com.android.dx.command.dexer.Main.run(Main.java:277)
at com.android.dx.command.dexer.Main.main(Main.java:245)
at com.android.dx.command.Main.main(Main.java:106)
FAILED
FAILURE: Build failed with an exception.
What went wrong:
Execution failed for task ':dexDebug'.
com.android.ide.common.internal.LoggedErrorException: Failed to run command:
/opt/android-sdk-linux/build-tools/23.0.1/dx --dex --no-optimize --output /home/anurag/my-works/fbPush/platforms/android/build/intermediates/dex/debug --input-list=/home/anurag/my-works/fbPush/platforms/android/build/intermediates/tmp/dex/debug/inputList.txt
Error Code:
2
Output:
UNEXPECTED TOP-LEVEL EXCEPTION:
com.android.dex.DexException: Multiple dex files define Landroid/support/annotation/AnimRes;
at com.android.dx.merge.DexMerger.readSortableTypes(DexMerger.java:596)
at com.android.dx.merge.DexMerger.getSortedTypes(DexMerger.java:554)
at com.android.dx.merge.DexMerger.mergeClassDefs(DexMerger.java:535)
at com.android.dx.merge.DexMerger.mergeDexes(DexMerger.java:171)
at com.android.dx.merge.DexMerger.merge(DexMerger.java:189)
at com.android.dx.command.dexer.Main.mergeLibraryDexBuffers(Main.java:502)
at com.android.dx.command.dexer.Main.runMonoDex(Main.java:334)
at com.android.dx.command.dexer.Main.run(Main.java:277)
at com.android.dx.command.dexer.Main.main(Main.java:245)
at com.android.dx.command.Main.main(Main.java:106)
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: 38.579 secs
/home/anurag/my-works/fbPush/platforms/android/cordova/node_modules/q/q.js:126
throw e;
^
Error code 1 for command: /home/anurag/my-works/fbPush/platforms/android/gradlew with args: cdvBuildDebug,-b,/home/anurag/my-works/fbPush/platforms/android/build.gradle,-Dorg.gradle.daemon=true

I had the same issue on my app and i solved it by removing my cordova facebook plugin and adding this one : https://github.com/jeduan/cordova-plugin-facebook4
My push notification plugin is : phonegap-plugin-push

Related

FAILURE: Build failed with an exception.(audio_query)

I am creating a music player app..when I am trying to run app, the app was stopped and shows this error
FAILURE: Build failed with an exception.
What went wrong:
Execution failed for task ':on_audio_query:parseDebugLocalResources'.
Could not resolve all files for configuration ':on_audio_query:androidApis'.
Failed to transform android.jar to match attributes {artifactType=android-platform-attr, org.gradle.libraryelements=jar, org.gradle.usage=java-runtime}.
Execution failed for PlatformAttrTransform: C:\Users\ACER\AppData\Local\Android\sdk\platforms\android-30\android.jar.
C:\Users\ACER\AppData\Local\Android\sdk\platforms\android-30\android.jar
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 15s
Exception: Gradle task assembleDebug failed with exit code 1
Can anyone tell me, what is the problem occuring in audioquery? or please help me to find the solution!

I get this message while run the code which I got it from codecanyon?

Launching lib\main.dart on SM N960F in debug mode...
Running Gradle task 'assembleDebug'...
FAILURE: Build failed with an exception.
What went wrong:
Could not determine the dependencies of task ':braintree_payment:compileDebugAidl'.
Could not resolve all task dependencies for configuration ':braintree_payment:debugCompileClasspath'.
Could not resolve org.jfrog.cardinalcommerce.gradle:cardinalmobilesdk:2.2.1-2.
Required by:
project :braintree_payment > com.braintreepayments.api:three-d-secure:3.7.2
> Could not resolve org.jfrog.cardinalcommerce.gradle:cardinalmobilesdk:2.2.1-2.
> Could not get resource 'https://cardinalcommerce.bintray.com/android/org/jfrog/cardinalcommerce/gradle/cardinalmobilesdk/2.2.1-2/cardinalmobilesdk-2.2.1-2.pom'.
> Could not GET 'https://cardinalcommerce.bintray.com/android/org/jfrog/cardinalcommerce/gradle/cardinalmobilesdk/2.2.1-2/cardinalmobilesdk-2.2.1-2.pom'. Received status code 403 from server: Forbidden
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 19s
Exception: Gradle task assembleDebug failed with exit code 1
You are getting 403 Forbidden (error's last line). It means you don't have permission to access.
Received status code 403 from server: Forbidden

i got error message after i install image_picker flutter

I installed image_picker after that I get error message when i start app
this is error log
FAILURE: Build completed with 2 failures.
1: Task 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
> File 'com.android.builder.files.ZipCentralDirectory#40b49de9' was deleted, but previous version not found in cache
* 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.
==============================================================================
2: Task failed with an exception.
-----------
* What went wrong:
Execution failed for task ':app:mergeDebugNativeLibs'.
> A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$ActionFacade
> File 'com.android.builder.files.ZipCentralDirectory#5bca7644' was deleted, but previous version not found in cache
* 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 26s
Exception: Gradle task assembleDebug failed with exit code 1
what is this problem??
how can i solve this ~?
The error happened when you were installing it
So first check the steps again :
https://pub.dev/packages/image_picker
If not work, try to recover AndroidManifest.xml again and follow the instructions

Flutter Error running Gradle: ProcessException: Process "/home/benny/Documents/Afiaanyi/clone/mobile_app_codes/android/gradlew" exited abnormally

I have a flutter application am suppose to make little changes on, but the flutter is not running on my system, its showing many errors
Error running Gradle:
ProcessException: Process "/home/benny/Documents/Afiaanyi/clon/mobile_app_codes/android/gradlew" exited abnormally:
Starting a Gradle Daemon (subsequent builds will be faster)
Configure project :app
Observed package id 'system-images;android-26;google_apis;x86' in inconsistent location '/home/benny/Android/Sdk/system-images/android-27/google_apis/x86' (Expected '/home/benny/Android/Sdk/system-images/android-26/google_apis/x86')
registerResGeneratingTask is deprecated, use registerGeneratedResFolders(FileCollection)
registerResGeneratingTask is deprecated, use registerGeneratedResFolders(FileCollection)
registerResGeneratingTask is deprecated, use registerGeneratedResFolders(FileCollection)
Configure project :connectivity
Project evaluation failed including an error in afterEvaluate {}. Run with --stacktrace for details of the afterEvaluate {} error.
FAILURE: Build failed with an exception.
What went wrong:
A problem occurred configuring project ':connectivity'.
Could not resolve all artifacts for configuration ':connectivity:classpath'.
Could not download kotlin-stdlib-jdk7.jar (org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.3.11)
Could not get resource 'https://jcenter.bintray.com/org/jetbrains/kotlin/kotlin-stdlib-jdk7/1.3.11/kotlin-stdlib-jdk7-1.3.11.jar'.
Could not GET 'https://jcenter.bintray.com/org/jetbrains/kotlin/kotlin-stdlib-jdk7/1.3.11/kotlin-stdlib-jdk7-1.3.11.jar'. Received status code 504 from server: Gateway Time-out
Could not download kotlin-stdlib.jar (org.jetbrains.kotlin:kotlin-stdlib:1.3.11)
Could not get resource 'https://jcenter.bintray.com/org/jetbrains/kotlin/kotlin-stdlib/1.3.11/kotlin-stdlib-1.3.11.jar'.
Could not GET 'https://jcenter.bintray.com/org/jetbrains/kotlin/kotlin-stdlib/1.3.11/kotlin-stdlib-1.3.11.jar'. Received status code 502 from server: Bad Gateway
Could not download jsr305.jar (com.google.code.findbugs:jsr305:3.0.2)
Could not get resource 'https://jcenter.bintray.com/com/google/code/findbugs/jsr305/3.0.2/jsr305-3.0.2.jar'.
Could not GET 'https://jcenter.bintray.com/com/google/code/findbugs/jsr305/3.0.2/jsr305-3.0.2.jar'.
Remote host closed connection during handshake
Could not download checker-qual.jar (org.checkerframework:checker-qual:2.5.2)
Could not get resource 'https://jcenter.bintray.com/org/checkerframework/checker-qual/2.5.2/checker-qual-2.5.2.jar'.
Could not GET 'https://jcenter.bintray.com/org/checkerframework/checker-qual/2.5.2/checker-qual-2.5.2.jar'. Received status code 502 from server: Bad Gateway
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 8m 46s
Command: /home/benny/Documents/Afiaanyi/clone/mobile_app_codes/android/gradlew app:properties
Pls how can i debug this one step by step to fix all errors
Thanks for stopping to help
Are you in Europe? We had the same for the most of the day since noon.
Here is their Incident Report for today's issue:
https://status.bintray.com/incidents/nmtzpzv59hsd

FAILURE: Build failed with an exception. Ionic

I am trying to build a IONIC project but I am facing this exception and I am not able to debug the solution for this.I tried a lot of suggestions but there was no solution.I'm waiting for your help
1-ionic start test4 tabs
2-cd test4
3-ionic platform add android
4-ionic build android
ERROR
C:\Users\onurr\test4>ionic build android
Running command: "C:\Program Files\nodejs\node.exe"
C:\Users\onurr\test4\hooks\after_prepare\010_add_platform_class.js
C:\Users\onurr\test4
add to body class: platform-android
ANDROID_HOME=C:\Users\onurr\AppData\Local\Android\sdk
JAVA_HOME=C:\Program Files (x86)\Java\jdk1.8.0_112
Subproject Path: CordovaLib
Starting a new Gradle Daemon for this build (subsequent builds will be faster).
FAILURE: Build failed with an exception.
* What went wrong:
Unable to start the daemon process.
This problem might be caused by incorrect configuration of the daemon.
For example, an unrecognized jvm option is used.
Please refer to the user guide chapter on the daemon at https://docs.gradle.org/2.14.1/userguide/gradle_daemon.html
Please read the following process output to find out more:
-----------------------
Error occurred during initialization of VM
Could not reserve enough space for 2097152KB object heap
* 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:
Unable to start the daemon process.
This problem might be caused by incorrect configuration of the daemon.
For example, an unrecognized jvm option is used.
Please refer to the user guide chapter on the daemon at https://docs.gradle.org/2.14.1/userguide/gradle_daemon.html
Please read the following process output to find out more:
-----------------------
Error occurred during initialization of VM
Could not reserve enough space for 2097152KB object heap
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
I'm assuming you're using Windows looking at your stack trace.
Pay attention to this message in your stack trace:
Error occurred during initialization of VM
Could not reserve enough space for 2097152KB object heap
This normally happens when you have 32-bit JVM. If your OS is 64-bit, replace 32-bit JVM with 64-bit JVM. It has higher heap constraint and will solve the problem. This is the recommended solution.
Read this oracle documentation for more info.
If your OS is 32-bit, try setting up your OS as following and reissue ionic build android command (might need to restart Command Prompt):
Go to Start → Control Panel → System → Advanced System Settings → Advanced (tab) → Environment Variables → System Variables → New:
Variable name: _JAVA_OPTIONS
Variable value: -Xmx512M