Android OutOfMemoryError: Failed to allocate a 18006 byte allocation with 6304 free bytes and 6KB

使用Okhttp框架网络请求时出现了 java.lang.OutOfMemoryError: Failed to allocate a 18006 byte allocation with 6304 free bytes and 6KB until OOM,可以在application中加上如下代码,完美解决:

        android:largeHeap="true"
        android:hardwareAccelerated="false"

你可能感兴趣的:(Android基础,android,java,apache)