I'm trying to package an android hybrid app using the steps here https://github.com/forcedotcom/SalesforceMobileSDK-CordovaPlugin.

This all runs fine and the app seems to be good, but when I try to upload to the play store (or run "aapt badging" on the APK) I get the following output and error.

package: name='io.cordova.hellocordova' versionCode='1' versionName='0.0.1' uses-permission:'android.permission.INTERNET' application-label:'HelloCordova' application-icon-120:'res/drawable-ldpi/sf__icon.png' application-icon-160:'res/drawable-mdpi/sf__icon.png' application-icon-240:'res/drawable-hdpi/sf__icon.png' application-icon-320:'res/drawable-xhdpi/sf__icon.png' application-icon-480:'res/drawable-xxhdpi/sf__icon.png' application: label='HelloCordova' icon='res/drawable-mdpi/sf__icon.png' application-debuggable launchable-activity: name='com.salesforce.androidsdk.ui.sfhybrid.SalesforceDroidGapActivity' label='HelloCordova' icon='' ERROR getting 'name' attribute: attribute is not a string value

Some searching has shown a previous similar issue that was related to some string resources but I believe that is not the case here (and also was fixed).

Has anyone managed to build a hybrid app and have it pass the aapt checks?

I'm happy to raise a github issue if that's the suggested route.

UPDATE Here is my AndroidManifest.xml

<?xml version='1.0' encoding='utf-8'?> <manifest android:hardwareAccelerated="true" android:versionCode="1" android:versionName="0.0.1" package="net.todd.biz001" xmlns:android="http://schemas.android.com/apk/res/android"> <supports-screens android:anyDensity="true" android:largeScreens="true" android:normalScreens="true" android:resizeable="true" android:smallScreens="true" android:xlargeScreens="true" /> <application android:debuggable="true" android:hardwareAccelerated="true" android:icon="@drawable/icon" android:label="@string/app_name" android:manageSpaceActivity="com.salesforce.androidsdk.ui.ManageSpaceActivity" android:name="com.salesforce.androidsdk.smartsync.app.HybridAppWithSmartSync"> <activity android:alwaysRetainTaskState="true" android:exported="true" android:launchMode="singleInstance" android:name="com.plugin.gcm.PushHandlerActivity" /> <receiver android:name="com.plugin.gcm.CordovaGCMBroadcastReceiver" android:permission="com.google.android.c2dm.permission.SEND"> <intent-filter> <action android:name="com.google.android.c2dm.intent.RECEIVE" /> <action android:name="com.google.android.c2dm.intent.REGISTRATION" /> <category android:name="net.me.biz001" /> </intent-filter> </receiver> <service android:name="com.plugin.gcm.GCMIntentService" /> <activity android:configChanges="orientation|keyboardHidden|keyboard|screenSize|locale" android:label="@string/app_name" android:name="com.salesforce.androidsdk.ui.sfhybrid.SalesforceDroidGapActivity" 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:exported="true" android:name="com.plugin.gcm.PushHandlerActivity" /> </application> <uses-sdk android:minSdkVersion="17" android:targetSdkVersion="21" /> <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" /> <uses-permission android:name="android.permission.GET_ACCOUNTS" /> <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="net.me.biz001.permission.C2D_MESSAGE" android:protectionLevel="signature" /> <uses-permission android:name="net.me.biz001.permission.C2D_MESSAGE" /> <uses-permission android:name="android.permission.INTERNET" /> <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" /> <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" /> <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" /> </manifest>


I ran into this issue recently and it looks like having a string reference for the category name value causes a problem.

To resolve the issue you need to replace few values in this file. plugins/com.salesforce/src/android/libs/SalesforceSDK/AndroidManifest.xml

Replace all occurrences of

<category android:name="@string/app_package" /> 
<category android:name="com.test" />

Please use your package name above instead of com.test.

| improve this answer | |
  • Thanks @dpcbadu, I had seen this is another issue before and had already checked for it. I have updated my post above to include the AndroidManifest.xml so you can see that too. – Todd Halfpenny Apr 2 '15 at 10:31
  • Um... you probably already know this but typically all the manifest files are merged to create the final manifest file so you may want to look at that final file that gets created in the bin folder. Also, which version of the SalesforceSDK are you using? 2.3.x or 3.1.x. Let me know. – dpcbabu Apr 3 '15 at 13:23
  • I have obviously misread something down the line and haven't been paying attention to the AndroidManifest .xml files inside the plugins dir. After modifying these my app builds fine and also passes the aapt test. Thanks! – Todd Halfpenny Apr 5 '15 at 22:28
  • Thanks man!! was stuck in the same problem!! This post did help. – Karthik Nagaraj Apr 20 '16 at 13:32

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.