0

I'm trying to use largeheap: true in the AndroidManifest file, and I found this answer Enable android:largeHeap in Android 4, and disable it in Android 2.3

but the problem is I always get the errors

/*/android/app/build/intermediates/manifests/full/debug/AndroidManifest.xml:38:28-41: AAPT: No resource found that matches the given name (at 'largeHeap' with value '@values/bools').

/*/android/app/build/intermediates/manifests/full/debug/AndroidManifest.xml:32: error: Error: No resource found that matches the given name (at 'largeHeap' with value '@values/bools').

I created 2 files bools.xml first one in */android/app/src/main/res/values/bools.xml with value <bool name="largeheap">true</bool> and the 2nd one in */android/app/src/main/res/values-v23/bools.xml with value <bool name="largeheap">false</bool> (for api 23 and above)

not sure what I am missing, why the AndroidManifest won't find the resource to match the line android:largeHeap="@bool/largeheap"

is there anything else I need to do beside the android:largeHeap="@bool/largeheap" in the AndroidManifest file ?

thanks.

greW
  • 1,248
  • 3
  • 24
  • 49

1 Answers1

2

According to your error, I can see that android complains about @values/bools and your question is showing another line: android:largeHeap="@bool/largeheap".

I created a new app project and reproduced your case. This worked for me:

Use this in AndroidManifest.xml:

android:largeHeap="@bool/largeheap"

And make sure your bools.xml looks like this:

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

Also try to clean and rebuild your project after that.

gi097
  • 7,313
  • 3
  • 27
  • 49