Execution failed for task ':processDebugResources' on Ionic - android

I have an issue with Ionic command : Ionic build android
Here the tutorial Salesforce i'm following to create an app connected to the Salesforce API. (contact, etc.).
Now, when i mudt build android, I have this issue :
:processDebugResources
/home/r.**/Workspace/IonicApp/platforms/android/build/intermediates/manifests/full/debug/AndroidManifest.xml:32: error: Error: No resource found that matches the given name (at 'icon' with value '#drawable/sf__icon').
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:
/usr/local/android-sdk-linux/build-tools/25.0.0/aapt package -f --no-crunch -I /usr/local/android-sdk-linux/platforms/android-23/android.jar -M /home/r.**/Workspace/IonicApp/platforms/android/build/intermediates/manifests/full/debug/AndroidManifest.xml -S /home/r.**/Workspace/IonicApp/platforms/android/build/intermediates/res/debug -A /home/r.**/Workspace/IonicApp/platforms/android/build/intermediates/assets/debug -m -J /home/r.**/Workspace/IonicApp/platforms/android/build/generated/source/r/debug -F /home/r.**/Workspace/IonicApp/platforms/android/build/intermediates/res/resources-debug.ap_ --debug-mode --custom-package com.ionicframework.ionicapp508454 -0 apk --output-text-symbols /home/r.**/Workspace/IonicApp/platforms/android/build/intermediates/symbols/debug
Error Code:
1
Output:
/home/r.**/Workspace/IonicApp/platforms/android/build/intermediates/manifests/full/debug/AndroidManifest.xml:32: error: Error: No resource found that matches the given name (at 'icon' with value '#drawable/sf__icon').
* 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: 3.305 secs
Error: /home/r.**/Workspace/IonicApp/platforms/android/gradlew: Command failed with exit code 1
I restart the tutorial 2 times and i still have this error. Maybe because I do an Android App and not an Ios like the tutorial.
What is this file missing and where is it supposed to be?
If you need the XML:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.ionicframework.ionicapp508454"
android:hardwareAccelerated="true"
android:versionCode="18"
android:versionName="0.0.1" >
<uses-sdk
android:minSdkVersion="16"
android:targetSdkVersion="23" />
<supports-screens
android:anyDensity="true"
android:largeScreens="true"
android:normalScreens="true"
android:resizeable="true"
android:smallScreens="true"
android:xlargeScreens="true" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.WAKE_LOCK" />
<uses-permission android:name="android.permission.VIBRATE" />
<uses-permission android:name="com.google.android.c2dm.permission.RECEIVE" />
<permission
android:name="com.ionicframework.ionicapp508454.permission.C2D_MESSAGE"
android:protectionLevel="signature" />
<uses-permission android:name="com.ionicframework.ionicapp508454.permission.C2D_MESSAGE" />
<application
android:name="com.salesforce.androidsdk.phonegap.app.HybridApp"
android:hardwareAccelerated="true"
android:icon="#drawable/sf__icon"
android:label="#string/app_name"
android:manageSpaceActivity="com.salesforce.androidsdk.ui.ManageSpaceActivity" >
<activity
android:name="com.adobe.phonegap.push.PushHandlerActivity"
android:exported="true" />
<receiver
android:name="com.google.android.gms.gcm.GcmReceiver"
android:exported="true"
android:permission="com.google.android.c2dm.permission.SEND" >
<intent-filter>
<action android:name="com.google.android.c2dm.intent.RECEIVE" />
<category android:name="com.ionicframework.ionicapp508454" />
</intent-filter>
</receiver>
<service
android:name="com.adobe.phonegap.push.GCMIntentService"
android:exported="false" >
<intent-filter>
<action android:name="com.google.android.c2dm.intent.RECEIVE" />
</intent-filter>
</service>
<service
android:name="com.adobe.phonegap.push.PushInstanceIDListenerService"
android:exported="false" >
<intent-filter>
<action android:name="com.google.android.gms.iid.InstanceID" />
</intent-filter>
</service>
<service
android:name="com.adobe.phonegap.push.RegistrationIntentService"
android:exported="false" />
<activity
android:name="com.salesforce.androidsdk.phonegap.ui.SalesforceDroidGapActivity"
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|locale"
android:label="#string/app_name"
android:theme="#android:style/Theme.Black.NoTitleBar" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name="com.google.android.gms.common.api.GoogleApiActivity"
android:exported="false"
android:theme="#android:style/Theme.Translucent.NoTitleBar" />
<meta-data
android:name="com.google.android.gms.version"
android:value="#integer/google_play_services_version" />
</application>
</manifest>
Some info:
I create an Android App.
Cordova-android is version 5.0.0 because 6.0.0 do a mismatch issue with the api salesforce.
I'm a beginner with Ionic/Cordova and mobile dev. Maybe the solution is oubvious.

The error output suggests that the build just fails due to a missing icon resource: No resource found that matches the given name (at 'icon' with value '#drawable/sf__icon').
The SalesforceSDK includes those files though, however they do not seem to be added to the Android project correctly:
https://github.com/forcedotcom/SalesforceMobileSDK-CordovaPlugin/tree/master/src/android/libs/SalesforceSDK/res
Copy-pasting might resolve the problem though, still wondering why the plugin does not add the drawables as expected in the res/drawable folder!

Related

Android - Build failed with an exception while running react-native run-android

I am trying to setup remote push notifications in react-native and I am using the react-native-fcm package for fulling that.I followed the guide in setting up the required things from the github page of the package .I keep running in to the following error and I am not sure what is missing or if I am doing something wrong .
Error :
:app:processDebugResources
C:\Users\test\Desktop\App_Dev\pushNotifyDev\android\app\build\intermediates\manifests\full\debug\AndroidManifest.xml:58:31-47:
AAPT: No resource found that matches the given name (at 'resource' with value '#mipmap/ic_notif').
C:\Users\test\Desktop\App_Dev\pushNotifyDev\android\app\build\intermediates\manifests\full\debug\AndroidManifest.xml:56: error: Error: No resource found that matches the given name (at 'resource' with value '#mipmap/ic_notif').
:app:processDebugResources FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:processDebugResources'.
> com.android.ide.common.process.ProcessException: Failed to execute aapt
* 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: 16.121 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/getting-started.html
Here is my AndroidManifest.xml file
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.pushnotifydev"
android:versionCode="1"
android:versionName="1.0">
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW"/>
<uses-sdk
android:minSdkVersion="16"
android:targetSdkVersion="22" />
<application
android:name=".MainApplication"
android:allowBackup="true"
android:label="#string/app_name"
android:icon="#mipmap/ic_launcher"
android:theme="#style/AppTheme">
<meta-data android:name="com.google.firebase.messaging.default_notification_icon" android:resource="#mipmap/ic_notif"/>
<service android:name="com.evollu.react.fcm.MessagingService" android:enabled="true" android:exported="true">
<intent-filter>
<action android:name="com.google.firebase.MESSAGING_EVENT"/>
</intent-filter>
</service>
<service android:name="com.evollu.react.fcm.InstanceIdService" android:exported="false">
<intent-filter>
<action android:name="com.google.firebase.INSTANCE_ID_EVENT"/>
</intent-filter>
</service>
<activity
android:name=".MainActivity"
android:label="#string/app_name"
android:configChanges="keyboard|keyboardHidden|orientation|screenSize"
android:windowSoftInputMode="adjustResize">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name="com.facebook.react.devsupport.DevSettingsActivity" />
</application>
</manifest>
I am using the following
React-native -0.53
Android Studio -3.0.1
Any help in debugging this would greatly be appreciated.
Thanks

Manifest merger failed with multiple errors when adding firebase messaging service to my AndroidManifest.xml file

I was hoping to add Firebase cloud messaging to my app. I followed codelab tutorial for this and it was working correctly for the sample app, but when I try to add <service> tags to my application Manifest merger errors occurs.
The strange part is that it is working without adding those services to my Manifest file!
Here it is the error:
Error:packageName/app/src/main/AndroidManifest.xml:52:9-58:19 Error:
Element service#packageName.firebase.MyFirebaseInstanceIdService at AndroidManifest.xml:52:9-58:19 duplicated with element declared at AndroidManifest.xml:44:9-50:19
packageName/app/src/main/AndroidManifest.xml Error:
Validation failed, exiting
FAILURE: Build failed with an exception.
What went wrong:
Execution failed for task ':app:processDebugManifest'.
Manifest merger failed with multiple errors, see logs
Try:
Run with --stacktrace option to get the stack trace. Run with --debug option to get more log output.
And this is part of my AndroidManifest.xml file:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="net.violete.selfienight">
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<application
android:name="net.violete.selfienight.leafpic.MyApplication"
android:allowBackup="true"
android:icon="#mipmap/ic_launcher"
android:label="#string/app_name"
android:supportsRtl="true"
android:theme="#style/AppTheme.FullScreen">
<activity
android:name=".CameraActivity"
android:icon="#mipmap/ic_launcher"
android:label="#string/title_camera_activity"
android:screenOrientation="landscape"
android:taskAffinity=".CameraActivity"
android:theme="#style/AppTheme.FullScreen">
<intent-filter android:label="#string/app_name">
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<meta-data
android:name="com.google.android.gms.version"
android:value="#integer/google_play_services_version" />
<service
android:name=".firebase.MyFirebaseInstanceIdService"
>
<intent-filter>
<action android:name="com.google.firebase.MESSAGING_EVENT" />
</intent-filter>
</service>
<service
android:name=".firebase.MyFirebaseInstanceIdService"
>
<intent-filter>
<action android:name="com.google.firebase.INSTANCE_ID_EVENT" />
</intent-filter>
</service>
...
</application>
</manifest>
My question is that whether Firebase library adds these tags to my Manifest during building or something is wrong here?
You have the same service (.firebase.MyFirebaseInstanceIdService) listed twice. This will not work. Either have one <service> element containing two <intent-filter> elements, or have two separate services with separate classes.
I had the same problem and got fixed by changing the value of minSdkVersion from 15 to 16.

Error parsing the package

This error keeps comes on my phone but it did not come before,I saw all the stack overflow methods but non of them could help me.
I get this error when I test the app from android studio to my phone.I tried on other phones too but still the problem exist.
This is my manifest:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="my.patel.pritesh.smstimer">
<uses-permission android:name="android.permission.SEND_SMS" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<application
android:allowBackup="true"
android:icon="#drawable/sms_timer"
android:label="#string/app_name"
android:supportsRtl="true"
android:theme="#style/AppTheme">
<meta-data
android:name="com.google.android.gms.version"
android:value="#integer/google_play_services_version" />
<activity
android:name=".Time_Picker"
android:theme="#style/AppTheme.NoActionBar" />
<receiver
android:name=".MyReceiver"
android:enabled="true"
android:excludeFromRecents="true"
android:exported="true"
android:process="remote"
android:taskAffinity="">
<intent-filter>
<action android:name="SEND" />
</intent-filter>
</receiver>
<receiver
android:name=".NotificationReciever"
android:enabled="true"
android:exported="true">
<intent-filter>
<action android:name="notification" />
</intent-filter>
</receiver>
<receiver
android:name=".deliveryReciever"
android:enabled="true"
android:exported="true">
<intent-filter>
<action android:name="notification_delivered" />
</intent-filter>
</receiver>
<activity android:name=".sms_list">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name=".sms_review" />
<service
android:name=".alarmService"
android:enabled="true"
android:exported="true"></service>
</application>
</manifest>
This error comes in the run tab:
Unexpected error while executing: am start -n "my.patel.pritesh.smstimer/my.patel.pritesh.smstimer.sms_list" -a android.intent.action.MAIN -c android.intent.category.LAUNCHER
Error while Launching activity
Main tag of manifest file must be manifest. Instead of xml tag, write something like:
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="org.dummy"
android:versionCode="100"
android:versionName="1.0.0" >
<uses-permission android:name="android.permission.SEND_SMS" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<application
android:allowBackup="true"
android:icon="#drawable/sms_timer"
android:label="#string/app_name"
android:supportsRtl="true"
android:theme="#style/AppTheme">
...
</application>
</manifest>
As you are using Android Studio, I believe that you are likely have the problem mentioned in this question, and as mentioned here in the answer this error happens when you change the build version for your project (like downgrading or upgrading):
I've been working on this same exact problem for the last 8
hours...you've had no issues after rolling back from 2.0 to 1.5.1?
I've noticed that, even with the error, running the app works fine
sometimes.
so you have to make sure that there is no problem with the new release you are using, then you have to clean and rebuild your project again like mentioned here.
Or you can use the following hint from this answer:
Remove the .idea folder and gradle folder, then click button sync
project with gradle gradle files, after this process finished, you are
able to run your app as normal.

Not able to integrate mobvista SDK in Android Studio

Hi my androidmanifestxml is as below,
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.genedevelopers.shootthedevil"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="9"
android:targetSdkVersion="15" />
<!-- MobvistaSDK *begin* -->
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.READ_PHONE_STATE"/>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE"/>
<!-- For Interactive Ad (Optional) -->
<uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW"/>
<!-- MobvistaSDK *end* -->
<application
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
android:theme="#style/AppTheme" >
<activity
android:name="com.genedevelopers.shootthedevil.MainMenu"
android:label="#string/title_activity_main_menu"
android:screenOrientation="landscape"
android:theme="#android:style/Theme.NoTitleBar.Fullscreen" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<!-- MobvistaSDK *begin* -->
<activity android:name="com.mobvista.sdk.core.ad.AdActivity"
android:configChanges="orientation|keyboardHidden|screenSize"
android:windowSoftInputMode="adjustPan"
android:theme="#android:style/Theme.Translucent.NoTitleBar"/>
<!-- For admob -->
<activity android:name="com.google.ads.AdActivity"
android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|uiMode|screenSize|smallestScreenSize"/>
<activity android:name="com.google.android.gms.ads.AdActivity"
android:theme="#android:style/Theme.Translucent"
android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|uiMode|screenSize|smallestScreenSize"/>
<!-- For mobfox -->
<activity android:name="com.adsdk.sdk.banner.InAppWebView"
android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|uiMode|screenSize|smallestScreenSize" />
<activity android:name="com.adsdk.sdk.mraid.MraidBrowser"
android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|uiMode|screenSize|smallestScreenSize" />
<!-- For startapp -->
<activity android:name="com.startapp.android.publish.list3d.List3DActivity"
android:theme="#android:style/Theme" />
<activity android:name="com.startapp.android.publish.AppWallActivity"
android:theme="#android:style/Theme.Translucent"
android:configChanges="orientation|keyboardHidden|screenSize" />
<!-- MobvistaSDK *end* -->
</application>
</manifest>
i am getting the error,
* What went wrong: Execution failed for task :shootTheDevil:processDebugResources'.
com.android.ide.common.internal.LoggedErrorException: Failed to run command:
C:\Users\krazy\AppData\Local\Android\sdk\build-tools\19.1.0\aapt.exe package -f --no-crunch -I
C:\Users\krazy\AppData\Local\Android\sdk\platforms\android-8\android.jar -M D:\AndroidStudioProject\shootTheDevil\build\intermediates\manifests\full\debug\AndroidManifest.xml -S D:\AndroidStudioProject\shootTheDevil\build\intermediates\res\debug -A D:\AndroidStudioProject\shootTheDevil\build\intermediates\assets\debug -m -J D:\AndroidStudioProject\shootTheDevil\build\generated\source\r\debug -F D:\AndroidStudioProject\shootTheDevil\build\intermediates\res\resources-debug.ap_ --debug-mode --custom-package com.genedevelopers.shootthedevil -0 apk
Error Code:
1
Output:
D:\AndroidStudioProject\shootTheDevil\build\intermediates\manifests\full\debug\AndroidManifest.xml:46: error: Error: String types not allowed (at 'configChanges' with value 'orientation|keyboardHidden|screenSize').
D:\AndroidStudioProject\shootTheDevil\build\intermediates\manifests\full\debug\AndroidManifest.xml:53: error: Error: String types not allowed (at 'configChanges' with value 'keyboard|keyboardHidden|orientation|screenLayout|uiMode|screenSize|smallestScreenSize').
Whats your logcat throws
D:\AndroidStudioProject\shootTheDevil\build\intermediates\manifests\full\debug\AndroidManifest.xml:46:
error: Error: String types not allowed (at 'configChanges' with value
'orientation|keyboardHidden|screenSize').
D:\AndroidStudioProject\shootTheDevil\build\intermediates\manifests\full\debug\AndroidManifest.xml:53:
error: Error: String types not allowed (at 'configChanges' with value
'keyboard|keyboardHidden|orientation|screenLayout|uiMode|screenSize|smallestScreenSize').
screenSize and smallestScreenSize attributes are not available in SDK 9. Introduced in API level 13.
android:minSdkVersion="13"
Error string types not allowed at android:configChanges in manifest file
i got the solution, the compileSdkVersion in build.gradle file shouldbe >13. so we can retain
minSdkVersion 9
targetSdkVersion 15
now its working fine thanku

ERROR: AndroidManifest.xml is corrupt when upload APK

I spent many hours searching answer to my question, but unfortunately didn't found it.
I have read about similar questions, but there is no answer for me.
(Error with Uploading APK to Google Play)
(Error message I got when I went to upload to the playstore) and so on.
And this is my problem:
When i upload my Apk to Google Play i have this error:
Upload failed
Your APK cannot be analyzed using 'aapt dump badging'. Error output:
Failed to run aapt dump badging:
W/ResourceType( 5477): Bad XML block: header size 28024 or total size 1702240364
is larger than data size 2718
ERROR: AndroidManifest.xml is corrupt
In Google Play market i have uploaded earlier version of this app, but it is in Alpha testing version.
I have treied:
Clean + Rebuild (run on Emulator/Real device)
Creating new project and transferring the code in it.
Removing and putting different elements in AndroidManifest.xml
All texts are in string.xml and android:icon is in all drawable folders.
I use extension of the support library - ActionBarSherlock(http://actionbarsherlock.com/)
Here is my AndroidManifest.xml file:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.htv.bg"
android:versionCode="2"
android:versionName="1.1" >
<uses-sdk
android:minSdkVersion="7"
android:targetSdkVersion="19" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.WAKE_LOCK" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
<application
android:allowBackup="true"
android:icon="#drawable/ic_app"
android:label="#string/app_name">
<activity
android:name="com.htv.bg.MainActivity"
android:label="#string/app_name"
android:screenOrientation="portrait"
android:theme="#android:style/Theme.NoTitleBar.Fullscreen" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name="com.htv.bg.HomeMenu"
android:label="#string/app_name"
android:screenOrientation="portrait">
<intent-filter>
<action android:name="com.htv.bg.HOMEMENU" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
<activity
android:name="com.htv.bg.HtvVideo"
android:label="#string/app_name"
android:screenOrientation="portrait"
android:theme="#android:style/Theme.Dialog" >
<intent-filter>
<action android:name="com.htv.bg.HTVVIDEO" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
<activity
android:name="com.htv.bg.InstalVPlayer"
android:label="#string/app_name"
android:screenOrientation="portrait"
android:theme="#android:style/Theme.Dialog" >
<intent-filter>
<action android:name="com.htv.bg.INSTALVPLAYER" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
</application>
</manifest>
Can someone please help out to fix this problem!
I followed this tutorial and now everything is fine:
http://www.youtube.com/watch?v=gpxM0ffAvok

Categories

Resources