Large files crash on Android 13 not on 12.
AbidR-S2 opened this issue · comments
Selecting any type of large file (have tried mp4 and apk files) causes a crash right after selection.
This doesn't happen on Android 12 and lower.
Crash log is:
FATAL EXCEPTION: main Process: com.s2.riskwise.hybrid, PID: 8320 java.lang.OutOfMemoryError: Failed to allocate a 301989896 byte allocation with 25149440 free bytes and 266MB until OOM, target footprint 282076024, growth limit 536870912 at java.util.Arrays.copyOf(Arrays.java:3766) at java.lang.AbstractStringBuilder.ensureCapacityInternal(AbstractStringBuilder.java:125) at java.lang.AbstractStringBuilder.append(AbstractStringBuilder.java:650) at java.lang.StringBuilder.append(StringBuilder.java:203) at org.json.JSONStringer.string(JSONStringer.java:354) at org.json.JSONStringer.value(JSONStringer.java:261) at org.json.JSONObject.writeTo(JSONObject.java:734) at org.json.JSONObject.toString(JSONObject.java:702) at com.cyph.cordova.Chooser.onActivityResult(Chooser.java:138) at org.apache.cordova.CordovaInterfaceImpl.onActivityResult(CordovaInterfaceImpl.java:160) at com.getcapacitor.Bridge.onActivityResult(Bridge.java:1025) at com.getcapacitor.BridgeActivity.onActivityResult(BridgeActivity.java:215) at android.app.Activity.dispatchActivityResult(Activity.java:8951) at android.app.ActivityThread.deliverResults(ActivityThread.java:5987) at android.app.ActivityThread.handleSendResult(ActivityThread.java:6033) at android.app.servertransaction.ActivityResultItem.execute(ActivityResultItem.java:67) at android.app.servertransaction.ActivityTransactionItem.execute(ActivityTransactionItem.java:45) at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:135) at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:95) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2574) at android.os.Handler.dispatchMessage(Handler.java:106) at android.os.Looper.loopOnce(Looper.java:226) at android.os.Looper.loop(Looper.java:313) at android.app.ActivityThread.main(ActivityThread.java:8757) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:571) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1067)
My Android manifest does have the android:largeHeap="true" addition.
Any updates on this.
I decided to use the awesome-cordova-plugins/chooser instead (v6.3.0) and that has been working fine for me with large file types.