This is a migrated thread and some comments may be shown as answers.

nativescript CLI build failed: No resource found that matches the given name 'android:Theme.Material.Light'.

7 Answers 323 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Peter
Top achievements
Rank 1
Peter asked on 06 Mar 2015, 09:12 PM
Hi,

I created a project and tried to build it, but I got an error.
I installed android 4.4.2 SDK (API 19), and a newer version was already installed: 5.0.1 (API 21)

I could create, prepare, build, deploy to android with an older version of (0.4.x).

I used the following commands:

create hello
cd hello
platform android
prepare android
build android


 [aapt] D:\hobbyprojects\nativescript\hello\platforms\android\res\values-v21\styles.xml:3: error: Error retrieving parent for item: No resource found that matches the given name Material.Light'.

BUILD FAILED
D:\libraries\androidsdk\tools\ant\build.xml:653: The following error occurred while executing this line:
D:\libraries\androidsdk\tools\ant\build.xml:698: null returned: 1

Total time: 1 second
Command cmd failed with exit code 1

Could you please help me, how can I build the application?
Thanks,
Peter

7 Answers, 1 is accepted

Sort by
0
Mihail
Telerik team
answered on 09 Mar 2015, 12:58 PM
Hello Péter,

We observed similar problem when there are many Android SDK folders installed on the computer. For example, in one of the SDK folders there is 'platforms\android-19' directory and in another SDK folder there is 'platforms\android-21' directory.

In order to check which platforms are available to the "tns" tool you can type the following command

android list target

before "tns build android" command.  Then examine the output and try to find an entry with id "android-21" and/or "API Level: 21". If you don't see such an entry you should modify your PATH environment variable to contain the correct SDK folder.

Please let me know if that is the case.

Regards,
Mihail
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
0
diandian82
Top achievements
Rank 1
answered on 11 Mar 2015, 05:37 AM
I got the same problem. I only installed sdk19 and the path is C:\Users\george\AppData\Local\Android\android-sdk\platforms\android-19

I still don't know how to fix this. 

I run the android list target and get this list as screen shot.

What else i can do to fix this? Is this only support android 21 above?
0
Ludovic
Top achievements
Rank 1
answered on 11 Mar 2015, 01:01 PM
Same here !
0
Ben
Top achievements
Rank 1
answered on 11 Mar 2015, 01:37 PM
I had the same issue - I was able to workaround it by commenting out the style reference in values-v21\styles.xml
0
Mihail
Telerik team
answered on 11 Mar 2015, 02:20 PM
Hello all,

We found a bug in our build logic. I would suggest the following workarounds.

Workaround 1
Install Android SDK 21 and edit %your_project%/platforms/android/project.properties file to contain the following line:

target=android-21

If the file contains other target, please make sure to update it to android-21.

Workaround 2
Delete the following folder %your_project%/platforms/android/res/values-v21

On some machines it may be needed to clean previous build artifacts. You can do that with the following commands:

cd %your_project%/platforms/android/
ant clean

I will update this thread once we ship the bug fix.

Regards,
Mihail
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
0
João
Top achievements
Rank 1
answered on 11 Mar 2015, 02:21 PM
I replaced on the file "res/values/styles.xml" Theme.Material.Light to Theme.Light
And works for me.
0
RainerAtSpirit
Top achievements
Rank 1
answered on 12 Mar 2015, 04:22 PM
@João: Very nice, that did it for me.
Tags
General Discussions
Asked by
Peter
Top achievements
Rank 1
Answers by
Mihail
Telerik team
diandian82
Top achievements
Rank 1
Ludovic
Top achievements
Rank 1
Ben
Top achievements
Rank 1
João
Top achievements
Rank 1
RainerAtSpirit
Top achievements
Rank 1
Share this question
or