Android Manifest - Salesforce SDK sf_Icon not found

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP



Android Manifest - Salesforce SDK sf_Icon not found



Running into an issue that others have had, but I have vetted all of the solutions I have found and am unable to resolve this.



Essentially it seems the error is an icon is not where it's supposed to be.



Below are all of the attempts and other solutions I have looked into.



Trailhead:
https://trailhead.salesforce.com/projects/mobilesdk_setup_dev_tools/steps/mobilesdk_setup_hybrid


npm uninstall -g cordova


npm install -g cordova@7.0.0


cordova telemetry off


npm install -g forcehybrid


forcehybrid create


npm uninstall -g cordova


Npm install -g cordova



Forcehybrid create:


$ forcehybrid create
Enter your application type (hybrid_local, hybrid_remote): hybrid_local
Enter your application name: trail
Enter your package name: com.trailhead.app
Enter your organization name (Acme, Inc.): test
Enter output directory for your app (leave empty for the current directory):

********************************************************************************
*
* Creating android hybrid_local application using Salesforce Mobile SDK
* with app name: trail
* package name: com.trailhead.app
* organization: test
*
* in: trail
*
* from template repo: https://github.com/forcedotcom/SalesforceMobileSDK-Templates#v6.2.0
* template path: HybridLocalTemplate
* plugin repo: https://github.com/forcedotcom/SalesforceMobileSDK-CordovaPlugin#v6.2.0
*
********************************************************************************

Creating a new cordova project.
C:UsersSterlingDesktopsftriestrailheadtrail C:UsersSterlingDesktopsftriestrailhead
+ shelljs@0.7.0
added 16 packages in 1.474s
C:UsersSterlingDesktopsftriestrailhead
C:UsersSterlingDesktopsftriestrailheadtrail C:UsersSterlingDesktopsftriestrailhead
Using cordova-fetch for cordova-android@7.0.0
Adding android project...
Creating Cordova project for the Android platform:
Path: platformsandroid
Package: com.trailhead.app
Name: trail
Activity: MainActivity
Android target: android-26
Subproject Path: CordovaLib
Subproject Path: app
Android project created with cordova-android@7.0.0
Android Studio project detected
Android Studio project detected
Discovered plugin "cordova-plugin-whitelist" in config.xml. Adding it to the project
Installing "cordova-plugin-whitelist" for android

This plugin is only applicable for versions of cordova-android greater than 4.0. If you have a previous platform version, you do *not* need this plugin since the whitelist will be built in.
Adding cordova-plugin-whitelist to package.json
Saved plugin info for "cordova-plugin-whitelist" to config.xml
--save flag or autosave detected
Saving android@~7.0.0 into config.xml file ...
C:UsersSterlingDesktopsftriestrailhead
C:UsersSterlingDesktopsftriestrailheadtrail C:UsersSterlingDesktopsftriestrailhead
Installing "com.salesforce" for android
Plugin dependency "cordova-plugin-whitelist@1.3.3" already fetched, using that version.
Dependent plugin "cordova-plugin-whitelist" already installed on android.
Installing "phonegap-plugin-push" for android
Android Studio project detected
Subproject Path: CordovaLib
Subproject Path: app
--force is used. edit-config will overwrite conflicts if any. Conflicting plugins may not work as expected.
Running SalesforceMobileSDK plugin android post-install script
Moving Salesforce libraries to the correct location
Fixing Gradle dependency paths in Salesforce libraries
Fixing root level Gradle file for the generated app
include ":SalesforceAnalytics"

include ":SalesforceSDK"

include ":SmartStore"

include ":SmartSync"

include ":SalesforceHybrid"

Moving Gradle wrapper files to application directory
Fixing application build.gradle
Copying AndroidManifest.xml to its correct location
Fixing project workspace build.gradle
Done running SalesforceMobileSDK plugin android post-install script
Adding com.salesforce to package.json
Saved plugin info for "com.salesforce" to config.xml
C:UsersSterlingDesktopsftriestrailhead
C:UsersSterlingDesktopsftriestrailheadtrailwww C:UsersSterlingDesktopsftriestrailhead
Installing sdk dependencies
Cloning into 'mobile_sdkSalesforceMobileSDK-Shared'...
remote: Counting objects: 192, done.
remote: Compressing objects: 100% (138/138), done.
remote: Total 192 (delta 50), reused 99 (delta 22), pack-reused 0
Receiving objects: 100% (192/192), 4.52 MiB | 1.62 MiB/s, done.
Resolving deltas: 100% (50/50), done.
Note: checking out '4b6b1d870a7b21df4611a0590e5e76bc50e702e2'.

You are in 'detached HEAD' state. You can look around, make experimental
changes and commit them, and you can discard any commits you make in this
state without impacting any branches by performing another checkout.

If you want to create a new branch to retain commits you create, you may
do so (now or later) by using -b with the checkout command again. Example:

git checkout -b <new-branch-name>

Installing npm dependencies
npm notice created a lockfile as package-lock.json. You should commit this file.
added 1 package in 1.229s
C:UsersSterlingDesktopsftriestrailhead
C:UsersSterlingDesktopsftriestrailheadtrail C:UsersSterlingDesktopsftriestrailhead
Android Studio project detected
C:UsersSterlingDesktopsftriestrailhead

********************************************************************************
*
* Next steps for android:
*
* Your application project is ready in trail.
* To use your new application in Android Studio, do the following:
* - open trailplatformsandroid in Android Studio
* - build and run
* Before you ship, make sure to plug your OAuth Client ID and Callback URI, and OAuth Scopes into trailwwwbootconfig.json
*
********************************************************************************
Cd trail
~/Desktop/sftries/trailhead/trail

$ cordova build android
Android Studio project detected
ANDROID_HOME=C:UsersSterlingAppDataLocalAndroidSdk
JAVA_HOME=C:Program FilesJavajdk1.8.0_171
studio
Subproject Path: CordovaLib
Subproject Path: app
publishNonDefault is deprecated and has no effect anymore. All variants are now published.
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_6pmu9gjoziyq762ebx8k6akps.run(C:UsersSterlingDesktopsftriestrailheadtrailplatformsandroidappbuild.gradle:144)
Configuration 'compile' in project ':app' is deprecated. Use 'implementation' instead.
:CordovaLib:preBuild UP-TO-DATE
:CordovaLib:preDebugBuild UP-TO-DATE
:CordovaLib:compileDebugAidl
:CordovaLib:compileDebugRenderscript
:CordovaLib:checkDebugManifest
:CordovaLib:generateDebugBuildConfig
:CordovaLib:prepareLintJar
:CordovaLib:generateDebugResValues
:CordovaLib:generateDebugResources
:CordovaLib:packageDebugResources
:CordovaLib:platformAttrExtractor
:CordovaLib:processDebugManifest
:CordovaLib:javaPreCompileDebug
:CordovaLib:processDebugJavaRes NO-SOURCE
:app:preBuild UP-TO-DATE
:app:preDebugBuild
:app:compileDebugAidl
:CordovaLib:packageDebugRenderscript NO-SOURCE
:app:compileDebugRenderscript
:app:checkDebugManifest
:app:generateDebugBuildConfig
:app:prepareLintJar
:app:generateDebugResValues
:app:generateDebugResources
:app:mergeDebugResources
:app:createDebugCompatibleScreenManifests
:app:processDebugManifest
:app:splitsDiscoveryTaskDebug
:app:compileDebugNdk NO-SOURCE
:CordovaLib:mergeDebugShaders
:CordovaLib:compileDebugShaders
:CordovaLib:generateDebugAssets
:CordovaLib:mergeDebugAssets
:app:mergeDebugShaders
:app:compileDebugShaders
:app:generateDebugAssets
:app:mergeDebugAssets
:CordovaLib:compileDebugNdk NO-SOURCE
:CordovaLib:mergeDebugJniLibFolders
:CordovaLib:transformNativeLibsWithMergeJniLibsForDebug
:CordovaLib:transformNativeLibsWithIntermediateJniLibsForDebug
:app:mergeDebugJniLibFolders
:app:processDebugJavaRes NO-SOURCE
:app:validateSigningDebug
:CordovaLib:processDebugResources
:CordovaLib:generateDebugSources
:CordovaLib:compileDebugJavaWithJavacNote: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.

:CordovaLib:transformClassesAndResourcesWithPrepareIntermediateJarsForDebug
:app:processDebugResourcesC:UsersSterlingDesktopsftriestrailheadtrailplatformsandroidappbuildintermediatesmanifestsfulldebugAndroidManifest.xml:32: AAPT: error: resource drawable/sf__icon (aka com.trailhead.app:drawable/sf__icon) not found.

C:UsersSterlingDesktopsftriestrailheadtrailplatformsandroidappbuildintermediatesmanifestsfulldebugAndroidManifest.xml:32: error: resource drawable/sf__icon (aka com.trailhead.app:drawable/sf__icon) not found.
error: failed processing manifest.
Build project within android:
MOBILE SDK DOC (testing in blank directory)



Forechybrid create


$ forcehybrid create
Enter your application type (hybrid_local, hybrid_remote): hybrid_local
Enter your application name: docsdk
Enter your package name: com.docsdk.app
Enter your organization name (Acme, Inc.): docsdk
Enter output directory for your app (leave empty for the current directory):

********************************************************************************
*
* Creating android hybrid_local application using Salesforce Mobile SDK
* with app name: docsdk
* package name: com.docsdk.app
* organization: docsdk
*
* in: docsdk
*
* from template repo: https://github.com/forcedotcom/SalesforceMobileSDK-Templates#v6.2.0
* template path: HybridLocalTemplate
* plugin repo: https://github.com/forcedotcom/SalesforceMobileSDK-CordovaPlugin#v6.2.0
*
********************************************************************************

Creating a new cordova project.
C:UsersSterlingDesktopsftriesmobilesdk docdocsdk C:UsersSterlingDesktopsftriesmobilesdk doc
+ shelljs@0.7.0
added 16 packages in 2.546s
C:UsersSterlingDesktopsftriesmobilesdk doc
C:UsersSterlingDesktopsftriesmobilesdk docdocsdk C:UsersSterlingDesktopsftriesmobilesdk doc
Using cordova-fetch for cordova-android@7.0.0
Adding android project...
Creating Cordova project for the Android platform:
Path: platformsandroid
Package: com.docsdk.app
Name: docsdk
Activity: MainActivity
Android target: android-26
Subproject Path: CordovaLib
Subproject Path: app
Android project created with cordova-android@7.0.0
Android Studio project detected
Android Studio project detected
Discovered plugin "cordova-plugin-whitelist" in config.xml. Adding it to the project
Installing "cordova-plugin-whitelist" for android

This plugin is only applicable for versions of cordova-android greater than 4.0. If you have a previous platform version, you do *not* need this plugin since the whitelist will be built in.
Adding cordova-plugin-whitelist to package.json
Saved plugin info for "cordova-plugin-whitelist" to config.xml
--save flag or autosave detected
Saving android@~7.0.0 into config.xml file ...
C:UsersSterlingDesktopsftriesmobilesdk doc
C:UsersSterlingDesktopsftriesmobilesdk docdocsdk C:UsersSterlingDesktopsftriesmobilesdk doc
Installing "com.salesforce" for android
Plugin dependency "cordova-plugin-whitelist@1.3.3" already fetched, using that version.
Dependent plugin "cordova-plugin-whitelist" already installed on android.
Installing "phonegap-plugin-push" for android
Android Studio project detected
Subproject Path: CordovaLib
Subproject Path: app
--force is used. edit-config will overwrite conflicts if any. Conflicting plugins may not work as expected.
Running SalesforceMobileSDK plugin android post-install script
Moving Salesforce libraries to the correct location
Fixing Gradle dependency paths in Salesforce libraries
Fixing root level Gradle file for the generated app
include ":SalesforceAnalytics"

include ":SalesforceSDK"

include ":SmartStore"

include ":SmartSync"

include ":SalesforceHybrid"

Moving Gradle wrapper files to application directory
Fixing application build.gradle
Copying AndroidManifest.xml to its correct location
Fixing project workspace build.gradle
Done running SalesforceMobileSDK plugin android post-install script
Adding com.salesforce to package.json
Saved plugin info for "com.salesforce" to config.xml
C:UsersSterlingDesktopsftriesmobilesdk doc
C:UsersSterlingDesktopsftriesmobilesdk docdocsdkwww C:UsersSterlingDesktopsftriesmobilesdk doc
Installing sdk dependencies
Cloning into 'mobile_sdkSalesforceMobileSDK-Shared'...
remote: Counting objects: 192, done.
remote: Compressing objects: 100% (138/138), done.
remote: Total 192 (delta 50), reused 99 (delta 22), pack-reused 0
Receiving objects: 100% (192/192), 4.52 MiB | 3.37 MiB/s, done.
Resolving deltas: 100% (50/50), done.
Note: checking out '4b6b1d870a7b21df4611a0590e5e76bc50e702e2'.

You are in 'detached HEAD' state. You can look around, make experimental
changes and commit them, and you can discard any commits you make in this
state without impacting any branches by performing another checkout.

If you want to create a new branch to retain commits you create, you may
do so (now or later) by using -b with the checkout command again. Example:

git checkout -b <new-branch-name>

Installing npm dependencies
npm notice created a lockfile as package-lock.json. You should commit this file.
added 1 package in 1.185s
C:UsersSterlingDesktopsftriesmobilesdk doc
C:UsersSterlingDesktopsftriesmobilesdk docdocsdk C:UsersSterlingDesktopsftriesmobilesdk doc
Android Studio project detected
C:UsersSterlingDesktopsftriesmobilesdk doc

********************************************************************************
*
* Next steps for android:
*
* Your application project is ready in docsdk.
* To use your new application in Android Studio, do the following:
* - open docsdkplatformsandroid in Android Studio
* - build and run
* Before you ship, make sure to plug your OAuth Client ID and Callback URI, and OAuth Scopes into docsdkwwwbootconfig.json
*
********************************************************************************



Cordova prepare


$ cordova prepare
Android Studio project detected



Cordova build android
Same errors as above cant find icon



Same Issues I’ve already looked at:
https://salesforce.stackexchange.com/questions/72079/error-no-resource-found-that-matches-the-given-name-at-icon-with-value-dra



Suggests that there is a single file “icon.png” in res folder. Res folder is never created in platform/android
forcedotcom/SalesforceMobileSDK-Android#920



Suggestion was to add cordova to project after using forcedroid to create. This does not result in a cordova project.
forcedotcom/SalesforceMobileSDK-Android#1190



This states the forcedroid version is incorrect, I am using the most recent forcedroid version.



HOWEVER



I am able to get the app build if I remove the android platform and reinstall as proposed here:
Cordova does not create AndroidManifest.xml
(The second answer).



Except I get this warning during the build:


Installing "com.salesforce" for android
Plugin doesn't support this project's cordova-android version. cordova-android: 6.4.0, failed version requirement: 7.0.0



Which subsequently results in this in the logcat:


08-12 05:10:21.625 8821-8821/com.trailhead.app I/chromium: [INFO:CONSOLE(20)] "Auth failed: Salesforce Mobile SDK OAuth plugin not available", source: file:///android_asset/www/index.html



So then I follow the steps to re-upgrade to cordova android 7 again:
https://cordova.apache.org/announcements/2017/12/04/cordova-android-7.0.0.html


npm install -g cordova
cd my_project
cordova platform remove android
cordova platform add android@7.0.0
Which it fails to actually delete the directories, but updates the config.xml and cordova.platforms array in pacak.json:

$ cordova platform remove android
rm: could not remove directory (code ENOTEMPTY): C:UsersSterlingDesktopsftriestrailheadtrailplatformsandroid/build/outputs/apk

rm: could not remove directory (code ENOTEMPTY): C:UsersSterlingDesktopsftriestrailheadtrailplatformsandroid/build/outputs/apk
rm: could not remove directory (code ENOTEMPTY): C:UsersSterlingDesktopsftriestrailheadtrailplatformsandroid/build/outputs

rm: could not remove directory (code ENOTEMPTY): C:UsersSterlingDesktopsftriestrailheadtrailplatformsandroid/build/outputs/apk
rm: could not remove directory (code ENOTEMPTY): C:UsersSterlingDesktopsftriestrailheadtrailplatformsandroid/build/outputs
rm: could not remove directory (code ENOTEMPTY): C:UsersSterlingDesktopsftriestrailheadtrailplatformsandroid/build

rm: could not remove directory (code ENOTEMPTY): C:UsersSterlingDesktopsftriestrailheadtrailplatformsandroid/build/outputs/apk
rm: could not remove directory (code ENOTEMPTY): C:UsersSterlingDesktopsftriestrailheadtrailplatformsandroid/build/outputs
rm: could not remove directory (code ENOTEMPTY): C:UsersSterlingDesktopsftriestrailheadtrailplatformsandroid/build
rm: could not remove directory (code ENOTEMPTY): C:UsersSterlingDesktopsftriestrailheadtrailplatformsandroid



Removing platform android from config.xml file...
Removing android from cordova.platforms array in package.json
So I manually remove the android directory after this
Then run: cordova platform add android@7.0.0
Then fails again due to the icon.









By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Popular posts from this blog

make 2 or more post in bootsrap

Store custom data using WC_Cart add_to_cart() method in Woocommerce 3

React Native Navigation and navigating to another Screen problem