Android resource linking failed when adding Google Ads mediation (Unity) - unity3d

I had the "Android resource linking failed" error when trying to build gradle. I didn't have this error until I added the Google mediation SDKs (it worked with GoogleMobileAds SDK without mediation), I tried forcing resolve, and everything else I could find online. It's the mediation SDKs for sure. I tried everything, with and without, and as soon I'm importing any one of the SDKs I'm getting these errors.
I am using Unity 2019.4.17f1, and all Unity Android modules installed as recommended. I used the latest version of the mediation SDKs and GoogleMobileAds SDK.
Using:
Google Mobile Ads v5.4.0,
Facebook Unity Mediation Plugin 3.1.0,
Unity Ads Mediation Plugin 2.6.0
The detailed error written below, as well as my console screenshot.
Task :unityLibrary:preBuild UP-TO-DATE Task :unityLibrary:GoogleMobileAdsPlugin.androidlib:preBuild UP-TO-DATE Task :launcher:preBuild UP-TO-DATE Task :unityLibrary:preReleaseBuild UP-TO-DATE Task :unityLibrary:GoogleMobileAdsPlugin.androidlib:preReleaseBuild UP-TO-DATE Task :unityLibrary:checkReleaseManifest UP-TO-DATE Task :launcher:prepareLintJar UP-TO-DATE Task :unityLibrary:GoogleMobileAdsPlugin.androidlib:checkReleaseManifest Task :unityLibrary:GoogleMobileAdsPlugin.androidlib:processReleaseManifest Task :unityLibrary:GoogleMobileAdsPlugin.androidlib:compileReleaseAidl NO-SOURCE Task :unityLibrary:GoogleMobileAdsPlugin.androidlib:packageReleaseRenderscript NO-SOURCE Task :unityLibrary:processReleaseManifest Task :unityLibrary:GoogleMobileAdsPlugin.androidlib:compileReleaseRenderscript NO-SOURCE Task :unityLibrary:compileReleaseAidl NO-SOURCE Task :unityLibrary:packageReleaseRenderscript NO-SOURCE Task :unityLibrary:compileReleaseRenderscript NO-SOURCE Task :unityLibrary:generateReleaseBuildConfig UP-TO-DATE Task :unityLibrary:generateReleaseResValues UP-TO-DATE Task :unityLibrary:generateReleaseResources UP-TO-DATE Task :unityLibrary:GoogleMobileAdsPlugin.androidlib:generateReleaseResValues Task :unityLibrary:GoogleMobileAdsPlugin.androidlib:generateReleaseResources Task :unityLibrary:packageReleaseResources UP-TO-DATE Task :unityLibrary:prepareLintJar UP-TO-DATE Task :unityLibrary:generateReleaseSources UP-TO-DATE Task :unityLibrary:prepareLintJarForPublish UP-TO-DATE Task :unityLibrary:mergeReleaseShaders UP-TO-DATE Task :unityLibrary:compileReleaseShaders UP-TO-DATE Task :unityLibrary:generateReleaseAssets UP-TO-DATE Task :unityLibrary:GoogleMobileAdsPlugin.androidlib:packageReleaseResources Task :unityLibrary:GoogleMobileAdsPlugin.androidlib:generateReleaseRFile Task :unityLibrary:GoogleMobileAdsPlugin.androidlib:generateReleaseBuildConfig Task :unityLibrary:GoogleMobileAdsPlugin.androidlib:prepareLintJar UP-TO-DATE Task :unityLibrary:GoogleMobileAdsPlugin.androidlib:generateReleaseSources Task :unityLibrary:GoogleMobileAdsPlugin.androidlib:javaPreCompileRelease Task :unityLibrary:packageReleaseAssets Task :launcher:preReleaseBuild Task :launcher:compileReleaseAidl NO-SOURCE Task :launcher:compileReleaseRenderscript NO-SOURCE Task :launcher:checkReleaseManifest UP-TO-DATE Task :launcher:generateReleaseBuildConfig UP-TO-DATE Task :launcher:generateReleaseSources UP-TO-DATE Task :launcher:mainApkListPersistenceRelease UP-TO-DATE Task :launcher:generateReleaseResValues UP-TO-DATE Task :launcher:generateReleaseResources UP-TO-DATE Task :unityLibrary:generateReleaseRFile UP-TO-DATE Task :unityLibrary:processReleaseJavaRes NO-SOURCE Task :unityLibrary:mergeReleaseJniLibFolders UP-TO-DATE Task :unityLibrary:transformNativeLibsWithMergeJniLibsForRelease UP-TO-DATE Task :unityLibrary:transformNativeLibsWithStripDebugSymbolForRelease UP-TO-DATE Task :launcher:mergeReleaseResources UP-TO-DATE Task :launcher:createReleaseCompatibleScreenManifests UP-TO-DATE Task :unityLibrary:transformNativeLibsWithIntermediateJniLibsForRelease Task :unityLibrary:GoogleMobileAdsPlugin.androidlib:compileReleaseJavaWithJavac Task :unityLibrary:GoogleMobileAdsPlugin.androidlib:bundleLibCompileRelease Task :unityLibrary:GoogleMobileAdsPlugin.androidlib:prepareLintJarForPublish UP-TO-DATE Task :unityLibrary:GoogleMobileAdsPlugin.androidlib:mergeReleaseShaders Task :unityLibrary:GoogleMobileAdsPlugin.androidlib:compileReleaseShaders Task :unityLibrary:GoogleMobileAdsPlugin.androidlib:generateReleaseAssets Task :unityLibrary:GoogleMobileAdsPlugin.androidlib:packageReleaseAssets Task :unityLibrary:GoogleMobileAdsPlugin.androidlib:bundleLibRuntimeRelease Task :unityLibrary:GoogleMobileAdsPlugin.androidlib:processReleaseJavaRes NO-SOURCE Task :unityLibrary:GoogleMobileAdsPlugin.androidlib:bundleLibResRelease Task :unityLibrary:javaPreCompileRelease UP-TO-DATE Task :unityLibrary:GoogleMobileAdsPlugin.androidlib:mergeReleaseJniLibFolders Task :unityLibrary:compileReleaseJavaWithJavac UP-TO-DATE Task :unityLibrary:bundleLibCompileRelease UP-TO-DATE Task :unityLibrary:GoogleMobileAdsPlugin.androidlib:transformNativeLibsWithMergeJniLibsForRelease Task :unityLibrary:bundleLibRuntimeRelease UP-TO-DATE Task :unityLibrary:bundleLibResRelease UP-TO-DATE Task :unityLibrary:GoogleMobileAdsPlugin.androidlib:transformNativeLibsWithStripDebugSymbolForRelease Task :unityLibrary:GoogleMobileAdsPlugin.androidlib:transformNativeLibsWithIntermediateJniLibsForRelease Task :launcher:processReleaseManifest Task :launcher:javaPreCompileRelease Task :launcher:processReleaseResources FAILED
Deprecated Gradle features were used in this build, making it incompatible with Gradle 6.0. Use '--warning-mode all' to show the individual deprecation warnings. See https://docs.gradle.org/5.1.1/userguide/command_line_interface.html#sec:command_line_warnings 51 actionable tasks: 25 executed, 26 up-to-date
UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr)
Console Screenshot

Had the exact same issue today. You need to upgrade your gradle version.
Go to Player Settings -> Publishing Settings, and check "Custom Base Gradle Template".
Custom Base Gradle Template
In the baseProjectTemplate.gradle, update the gradle version to 3.4.3
baseProjectTemplate.gradle
Here's the link to Unity page showing the gradle version compatible with Unity versions: https://docs.unity3d.com/Manual/android-gradle-overview.html
And here's the page showing which plugin has which version of gradle: https://developer.android.com/studio/releases/gradle-plugin
Based on this you can upgrade to 3.4.3
This solved the issue for me.

For anyone who may encounter this issue:
I upgraded to Unity 2020.2.1f1 and it solved it for me,
The gradle version used in 2020.2.1f1 is compatible with the mediation SDKs,
in versions of 2019.4 LTS it does not.
So you can go with Rini's solution and upgrade gradle manually within the older version, or just upgrade Unity to 2020.2 or newer.
Both should work!

It is solved.
Latest version of Admob SDk(6.) dont work with unity 19.4.3 so I download AdMob SDK(5.4) and then everything look super good. Cheer

Related

Application not working when installing LocalNotification plugin

my app was running fine until i installed Local Notifications native plugin:
I executed this command : ionic cordova plugin add cordova-plugin-local-notification
then this one npm install --save #ionic-native/local-notifications
Then i added import { LocalNotifications } from '#ionic-native/local-notifications'; on app.module.ts
Then i added LocalNotifications on the provider part of NgModule
Then i added import { LocalNotifications } from '#ionic-native/local-notifications'; on my home.ts
Then i added public localNotifications: LocalNotifications, to the constructor parameter
Then i tried to run the app and it dont wanna build, here's the log:
$ ionic cordova run android --target=95142bf1
Running app-scripts build: --platform android --target cordova
[01:14:05] build dev started ...
[01:14:05] clean started ...
[01:14:05] clean finished in 15 ms
[01:14:05] copy started ...
[01:14:05] deeplinks started ...
[01:14:05] deeplinks finished in 171 ms
[01:14:05] transpile started ...
[01:14:10] transpile finished in 5.13 s
[01:14:10] preprocess started ...
[01:14:10] preprocess finished in 15 ms
[01:14:10] webpack started ...
[01:14:11] copy finished in 5.79 s
[01:14:18] webpack finished in 8.11 s
[01:14:18] sass started ...
Without `from` option PostCSS could generate wrong source map and will not find Browserslist config. Set it to CSS file path or to `undefined` to prevent this w arning.
[01:14:20] sass finished in 1.81 s
[01:14:20] postprocess started ...
[01:14:20] postprocess finished in 31 ms
[01:14:20] lint started ...
[01:14:20] build dev finished in 15.49 s
> cordova run android --target 95142bf1
Android Studio project detected
ANDROID_HOME=C:\Users\Win 7\AppData\Local\Android\Sdk
JAVA_HOME=C:\Program Files\Java\jdk1.8.0_161
studio
Subproject Path: CordovaLib
Subproject Path: app
publishNonDefault is deprecated and has no effect anymore. All variants are now published.
Configuration 'compile' in project ':app' is deprecated. Use 'implementation' in stead.
The Task.leftShift(Closure) method has been deprecated and is scheduled to be re moved in Gradle 5.0. Please use Task.doLast(Action) instead.
at build_85bbhcbf5ogx3eqe0v2ws0it5.run(C:\Users\Win 7\Desktop\ThePfe\pfe z\platforms\android\app\build.gradle:146)
:CordovaLib:preBuild UP-TO-DATE
:CordovaLib:preDebugBuild UP-TO-DATE
:CordovaLib:compileDebugAidl
UP-TO-DATE
:CordovaLib:compileDebugRenderscript
UP-TO-DATE
:CordovaLib:checkDebugManifest UP-TO-DATE
:CordovaLib:generateDebugBuildConfig UP-TO-DATE
:CordovaLib:prepareLintJar
UP-TO-DATE
:CordovaLib:generateDebugResValues UP-TO-DATE
:CordovaLib:generateDebugResources UP-TO-DATE
:CordovaLib:packageDebugResources UP-TO-DATE
:CordovaLib:platformAttrExtractor UP-TO-DATE
:CordovaLib:processDebugManifest
UP-TO-DATE
:CordovaLib:processDebugResources UP-TO-DATE
:CordovaLib:generateDebugSources UP-TO-DATE
:CordovaLib:javaPreCompileDebug UP-TO-DATE
:CordovaLib:compileDebugJavaWithJavac
UP-TO-DATE
:CordovaLib:processDebugJavaRes
NO-SOURCE
:CordovaLib:transformClassesAndResourcesWithPrepareIntermediateJarsForDebug
UP-TO-DATE
:app:preBuild UP-TO-DATE
:app:preDebugBuild
:app:compileDebugAidl
UP-TO-DATE
:CordovaLib:packageDebugRenderscript NO-SOURCE
: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
Error: Could not delete path 'C:\Users\Win 7\Desktop\ThePfe\pfez\platforms\andro id\app\build\intermediates\incremental\mergeDebugResources\merged.dir\values-pa- rIN'.
:app:mergeDebugResources FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:processDebugManifest'.
> Manifest merger failed : Attribute meta-data#android.support.VERSION#value value=(25.4.0) from [com.android.support:appcompat-v7:25.4.0] AndroidManifest.xml:28:13-35
is also present at [com.android.support:support-v4:26.1.0] AndroidManifest.xml:28:13-35 value=(26.1.0).
Suggestion: add 'tools:replace="android:value"' to <meta-data> element at AndroidManifest.xml:26:9-28:38 to override.
* 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 3s
23 actionable tasks: 1 executed, 22 up-to-date
(node:5844) UnhandledPromiseRejectionWarning: Error: cmd: Command failed with exit code 1 Error output:
C:\Users\Win 7\Desktop\ThePfe\pfez\platforms\android\app\src\main\AndroidManifest.xml:28:13-35 Error:
Attribute meta-data#android.support.VERSION#value value=(25.4.0) from [com.android.support:appcompat-v7:25.4.0] AndroidManifest.xml:28:13-35
is also present at [com.android.support:support-v4:26.1.0] AndroidManifest.xml:28:13-35 value=(26.1.0).
Suggestion: add 'tools:replace="android:value"' to <meta-data> element at AndroidManifest.xml:26:9-28:38 to override.
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:processDebugManifest'.
> Manifest merger failed : Attribute meta-data#android.support.VERSION#value value=(25.4.0) from [com.android.support:appcompat-v7:25.4.0] AndroidManifest.xml:28:13-35
is also present at [com.android.support:support-v4:26.1.0] AndroidManifest.xml:28:13-35 value=(26.1.0).
Suggestion: add 'tools:replace="android:value"' to <meta-data> element at AndroidManifest.xml:26:9-28:38 to override.
* 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 3s
at ChildProcess.whenDone (C:\Users\Win 7\Desktop\ThePfe\pfez\platforms\android\cordova\node_modules\cordova-common\src\superspawn.js:169:23)
at emitTwo (events.js:126:13)
at ChildProcess.emit (events.js:214:7)
at maybeClose (internal/child_process.js:925:16)
at Process.ChildProcess._handle.onexit (internal/child_process.js:209:5)
(node:5844) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:5844) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
[OK] Your app has been deployed.
Did you know you can live-reload changes from your app with --livereload?
I even tried to make a brand new blank project, i installed the plugin and added what needs to be added to app.module.ts and it didnt work either
Error: Could not delete path 'C:\Users\Win7\Desktop\ThePfe\pfez\platforms\andro...
Seems like it could be a permissions problem that your user may not have for the particular directory/file being deleted
EDIT:
Looks like you have a plugin conflict somewhere
Manifest merger failed : Attribute meta-data#android.support.VERSION#value value=(25.4.0) from [com.android.support:appcompat-v7:25.4.0] AndroidManifest.xml:28:13-35
is also present at [com.android.support:support-v4:26.1.0] AndroidManifest.xml:28:13-35 value=(26.1.0).
Suggestion: add 'tools:replace="android:value"' to <meta-data> element at AndroidManifest.xml:26:9-28:38 to override.
Indicates that you have multiple references in your plugins to the support library, but the versions they require don't match.
I tried to make a new projet installing only this plugin and it didnt work, so i guess problem has something to do with the plugin itself

com.android.builder.testing.api.DeviceException: No connected devices

Scanning folders for symlinks in /home/sino/Desktop/we-clone/node_modules (4ms)
Starting JS server...
Building and installing the app on the device (cd android && ./gradlew installDebug)...
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:prepareComAndroidSupportAppcompatV72301Library UP-TO-DATE
:app:prepareComAndroidSupportSupportV42301Library UP-TO-DATE
:app:prepareComFacebookFbuiTextlayoutbuilderTextlayoutbuilder100Library UP-TO-DATE
:app:prepareComFacebookFrescoDrawee130Library UP-TO-DATE
:app:prepareComFacebookFrescoFbcore130Library UP-TO-DATE
:app:prepareComFacebookFrescoFresco130Library UP-TO-DATE
:app:prepareComFacebookFrescoImagepipeline130Library UP-TO-DATE
:app:prepareComFacebookFrescoImagepipelineBase130Library UP-TO-DATE
:app:prepareComFacebookFrescoImagepipelineOkhttp3130Library UP-TO-DATE
:app:prepareComFacebookReactReactNative0493Library UP-TO-DATE
:app:prepareComFacebookSoloaderSoloader010Library UP-TO-DATE
:app:prepareOrgWebkitAndroidJscR174650Library UP-TO-DATE
:app:prepareDebugDependencies
:app:compileDebugAidl UP-TO-DATE
:app:compileDebugRenderscript UP-TO-DATE
:app:generateDebugBuildConfig UP-TO-DATE
:app:mergeDebugShaders UP-TO-DATE
:app:compileDebugShaders 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 UP-TO-DATE
:app:bundleDebugJsAndAssets SKIPPED
:app:processDebugManifest UP-TO-DATE
:app:processDebugResources UP-TO-DATE
:app:generateDebugSources UP-TO-DATE
:app:incrementalDebugJavaCompilationSafeguard UP-TO-DATE
:app:compileDebugJavaWithJavac UP-TO-DATE
:app:compileDebugNdk UP-TO-DATE
:app:compileDebugSources UP-TO-DATE
:app:transformClassesWithDexForDebug UP-TO-DATE
:app:mergeDebugJniLibFolders UP-TO-DATE
:app:transformNative_libsWithMergeJniLibsForDebug UP-TO-DATE
:app:processDebugJavaRes UP-TO-DATE
:app:transformResourcesWithMergeJavaResForDebug UP-TO-DATE
:app:validateSigningDebug
:app:packageDebug UP-TO-DATE
:app:assembleDebug UP-TO-DATE
:app:installDebug
07:52:34 E/adb: * daemon not running; starting now at tcp:5037
07:52:37 E/adb: * daemon started successfully
:app:installDebug FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:installDebug'.
> com.android.builder.testing.api.DeviceException: No connected devices!
* 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: 8.916 secs
Could not install the app on the device, read the error above for details.
Make sure you have an Android emulator running or a device connected and have
set up your Android development environment:
https://facebook.github.io/react-native/docs/android-setup.html
If you have android studio installed(if not install it) launch android studio with a dummy project, go to Tools -> AVD Manager. Make sure that you create a virtual device and start it.
Note: To create this virtual device you will need to download and install a compatible OS (compatible with your project's Android SDK version - SDK version can be found inside build.gradle file) on it before launching. AVD Manager will guide you with the process.
Another thing, you may be using a real Android device not an emulator and still get this message. If your device is connected through USB to your laptop you need to first enable the developer options:
If using stock Android, go to Settings > About phone > Build number.
On a Samsung Galaxy device, go to Settings > About device > Build
number. On an HTC device, go to Settings > About > Software
information > More > Build number. On an LG device, go to Settings >
About phone > Software info > Build number. Tap Build number seven
times. After the first few taps, you should see the steps counting
down until you unlock the developer options. Once activated, you will
see a message that reads, “You are now a developer!” Go back to
Settings, where you’ll find a Developer options entry in the menu.
(https://www.digitaltrends.com/mobile/how-to-get-developer-options-on-android/)
Then inside developer options, you should enable USB debugging.
You'll need to have an Android Emulator running or a physical device connected and in usb debugging mode.
See https://facebook.github.io/react-native/docs/getting-started.html#preparing-the-android-device for more information.
Version SDK incompatible check SDK version in build.gradle under android folder
For example
ext {
buildToolsVersion = "29.0.2"
minSdkVersion = 16
compileSdkVersion = 29
targetSdkVersion = 29
}
Then download ADV Manager
Select Image API Level 29 (Follow SDK version)
In my case, my usb wasn't connected for some reason, even though it seemed like it was physically connected. I had to change the ports I used.

uber dependency compiling error - Android

On adding this line of code to build.gradle
compile 'com.uber.sdk:rides-android:0.5.3'
It shows an error when the project is building
Error:Execution failed for task ':app:prepareDebugAndroidTestDependencies'. > Dependency Error. See console for details.
the error log from gradle console
Executing tasks: [:app:generateDebugSources, :app:generateDebugAndroidTestSources, :app:mockableAndroidJar, :app:prepareDebugUnitTestDependencies]Configuration on demand is an incubating feature.
WARNING: WARNING: Dependency org.apache.httpcomponents:httpclient:4.0.1 is ignored for debug as it may be conflicting with the internal version provided by Android.
In case of problem, please repackage it with jarjar to change the class packages
WARNING: WARNING: Dependency org.apache.httpcomponents:httpclient:4.0.1 is ignored for debug as it may be conflicting with the internal version provided by Android.
In case of problem, please repackage it with jarjar to change the class packages
WARNING: WARNING: Dependency org.apache.httpcomponents:httpclient:4.0.1 is ignored for release as it may be conflicting with the internal version provided by Android.
In case of problem, please repackage it with jarjar to change the class packages
WARNING: WARNING: Dependency org.apache.httpcomponents:httpclient:4.0.1 is ignored for release as it may be conflicting with the internal version provided by Android.
In case of problem, please repackage it with jarjar to change the class packages
Incremental java compilation is an incubating feature.
WARNING: Conflict with dependency 'com.google.code.findbugs:jsr305'. Resolved versions for app (1.3.9) and test app (2.0.1) differ. See http://g.co/androidstudio/app-test-app-conflict for details.
:app:preBuild UP-TO-DATE
:app:preDebugBuild UP-TO-DATE
:app:checkDebugManifest
:app:preReleaseBuild UP-TO-DATE
:app:prepareComAndroidSupportAnimatedVectorDrawable2500Library UP-TO-DATE
:app:prepareComAndroidSupportAppcompatV72500Library UP-TO-DATE
:app:prepareComAndroidSupportSupportCompat2500Library UP-TO-DATE
:app:prepareComAndroidSupportSupportCoreUi2500Library UP-TO-DATE
:app:prepareComAndroidSupportSupportCoreUtils2500Library UP-TO-DATE
:app:prepareComAndroidSupportSupportFragment2500Library UP-TO-DATE
:app:prepareComAndroidSupportSupportMediaCompat2500Library UP-TO-DATE
:app:prepareComAndroidSupportSupportV42500Library UP-TO-DATE
:app:prepareComAndroidSupportSupportVectorDrawable2500Library UP-TO-DATE
:app:prepareComUberSdkCoreAndroid053Library UP-TO-DATE
:app:prepareComUberSdkRidesAndroid053Library UP-TO-DATE
: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 UP-TO-DATE
:app:generateDebugSources UP-TO-DATE
:app:preDebugAndroidTestBuild UP-TO-DATE
:app:prepareComAndroidSupportTestEspressoEspressoCore222Library
:app:prepareComAndroidSupportTestEspressoEspressoIdlingResource222Library
:app:prepareComAndroidSupportTestExposedInstrumentationApiPublish05Library
:app:prepareComAndroidSupportTestRules05Library
:app:prepareComAndroidSupportTestRunner05Library
:app:prepareDebugAndroidTestDependencies
Conflict with dependency 'com.google.code.findbugs:jsr305'. Resolved versions for app (1.3.9) and test app (2.0.1) differ. See http://g.co/androidstudio/app-test-app-conflict for details.
FAILED
FAILURE: Build failed with an exception.
What went wrong:
Execution failed for task ':app:prepareDebugAndroidTestDependencies'.
Dependency Error. See console 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
Please help
I got it fixed by force the com.google.findbugs to use a lower version

"ionic build android" build failed

i am getting following error while run "ionic build android"
can help me out of this
Running command: /Users/tapan/Desktop/Today/hooks/after_prepare/010_add_platform_class.js /Users/tapan/Desktop/Today
add to body class: platform-android
ANDROID_HOME=/Users/tapan/Library/Android/sdk
JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.8.0_45.jdk/Contents/Home
:preBuild UP-TO-DATE
:preDebugBuild UP-TO-DATE
:checkDebugManifest
:CordovaLib:preBuild UP-TO-DATE
:CordovaLib:preDebugBuild UP-TO-DATE
:CordovaLib:compileDebugNdk UP-TO-DATE
:CordovaLib:compileLint
:CordovaLib:copyDebugLint UP-TO-DATE
:CordovaLib:mergeDebugProguardFiles UP-TO-DATE
:CordovaLib:packageDebugRenderscript UP-TO-DATE
:CordovaLib:checkDebugManifest
:CordovaLib:prepareDebugDependencies
:CordovaLib:compileDebugRenderscript UP-TO-DATE
:CordovaLib:generateDebugResValues UP-TO-DATE
:CordovaLib:generateDebugResources UP-TO-DATE
:CordovaLib:packageDebugResources UP-TO-DATE
:CordovaLib:compileDebugAidl UP-TO-DATE
:CordovaLib:generateDebugBuildConfig UP-TO-DATE
:CordovaLib:generateDebugAssets UP-TO-DATE
:CordovaLib:mergeDebugAssets UP-TO-DATE
:CordovaLib:processDebugManifest UP-TO-DATE
:CordovaLib:processDebugResources UP-TO-DATE
:CordovaLib:generateDebugSources UP-TO-DATE
:CordovaLib:compileDebugJavaWithJavac UP-TO-DATE
:CordovaLib:processDebugJavaRes UP-TO-DATE
:CordovaLib:transformResourcesWithMergeJavaResForDebug UP-TO-DATE
:CordovaLib:transformClassesAndResourcesWithSyncLibJarsForDebug UP-TO-DATE
:CordovaLib:mergeDebugJniLibFolders UP-TO-DATE
:CordovaLib:transformNative_libsWithMergeJniLibsForDebug UP-TO-DATE
:CordovaLib:transformNative_libsWithSyncJniLibsForDebug UP-TO-DATE
:CordovaLib:bundleDebug UP-TO-DATE
:prepareAndroidCordovaLibUnspecifiedDebugLibrary UP-TO-DATE
:prepareDebugDependencies
:compileDebugAidl UP-TO-DATE
:compileDebugRenderscript UP-TO-DATE
:generateDebugBuildConfig UP-TO-DATE
:generateDebugAssets UP-TO-DATE
:mergeDebugAssets UP-TO-DATE
:generateDebugResValues UP-TO-DATE
:generateDebugResources UP-TO-DATE
:mergeDebugResources UP-TO-DATE
:processDebugManifest UP-TO-DATE
:processDebugResources FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':processDebugResources'.
> com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command '/Users/tapan/Library/Android/sdk/build-tools/23.0.2/aapt'' finished with non-zero exit value 1
* 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: 1.926 secs
ERROR building one of the platforms: Error code 1 for command: /Users/tapan/Desktop/Today/platforms/android/gradlew with args: cdvBuildDebug,-b,/Users/tapan/Desktop/Today/platforms/android/build.gradle,-Dorg.gradle.daemon=true,-Pandroid.useDeprecatedNdk=true
You may not have the required environment or OS to build this project
Error: Error code 1 for command: /Users/tapan/Desktop/Today/platforms/android/gradlew with args: cdvBuildDebug,-b,/Users/tapan/Desktop/Today/platforms/android/build.gradle,-Dorg.gradle.daemon=true,-Pandroid.useDeprecatedNdk=true
also see snapshot
i have tried almost everything thing but not find how to build this android app,i also have removed android project and again create new android project, but still same error
ionic platform rm android
ionic platform add android
please help me
In my case (Fedora 23 x64) I had to install the following packages:
dnf install glibc.i686 zlib.i686 libstdc++.i686
Found that out because the execution of android-sdk-linux/build-tools/23.0.2/aapt gave me some errors.
Sources:
http://www.howtodoityourself.org/how-to-fix-libld-linux-so-2-bad-elf-interpreter-no-such-file-or-directory.html
android-sdks/build-tools/17.0.0/aapt: error while loading shared libraries: libz.so.1: cannot open shared object file: No such file or directory
Maybe some of the packages may not be installed in SDK manager. Check the below link for more details:
http://developer.android.com/sdk/installing/adding-packages.html

Ionic android build crashes at :processDebugResources

I'm still new in Ionic, so I programmed an App a few weeks ago, something went wrong and crash while using command "ionic build android".
"ionic serve" also doesn't work.
Here is the output of the build:
Running command: /home/USERNAME/IONIC_Workspace/local-business/hooks/after_prepareicons_and_splashscreens.js /home/USERNAME/IONIC_Workspace/local-business
Running command: /home/USERNAME/IONIC_Workspace/local-business/hooks/after_prepare/update_platform_config.js /home/USERNAME/IONIC_Workspace/local-business
Running command: /home/USERNAME/IONIC_Workspace/local-business/platforms/android/cordova/build
ANDROID_HOME=/home/USERNAME/Android/Sdk
JAVA_HOME=/usr/lib/jvm/java-7-openjdk-amd64
Running: /home/USERNAME/IONIC_Workspace/local-business/platforms/android/gradlew cdvBuildDebug -b /home/USERNAME/IONIC_Workspace/local-business/platforms/android/ build.gradle -Dorg.gradle.daemon=true
:preBuild
:compileDebugNdk UP-TO-DATE
:preDebugBuild
:checkDebugManifest
:CordovaLib:compileLint
:CordovaLib:copyDebugLint UP-TO-DATE
:CordovaLib:mergeDebugProguardFiles UP-TO-DATE
:CordovaLib:preBuild
:CordovaLib:preDebugBuild
: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:compileDebugJava UP-TO-DATE
:CordovaLib:processDebugJavaRes UP-TO-DATE
:CordovaLib:packageDebugJar UP-TO-DATE
:CordovaLib:compileDebugNdk UP-TO-DATE
:CordovaLib:packageDebugJniLibs UP-TO-DATE
:CordovaLib:packageDebugLocalJar UP-TO-DATE
:CordovaLib:packageDebugRenderscript UP-TO-DATE
:CordovaLib:bundleDebug UP-TO-DATE
:prepareAndroidCordovaLibUnspecifiedDebugLibrary UP-TO-DATE
:preReleaseBuild
:CordovaLib:copyReleaseLint UP-TO-DATE
:CordovaLib:mergeReleaseProguardFiles UP-TO-DATE
:CordovaLib:preReleaseBuild
:CordovaLib:checkReleaseManifest
:CordovaLib:prepareReleaseDependencies
:CordovaLib:compileReleaseAidl UP-TO-DATE
:CordovaLib:compileReleaseRenderscript UP-TO-DATE
:CordovaLib:generateReleaseBuildConfig UP-TO-DATE
:CordovaLib:generateReleaseAssets UP-TO-DATE
:CordovaLib:mergeReleaseAssets UP-TO-DATE
:CordovaLib:generateReleaseResValues UP-TO-DATE
:CordovaLib:generateReleaseResources UP-TO-DATE
:CordovaLib:packageReleaseResources UP-TO-DATE
:CordovaLib:processReleaseManifest UP-TO-DATE
:CordovaLib:processReleaseResources UP-TO-DATE
:CordovaLib:generateReleaseSources UP-TO-DATE
:CordovaLib:compileReleaseJava UP-TO-DATE
:CordovaLib:processReleaseJavaRes UP-TO-DATE
:CordovaLib:packageReleaseJar UP-TO-DATE
:CordovaLib:compileReleaseNdk UP-TO-DATE
:CordovaLib:packageReleaseJniLibs UP-TO-DATE
:CordovaLib:packageReleaseLocalJar UP-TO-DATE
:CordovaLib:packageReleaseRenderscript UP-TO-DATE
:CordovaLib:bundleRelease UP-TO-DATE
:prepareComAndroidSupportSupportV132311Library UP-TO-DATE
:prepareComAndroidSupportSupportV42311Library UP-TO-DATE
:prepareComGoogleAndroidGmsPlayServicesBase830Library UP-TO-DATE
:prepareComGoogleAndroidGmsPlayServicesBasement830Library UP-TO-DATE
:prepareComGoogleAndroidGmsPlayServicesGcm830Library UP-TO-DATE
:prepareComGoogleAndroidGmsPlayServicesMeasurement830Library UP-TO-DATE
:prepareDebugDependencies
:compileDebugAidl UP-TO-DATE
:compileDebugRenderscript UP-TO-DATE
:generateDebugBuildConfig UP-TO-DATE
:generateDebugAssets UP-TO-DATE
:mergeDebugAssets UP-TO-DATE
:generateDebugResValues UP-TO-DATE
:generateDebugResources UP-TO-DATE
:mergeDebugResources UP-TO-DATE
:processDebugManifest UP-TO-DATE
:processDebugResources
/home/USERNAME/IONIC_Workspace/local-business/platforms/android/build/intermediates/assets/debug/www/node_modules/ionic/node_modules/ionic-app-lib/node_modules/archiver/node_modules/file-utils/node_modules/isbinaryfile/tests/fixtures/03_Руководство_по_эксплуатации.rst: error: Invalid filename. Unable to add.
:processDebugResources FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':processDebugResources'.
> com.android.ide.common.internal.LoggedErrorException: Failed to run command:
/home/USERNAME/Android/Sdk/build-tools/23.0.2/aapt package -f --no-crunch -I /home/USERNAME/Android/Sdk/platforms/android-22/android.jar -M /home/USERNAME/IONIC_Workspace/local-business/platforms/android/build/intermediates/manifests/full/debug/AndroidManifest.xml -S /home/USERNAME/IONIC_Workspace/local-business/platforms/android/build/intermediates/res/debug -A /home/USERNAME/IONIC_Workspace/local-business/platforms/android/build/intermediates/assets/debug -m -J /home/USERNAME/IONIC_Workspace/local-business/platforms/android/build/generated/source/r/debug -F /home/USERNAME/IONIC_Workspace/local-business/platforms/android/build/intermediates/res/resources-debug.ap_ --debug-mode --custom-package com.titaniumtemplates.local_business -0 apk --output-text-symbols /home/USERNAME/IONIC_Workspace/local-business/platforms/android/build/intermediates/symbols/debug
Error Code:
1
Output:
/home/USERNAME/IONIC_Workspace/local-business/platforms/android/build/intermediates/assets/debug/www/node_modules/ionic/node_modules/ionic-app-lib/node_modules/archiver/node_modules/file-utils/node_modules/isbinaryfile/tests/fixtures/03_Руководство_по_эксплуатации.rst: error: Invalid filename. Unable to add.
* 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: 8.208 secs
/home/USERNAME/IONIC_Workspace/local-business/platforms/android/cordova/node_modules/q/q.js:126
throw e;
^
Error code 1 for command: /home/USERNAME/IONIC_Workspace/local-business/platforms/android/gradlew with args: cdvBuildDebug,-b,/home/USERNAME/IONIC_Workspace/local-business/platforms/android/build.gradle,-Dorg.gradle.daemon=true
ERROR building one of the platforms: Error: /home/USERNAME/IONIC_Workspace/local-business/platforms/android/cordova/build: Command failed with exit code 8
You may not have the required environment or OS to build this project
Error: /home/USERNAME/IONIC_Workspace/local-business/platforms/android/cordova/build: Command failed with exit code 8
at ChildProcess.whenDone (/usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/cordova/superspawn.js:139:23)
at ChildProcess.EventEmitter.emit (events.js:98:17)
at maybeClose (child_process.js:743:16)
at Process.ChildProcess._handle.onexit (child_process.js:810:5)
I haven't used the file 03_Руководство_по_эксплуатации.rst in my project and don't know what to do with it.
Can someone give hints how to solve my problem.
The :processDebugResources task tries to copy the 03_Руководство_по_эксплуатации.rst to the resource folders in your platform projects.
There might be different reasons why cordova does want to copy this file:
it is needed by an libary
it is configured in your config.xml
permissions error
some caching problem
You cold try:
delete your platforms folder, this will cause ionic build android to regenerate the hole folder (ist like deleting the cache)
check if the file exists and create an empty dummyfile
check if the file is mentioned in your config.xml and remove that line
reinstall all dependencies
uninstall all unnecessary plugins
remove all platforms and add them agian