NativeScript / NativeScript/nativescript-cli
Adding strings.xml in App_Resources/Android/src/main/res/values is crashing the build
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 1.1k
- Forks
- 204
- Avg merge
- 1d 9h
- Merged PRs (30d)
- 8
Description
By the design with CLI 4.1.0 the structure of Android resource folder is as follows:
Android/src/main/res/values
By default in values folder there is colors.xml and styles.xml files.
When, I add a strings/xml file it will cause the app build to crash.
The reaons: the strings.xml is created during build and if a custom file is introduced it will replace the content of the default one causing two string to be missing (whic are used in AndoridManifes)
Error log
D:\git\NS-Issues-2018-II\NativeScript\issue-5897\platforms\android\app\build\intermediates\manifests\full\debug\AndroidManifest.xml:33: AAPT: error: resource string/app_name (aka org.nativescript.issue5897:string/app_name) not found.
D:\git\NS-Issues-2018-II\NativeScript\issue-5897\platforms\android\app\build\intermediates\manifests\full\debug\AndroidManifest.xml:44: AAPT: error: resource string/title_activity_kimera (aka org.nativescript.issue5897:string/title_activity_kimera) not found.
Reproducible with hello world template and CLI 4.1.0 on Win.
Steps to reporduce:
- Create new project
- Add strings.xml in Android/src/main/res/values
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="nativescript_google_maps_api_key">Some-Api-Key</string>
</resources>
- Build the project - it fails due to missing
title_activity_kimeraandapp_name
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Reproduce the failure with a hello-world project using CLI 4.1.0 and a custom App_Resources/Android/src/main/res/values/strings.xml. Inspect how Android resources are assembled during the build and verify that the generated app_name and title_activity_kimera strings remain available alongside the custom string. Done means the project builds successfully with the custom resource file.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- android, javascript
- Domain
- build-system, cli, mobile-dev
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100