Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
rosen-vladimirov opened this issue Nov 8, 2019 · 1 comment
Assignees
Labels
bug build Describes issues related to build operations debug os: android prepare Describes issues related to prepare command run Describes issues related to run command unit testing
Milestone

Comments

@rosen-vladimirov
Copy link
Contributor

rosen-vladimirov commented Nov 8, 2019

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

@rosen-vladimirov rosen-vladimirov added bug unit testing debug os: android build Describes issues related to build operations run Describes issues related to run command prepare Describes issues related to prepare command labels Nov 8, 2019
@rosen-vladimirov rosen-vladimirov added this to the 6.2.1 milestone Nov 8, 2019
@rosen-vladimirov rosen-vladimirov self-assigned this Nov 8, 2019
@rosen-vladimirov
Copy link
Contributor Author

rosen-vladimirov commented Nov 13, 2019

Acceptance criteria:

  • Build with --compileSdk 28 should work.
  • Build with --compileSdk 28 must not have <project dir>\platforms\android\app\src\main\res\values-v29 dir.
  • Build with SDK 29 must enable dark theme support (i.e. the <project dir>\platforms\android\app\src\main\res\values-v29 dir must exist)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug build Describes issues related to build operations debug os: android prepare Describes issues related to prepare command run Describes issues related to run command unit testing
Projects
None yet
Development

No branches or pull requests

2 participants