Ionic 3 after install admob plugin app build failed - build

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.+

Related

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/

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

Chromium build failed (Windows 10)

Good afternoon. Tell me who build Chromium om Windows. It is required to brand Chromium (start page, bookmarks, tray icons, name), collect according to the instructions at the site chromium. When assembling through VS 2015, the following error list appears. The assembly takes place on the server, 64 GB RAM, Intel Xeon.
The compilation goes to 60-70%, after which VS crashes, restarts and gives an error: "The following files can not be found - all.sln - so they will not be loaded" - after this error the assembly stops, I tried 10 times already.
Ninja: build stopped: subcommand failed. Warning: premature end of file; Recovering
FAILED: obj / third_party / yasm / yasm_utils / xmalloc.obj
First, try running the build from command line:
ninja -C src/out/Default
If it still fails, make sure you carefully followed prerequisites installation instructions. Specifically, try gclient sync -f and make sure it finished normally before building.

ionic 2 execution android failed

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.

teamcity test never fails

I am implementing a Powershell build script for teamcity to test some functionality, but cannot figure out out to report an error.
I am trying to follow this description:
https://confluence.jetbrains.com/display/TCD8/Build+Script+Interaction+with+TeamCity#BuildScriptInteractionwithTeamCity-ReportingTests
However, although the script actually results in some tests being registered, it refuses to report errors. I am now back to the basic example from the . I have the following Powershell build step (error output: error, script: source):
Write-Host("##teamcity[testStarted name='className.testName']")
Write-Host("##teamcity[testStdErr name='className.testName' out='error text']")
Write-Host("##teamcity[testFinished name='className.testName']")
Resulting build log (verbose):
[13:27:12]Step 1/5: Output to build log (Powershell)
[13:27:13][Step 1/5] ##teamcity[buildStatisticValue key='buildStageDuration:firstStepPreparation' value='156.0']
[13:27:13][Step 1/5] ##teamcity[buildStatisticValue key='buildStageDuration:buildStepRUNNER_18' value='0.0']
[13:27:13][Step 1/5] Starting: C:\Windows\SysWOW64\WindowsPowerShell\v1.0\powershell.exe -NonInteractive -ExecutionPolicy ByPass -Command - < D:\JetBrains\buildagent\temp\buildTmp\powershell6640337654487221076.ps1
[13:27:13][Step 1/5] in directory: D:\JetBrains\buildagent\work\7e3fac8e390ca38d
[13:27:13][Step 1/5] className.testName
[13:27:13][className.testName] [Test Error Output] error text
[13:27:13][Step 1/5] Process exited with code 0
[13:27:13][Step 1/5] ##teamcity[buildStatisticValue key='buildStageDuration:buildStepRUNNER_18' value='536.0']
I.e. the test is registered in teamcity as executed bit it succeeds! I would expect the test to fail, due to the 'testStdErr' output! What it the correct way to make it fail?
Thanks,
Kim
You should use the testFailed directive which is listed on the page you linked:
##teamcity[testFailed name='MyTest.test1' message='failure message' details='message and stack trace']
Or change the build failure condition settings under 'Build Failure Conditions' to fail the build if you write to stderr (edit: this is my understand of the docs anyway):
Fail build if:
[ ] an error message is logged by build runner