Skip to content

values-v<sdk> Android resource directories are not prepared correctly #5120

Closed
@rosen-vladimirov

Description

@rosen-vladimirov

Environment
Provide version numbers for the following components (information can be retrieved by running tns info in your project folder or by inspecting the package.json of the project):

  • CLI: 6.2.0
  • Cross-platform modules: Not applicable
  • Android Runtime: 6.2.0
  • iOS Runtime: Not applicable
  • Plugin(s): Not applicable

Describe the bug
Currently all values-v directories from <path to project's App_Resources>/Android/src/main/res are included in the native project. The purpose of these directories is to separate the resources and features available for different SDKs. In case you build the application with SDK 28 for example, the resources for SDK 29 shouldn't be included in the project as probably they contain a resource usage that is not buildable with SDK28.

To Reproduce

  1. Create new project: tns create appValuesIssue --js
  2. Open the newly created project and copy appValuesIssue/app/App_Resources/Android/src/main/res/values-v21/ to appValuesIssue/app/App_Resources/Android/src/main/res/values-v29/
  3. Build the project: tns build android --compileSdk 28
    Build fails with error:
Execution failed for task ':app:processDebugResources'.
Android resource linking failed
<project dir>\platforms\android\app\src\main\res\values-v29\styles.xml:5:5-7:13: AAPT: error: style attribute 'android:attr/forceDarkAllowed' not found.


Command gradlew.bat failed with exit code 1
  1. Check the appValuesIssue/platforms/android/app/src/main/res/values-v29/ dir - it will be there, while in fact, it shouldn't.

Additional context

Metadata

Metadata

Labels

bugbuildDescribes issues related to build operationsdebugos: androidprepareDescribes issues related to prepare commandrunDescribes issues related to run commandunit testing

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions