Values from strings.xml not found in capacitor AndroidManifest.xml
See original GitHub issueI’m trying to get my project to compile with the jeduan/cordova-plugin-facebook4 cordova plugin. I have included my facebook id and app name in the app/src/main/res/values/strings.xml like so:
<?xml version="1.0" encoding="UTF-8"?>
<resources>
<string name="app_name">UI</string>
<string name="title_activity_main">UI</string>
<string name="package_name">[redacted]</string>
<string name="fileprovider_authority">[redacted]</string>
<string name="custom_url_scheme">[redacted]</string>
<string name="fb_app_id">[redacted]</string>
<string name="fb_app_name">UI</string>
</resources>
I have also added the necessary facebook values to app/src/main/AndroidManifest.xml like so:
...
<meta-data android:name="com.facebook.sdk.ApplicationId" android:value="@string/fb_app_id"/>
<meta-data android:name="com.facebook.sdk.ApplicationName" android:value="@string/fb_app_name" />
<activity android:name="com.facebook.FacebookActivity"
android:configChanges="keyboard|keyboardHidden|screenLayout|screenSize|orientation"
android:label="@string/fb_app_name" />
...
Despite this fact I am getting this error upon compilation:
dManifest.xml:13: AAPT: error: resource string/fb_app_id (aka capacitor.android.plugins:string/fb_app_id) not found.
/Users/nstokoe/code/fullmeasure/prototype/ui/node_modules/@capacitor/cli/assets/capacitor-android-plugins/build/intermediates/manifests/aapt/release/AndroidManifest.xml:16: AAPT: error: resource string/fb_app_name (aka capacitor.android.plugins:string/fb_app_name) not found.
/Users/nstokoe/code/fullmeasure/prototype/ui/node_modules/@capacitor/cli/assets/capacitor-android-plugins/build/intermediates/manifests/aapt/release/AndroidManifest.xml:20: AAPT: error: resource string/fb_app_name (aka capacitor.android.plugins:string/fb_app_name) not found.
The file it is complaining about looks like this in my node_modules:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:amazon="http://schemas.amazon.com/apk/res/android"
xmlns:android="http://schemas.android.com/apk/res/android"
package="capacitor.android.plugins"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="21"
android:targetSdkVersion="27" />
<application>
<meta-data
android:name="com.facebook.sdk.ApplicationId"
android:value="@string/fb_app_id" />
<meta-data
android:name="com.facebook.sdk.ApplicationName"
android:value="@string/fb_app_name" />
<activity
android:name="com.facebook.FacebookActivity"
android:configChanges="keyboard|keyboardHidden|screenLayout|screenSize|orientation"
android:label="@string/fb_app_name" />
</application>
</manifest>
Is there something I am missing to make the values defined in strings.xml available to the manifest files in the capacitor module?
Issue Analytics
- State:
- Created 5 years ago
- Reactions:2
- Comments:7 (2 by maintainers)
Top Results From Across the Web
How to copy `string.xml` to capacitor-cordova-android-plugins?
In the app proejct ( app/src/main/res/values ), create a new xml files for string resource and define the string variables pass to the...
Read more >Configuring Android | Capacitor Documentation
AndroidManifest.xml may reference additional files such as styles.xml and strings.xml within the android/app/src/main/res/values directory via @style and ...
Read more >Ionic5 capacitor fix AndroidManifest.xml for missing activity ...
Ok, I found it. I have to change the YouTubeActivity -> android:label="@string/activity_name" for android:label="@string/app_name" for the ...
Read more >Migrating to Cordova-Android 11 - Ionic
is also present at [:br-android-vault:] AndroidManifest.xml:10:9-35 value=(true). Suggestion: add 'tools:replace="android:allowBackup"' to ...
Read more >Config.xml - Apache Cordova
Set the activity name for your app in AndroidManifest.xml. Note that this is only set once after the Android platform is first added....
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
For someone facing this issue building release versions:
change assemblerelease for app:assemblerelease
Read this for more info: https://stackoverflow.com/questions/60990805/difference-between-appassemblerelease-and-assemblerelease
For the record, adding the missing
fb_app_id
andfb_app_name
toapp/src/main/res/values/strings.xml
worked for me, but it’s concerning to not have them added automatically from the plugin config.