...">

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

I have the following bool.xmlfile:

<?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 am using Android Studio 2.2.3

+4
source share
1 answer

The code looks great. This is a problem with Android 2.x studio. Fixed in 2.3. Please contact here . If you still need to do this using 2.3 canary instead get 2.3 canary

+4
source

Source: https://habr.com/ru/post/1671151/


All Articles