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

Android build is failing when I use my own styles.xml #644

Closed
rosen-vladimirov opened this issue Jul 14, 2015 · 0 comments
Closed

Android build is failing when I use my own styles.xml #644

rosen-vladimirov opened this issue Jul 14, 2015 · 0 comments
Assignees
Labels
Milestone

Comments

@rosen-vladimirov
Copy link
Contributor

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 values directory
  • Inside values directory 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/values directory - you will notice that there are two files - styles.xml and strings.xml - they are created from default template.
  • Try building the project tns build android - the build will fail
  • Check platforms/android/res/values again - it contains only your styles.xml file. The build is failing as there's no strings.xml file.

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants