ionic 2 execution android failed - ionic2

C:\Users\ADMIN\Documents\dev\Breakingnews\trunk\Tawary\platforms\android\res\values\strings.xml: Error: Found item String/google_app_id more than one time
:mergeDebugResources FAILED
FAILURE: Build failed with an exception.
What went wrong:
BUILD FAILED
Total time: 12.285 secs
Execution failed for task ':mergeDebugResources'.
C:\Users\ADMIN\Documents\dev\Breakingnews\trunk\Tawary\platforms\android\res\values\strings.xml: Error: Found item String/google_app_id more than one time
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:
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
FAILURE: Build failed with an exception.
What went wrong:
Execution failed for task ':mergeDebugResources'.
C:\Users\ADMIN\Documents\dev\Breakingnews\trunk\Tawary\platforms\android\res\values\strings.xml: Error: Found item String/google_app_id more than one time
Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

Cause of error is under the path \your project root\platforms\android\res\values then check in strings.xml, there are two with same attribute. You need to fix this according to your plugins definition.

Related

Flutter build fails due to Amplify_core

I recently upgraded my flutter application to Android V2, and also made my code null safe.
Now when I try to run my code I get the below build error:
e: C:\flutter\.pub-cache\hosted\pub.dartlang.org\amplify_core-
0.4.0\android\src\main\kotlin\com\amazonaws\amplify\amplify_core\AtomicResult.kt: (26, 1):
Class 'AtomicResult' is not abstract and does not implement abstract member public abstract
fun error(p0: String, p1: String?, p2: Any?): Unit defined in
io.flutter.plugin.common.MethodChannel.Result
e: C:\flutter\.pub-cache\hosted\pub.dartlang.org\amplify_core-
0.4.0\android\src\main\kotlin\com\amazonaws\amplify\amplify_core\AtomicResult.kt: (54, 5):
'error' overrides nothing
e: C:\flutter\.pub-cache\hosted\pub.dartlang.org\amplify_core-
0.4.0\android\src\main\kotlin\com\amazonaws\amplify\amplify_core\AtomicResult.kt: (66, 26):
Type mismatch: inferred type is String? but String was expected
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':amplify_core:compileDebugKotlin'.
> Compilation error. See log for more details
* 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
Things I tried that did not work:
Clearing build and cache and restarting
Deleted the amplify_core-0.4.0 from the pub.dartlang.org folder and tried again
Initialized Amplify again and pulled the environment from the Launch Studio again
Any help would be greatly appreciated!
Thanks
I was able to solve this issue by changing my channel from Master to Stable.
In the next release of Amplify staying on the Master channel won't present this issue.
run this command -->>
dart pub upgrade --major-versions

mlUnitTest throws a java.nio.file.NoSuchFileException at the end of the tests

I try to use mlunitTest with ml-gradle 3.17.1 and Marklogic marklogic-unit-test-client:1.0.0
All the tests are OK, I test with my test user on the UI and with ml-gradle.
But when ml-gradle wants to access the results in a directory [build\test-results\marklogic-unit-test\TEST-{test-name}], java throws an error because the file isn't there.
Just before there is a comment who precises that it clears the directory.
Does anyone use the mlunitTest without this problem?
it's the same if i give the name of the result directory with the parameter : -PunitTestResultsPath=testML
Here are the traces of this part of execution :
Done running all suites; time: 82ms
4 tests completed, 0 failed
Deleted existing results directory: build\test-results\marklogic-unit-test
Releasing connection
:mlUnitTest (Thread[Execution worker for ':',5,main]) completed. Took 0.093 secs.
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':mlUnitTest'.
> java.nio.file.NoSuchFileException: build\test-results\marklogic-unit-test\TEST-historicId.xml
Try release 4.3.0 - it includes the following fix - https://github.com/marklogic-community/ml-gradle/issues/599

Gradle and Cmake failing to find cpp file that is definitely there

I run gradle to build an android .aar and it reports that it can't find a file, but the file definitely is there.
$ ./gradlew.bat assembleRelease
> Task :webrtc-native:externalNativeBuildRelease FAILED
Build mrwebrtc arm64-v8a
ninja: error: 'C:/Developer/Microsoft-MRWebRTC/libs/mrwebrtc/src/interop/data_channel_interop.cpp', needed by 'CMakeFiles/mrwebrtc.dir/C_/Developer/Microsoft-MRWebRTC/libs/mrwebrtc/src/interop/data_channel_interop.cpp.o', missing and no known rule to make it
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':webrtc-native:externalNativeBuildRelease'.
> Build command failed.
Error while executing process C:\Users\User\AppData\Local\Android\Sdk\cmake\3.10.2.4988404\bin\cmake.exe with arguments {--build C:\Developer\Microsoft-MRWebRTC\tools\build\android\webrtc-native\.externalNativeBuild\cmake\release\arm64-v8a --target mrwebrtc}
ninja: error: 'C:/Developer/Microsoft-MRWebRTC/libs/mrwebrtc/src/interop/data_channel_interop.cpp', needed by 'CMakeFiles/mrwebrtc.dir/C_/Developer/Microsoft-MRWebRTC/libs/mrwebrtc/src/interop/data_channel_interop.cpp.o', missing and no known rule to make it
But the file C:/Developer/Microsoft-MRWebRTC/libs/mrwebrtc/src/interop/data_channel_interop.cpp is definitely there.
$ cd C:/Developer/Microsoft-MRWebRTC/libs/mrwebrtc/src/interop/
User MSYS /c/Developer/Microsoft-MRWebRTC/libs/mrwebrtc/src/interop (master)
$ ls
data_channel_interop.cpp global_factory.cpp interop_api.cpp local_video_track_interop.cpp remote_audio_track_interop.cpp transceiver_interop.cpp
external_video_track_source_interop.cpp global_factory.h local_audio_track_interop.cpp peer_connection_interop.cpp remote_video_track_interop.cpp
Could anyone help? I am kind of running out of ideas on this.
I discovered it was because I had 'caseSensitive' flags enabled on some of my directories. Be careful, this is a new feature of WSL2 and there are some peculiarities where you may be enabled in without realizing. Windows cmake cannot traverse directories that have this flag enabled on them.
Read about it here:
https://devblogs.microsoft.com/commandline/per-directory-case-sensitivity-and-wsl/

Ionic 3 after install admob plugin app build failed

When i build a android app in ionic 3 it was build. but after using admobFree or admobPro plugin every time build failed and i get this error....
(Due to post limit i am posting last few lines of error)
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:transformDexArchiveWithExternalLibsDexMergerForDebug'.
> com.android.builder.dexing.DexArchiveMergerException: Unable to merge dex
* 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 3m 22s
38 actionable tasks: 12 executed, 26 up-to-date
(node:11476) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): Error: cmd: Command failed with exit code 1 Error output:
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: Some input files use unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:transformDexArchiveWithExternalLibsDexMergerForDebug'.
> com.android.builder.dexing.DexArchiveMergerException: Unable to merge dex
* 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 3m 22s
[OK] Your app has been deployed.
Did you know you can live-reload changes from your app with --livereload?
C:\Users\SHEKH RAIES\Raies-Ionic\test\file-upload\upload>
I am late. but hope this might help developers searching for an answer. I have gone through a lot to fix this issue. documentation didn't help. changing the configuration didn't do anything. removing and readding platform didn't help. etc
Here is how I fixed this.
open file
project-folder/plugins/cordova-admob-sdk/plugin.xml
check this part
<platform name="android">
<preference name="PLAY_SERVICES_VERSION" default="11.0"/>
<framework src="com.google.android.gms:play-services-base:$PLAY_SERVICES_VERSION" />
<framework src="com.google.android.gms:play-services-ads:$PLAY_SERVICES_VERSION" />
</platform>
see file project-folder/platforms/android/build.gradle ( this file changes each time when project is build)
this dependencies part
dependencies {
implementation fileTree(dir: 'libs', include: '*.jar')
// SUB-PROJECT DEPENDENCIES START
implementation(project(path: "CordovaLib"))
compile "com.android.support:appcompat-v7:23+"
compile "com.google.android.gms:play-services-base:11.0"
compile "com.google.android.gms:play-services-ads:11.0"
compile "com.google.android.gms:play-services-analytics:+"
compile "com.android.support:support-v4:27.+"
// SUB-PROJECT DEPENDENCIES END
}
see another file project-folder/platforms/android/project.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/odi-ignorelinterrors.gradle
cordova.gradle.include.2=com.synconset.imagepicker/odi-androidtarget.gradle
cordova.system.library.2=com.google.android.gms:play-services-base:11.0
cordova.system.library.3=com.google.android.gms:play-services-ads:11.0
cordova.system.library.4=com.google.android.gms:play-services-analytics:+
cordova.gradle.include.3=phonegap-plugin-barcodescanner/odi-barcodescanner.gradle
cordova.system.library.5=com.android.support:support-v4:27.+
How i fixed
1 - changed file
project-folder/plugins/cordova-admob-sdk/plugin.xml
from 11.0 to + so it would look like this
<platform name="android">
<preference name="PLAY_SERVICES_VERSION" default="+"/>
<framework src="com.google.android.gms:play-services-base:$PLAY_SERVICES_VERSION" />
<framework src="com.google.android.gms:play-services-ads:$PLAY_SERVICES_VERSION" />
</platform>
2 - build (sudo ionic cordova build android)
that's it.
After building see file project-folder/platforms/android/build.gradle
the dependencies part. looks like this
dependencies {
implementation fileTree(dir: 'libs', include: '*.jar')
// SUB-PROJECT DEPENDENCIES START
implementation(project(path: "CordovaLib"))
compile "com.android.support:appcompat-v7:23+"
compile "com.google.android.gms:play-services-base:11.0"
compile "com.google.android.gms:play-services-ads:11.0"
compile "com.google.android.gms:play-services-analytics:+"
compile "com.android.support:support-v4:27.+"
// SUB-PROJECT DEPENDENCIES END
}
and project-folder/platforms/android/project.properties looks like this
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/odi-ignorelinterrors.gradle
cordova.gradle.include.2=com.synconset.imagepicker/odi-androidtarget.gradle
cordova.system.library.2=com.google.android.gms:play-services-base:+
cordova.system.library.3=com.google.android.gms:play-services-ads:+
cordova.system.library.4=com.google.android.gms:play-services-analytics:+
cordova.gradle.include.3=phonegap-plugin-barcodescanner/odi-barcodescanner.gradle
cordova.system.library.5=com.android.support:support-v4:27.+

Build failed apk with AdMobPro

i detect the problem is with AdMobPro plugin
cordova plugin add https://github.com/floatinghotpot/cordova-admob-pro
cordova build android
stacktrace
cordova build android
ANDROID_HOME=C:\Users\Yassine\AppData\Local\Android\sdk
JAVA_HOME=C:\Program Files\Java\jdk1.8.0_102 Subproject Path:
CordovaLib The Task.leftShift(Closure) method has been deprecated and
is scheduled to be removed in Gradle 5.0. Please use
Task.doLast(Action) instead.
at build_axxz9tj19izrj5q0qkz0lbpfl.run(F:\test1\platforms\android\build.gradle:137)
The JavaCompile.setDependencyCacheDir() method has been deprecated and
is scheduled to be removed in Gradle 4.0. Incremental java compilation
is an incubating feature. The TaskInputs.source(Object) method has
been deprecated and is scheduled to be removed in Gradle 4.0. Please
use TaskInputs.file(Object).skipWhenEmpty() instead. :preBuild
UP-TO-DATE :preDebugBuild UP-TO-DATE :checkDebugManifest
:preReleaseBuild UP-TO-DATE :CordovaLib:preBuild UP-TO-DATE
:CordovaLib:preDebugBuild UP-TO-DATE :CordovaLib:checkDebugManifest
:CordovaLib:prepareDebugDependencies :CordovaLib:compileDebugAidl
:CordovaLib:compileDebugNdk UP-TO-DATE :CordovaLib:compileLint
:CordovaLib:copyDebugLint UP-TO-DATE :CordovaLib:mergeDebugShaders
:CordovaLib:compileDebugShaders :CordovaLib:generateDebugAssets
:CordovaLib:mergeDebugAssets :CordovaLib:mergeDebugProguardFiles
UP-TO-DATE :CordovaLib:packageDebugRenderscript UP-TO-DATE
:CordovaLib:compileDebugRenderscript
:CordovaLib:generateDebugResValues :CordovaLib:generateDebugResources
:CordovaLib:packageDebugResources :CordovaLib:processDebugManifest
:CordovaLib:generateDebugBuildConfig :CordovaLib:processDebugResources
:CordovaLib:generateDebugSources
:CordovaLib:incrementalDebugJavaCompilationSafeguard
:CordovaLib:compileDebugJavaWithJavac
:CordovaLib:compileDebugJavaWithJavac - 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. :CordovaLib:processDebugJavaRes UP-TO-DATE :CordovaLib:transformResourcesWithMergeJavaResForDebug
:CordovaLib:transformClassesAndResourcesWithSyncLibJarsForDebug
:CordovaLib:mergeDebugJniLibFolders
:CordovaLib:transformNative_libsWithMergeJniLibsForDebug
:CordovaLib:transformNative_libsWithSyncJniLibsForDebug
:CordovaLib:bundleDebug :CordovaLib:preReleaseBuild UP-TO-DATE
:CordovaLib:checkReleaseManifest
:CordovaLib:prepareReleaseDependencies :CordovaLib:compileReleaseAidl
:CordovaLib:compileReleaseNdk UP-TO-DATE :CordovaLib:copyReleaseLint
UP-TO-DATE :CordovaLib:mergeReleaseShaders
:CordovaLib:compileReleaseShaders :CordovaLib:generateReleaseAssets
:CordovaLib:mergeReleaseAssets :CordovaLib:mergeReleaseProguardFiles
UP-TO-DATE :CordovaLib:packageReleaseRenderscript UP-TO-DATE
:CordovaLib:compileReleaseRenderscript
:CordovaLib:generateReleaseResValues
:CordovaLib:generateReleaseResources
:CordovaLib:packageReleaseResources :CordovaLib:processReleaseManifest
:CordovaLib:generateReleaseBuildConfig
:CordovaLib:processReleaseResources :CordovaLib:generateReleaseSources
:CordovaLib:incrementalReleaseJavaCompilationSafeguard
:CordovaLib:compileReleaseJavaWithJavac
:CordovaLib: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. :CordovaLib:processReleaseJavaRes UP-TO-DATE :CordovaLib:transformResourcesWithMergeJavaResForRelease
:CordovaLib:transformClassesAndResourcesWithSyncLibJarsForRelease
:CordovaLib:mergeReleaseJniLibFolders
:CordovaLib:transformNative_libsWithMergeJniLibsForRelease
:CordovaLib:transformNative_libsWithSyncJniLibsForRelease
:CordovaLib:bundleRelease
:prepareComAndroidSupportSupportCompat2520Library
:prepareComAndroidSupportSupportCoreUi2520Library
:prepareComAndroidSupportSupportCoreUtils2520Library
:prepareComAndroidSupportSupportFragment2520Library
:prepareComAndroidSupportSupportMediaCompat2520Library
:prepareComAndroidSupportSupportV42520Library
:prepareComGoogleAndroidGmsPlayServicesAds1104Library
:prepareComGoogleAndroidGmsPlayServicesAdsLite1104Library
:prepareComGoogleAndroidGmsPlayServicesBase1104Library
:prepareComGoogleAndroidGmsPlayServicesBasement1104Library
:prepareComGoogleAndroidGmsPlayServicesClearcut1104Library
:prepareComGoogleAndroidGmsPlayServicesGass1104Library
:prepareComGoogleAndroidGmsPlayServicesSafetynet1104Library
:prepareComGoogleAndroidGmsPlayServicesTasks1104Library
:prepareOrgApacheCordovaCordovaLib623DebugLibrary
:prepareDebugDependencies :compileDebugAidl :compileDebugRenderscript
:generateDebugBuildConfig :generateDebugResValues
:generateDebugResources :mergeDebugResources Error: Failed to crunch
file
F:\test1\platforms\android\build\intermediates\exploded-aar\com.google.android.gms\play-services-base\11.0.4\res\drawable-xxhdpi-v4\common_google_signin_btn_icon_light_normal_background.9.png into
F:\test1\platforms\android\build\intermediates\res\merged\debug\drawable-xxhdpi-v4\common_google_signin_btn_icon_light_normal_background.9.png :mergeDebugResources FAILED
FAILURE: Build failed with an exception.
What went wrong: Execution failed for task ':mergeDebugResources'.
Error: Failed to crunch file F:\test1\platforms\android\build\intermediates\exploded-aar\com.google.android.gms\play-services-base\11.0.4\res\drawable-xxhdpi-v4\common_google_signin_btn_icon_light_normal_background.9.png into
F:\test1\platforms\android\build\intermediates\res\merged\debug\drawable-xxhdpi-v4\common_google_signin_btn_icon_light_normal_background.9.png
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: 21.484 secs Error: cmd: Command failed with exit code 1
Error output: Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details. Note: Some input
files use or override a deprecated API. Note: Recompile with
-Xlint:deprecation for details.
FAILURE: Build failed with an exception.
What went wrong: Execution failed for task ':mergeDebugResources'.
Error: Failed to crunch file F:\test1\platforms\android\build\intermediates\exploded-aar\com.google.android.gms\play-services-base\11.0.4\res\drawable-xxhdpi-v4\common_google_signin_btn_icon_light_normal_background.9.png into
F:\test1\platforms\android\build\intermediates\res\merged\debug\drawable-xxhdpi-v4\common_google_signin_btn_icon_light_normal_background.9.png
Try: Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
if i remove this plugin admobpro and build it is work