Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cannot convert string '@bool/some_key' to target class 'boolean'

I have the following bool.xml file:

<?xml version="1.0" encoding="utf-8"?>
<resources>
    <bool name="some_key">false</bool>
</resources>

When I try to use this value in AndroidManifest:

<activity
    android:name=".ui.activities.SomeActivity"
    android:enabled="@bool/some_key"
    ... >
    ...
</activity>

I get this error:

Cannot convert string '@bool/some_key' to target class 'boolean'

I'm using Android Studio 2.2.3

like image 319
Rotem Matityahu Avatar asked Mar 01 '17 15:03

Rotem Matityahu


1 Answers

The code looks fine.This is the issue of Android studio 2.x .It is fixed in 2.3 .Please refer here.If you still need to get this done use 2.3 canary instead get 2.3 canary

like image 117
sreejith v s Avatar answered Sep 27 '22 22:09

sreejith v s