-
-
Notifications
You must be signed in to change notification settings - Fork 201
Closed
Description
Issue
In my app I've added my own styles.xml in app/App_Resources/Android/values (note that I've created values dir manually).
Android build is failing with the following error:
[mergemanifest] Manifest merger disabled. Using project manifest only.
[echo] Handling aidl files...
[aidl] No AIDL files to compile.
[echo] ----------
[echo] Handling RenderScript files...
[echo] ----------
[echo] Handling Resources...
[aapt] Generating resource IDs...
[aapt] d:\Work\nativescript-cli\scratch\myApp\platforms\android\bin\AndroidManifest.xml:21: error: Error: No resource found that matches the given name (at 'label' with value '@string/app_name').
[aapt]
[aapt] d:\Work\nativescript-cli\scratch\myApp\platforms\android\bin\AndroidManifest.xml:27: error: Error: No resource found that matches the given name (at 'label' with value '@string/title_activity_kimera').
[aapt]
BUILD FAILED
d:\Program Files\android_sdk\tools\ant\build.xml:649: The following error occurred while executing this line:
d:\Program Files\android_sdk\tools\ant\build.xml:694: null returned: 1
Total time: 1 second
Command C:\WINDOWS\system32\cmd.exe failed with exit code 1
The build is failing with latest {N} CLI, but it was working with previous versions.
Steps to reproduce
- Create new application:
tns create myApp - Navigate to the app/App_Resources/Android directory
- Create
valuesdirectory - Inside
valuesdirectory create new styles.xml file with the following content:
<?xml version="1.0" encoding="utf-8"?>
<resources>
<style name="AppTheme" parent="android:Theme.Holo.Light">
</style>
</resources>
- Add android platform to
myApp:tns platform add android - At this point you can check
platforms/android/res/valuesdirectory - you will notice that there are two files -styles.xmlandstrings.xml- they are created from default template. - Try building the project
tns build android- the build will fail - Check
platforms/android/res/valuesagain - it contains only your styles.xml file. The build is failing as there's nostrings.xmlfile.
Workaround
In your own values dir, you can put strings.xml file (after tns platform add android you can take the original strings.xml from platforms/android/res/values directory and place it in app/App_Resources/Android/values directory.
Reactions are currently unavailable