Skip to content

Adding strings.xml in App_Resources/Android/src/main/res/values is crashing the build #3670

Open
@NickIliev

Description

@NickIliev

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_kimera and app_name

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugbuildDescribes issues related to build operationsos: android

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions