0

My app is showing this error on logCat:

java.lang.OutOfMemoryError: 

  at java.lang.AbstractStringBuilder.enlargeBuffer (AbstractStringBuilder.java:95)

  at java.lang.AbstractStringBuilder.append0 (AbstractStringBuilder.java:146)

  at java.lang.StringBuilder.append (StringBuilder.java:216)

  at org.chromium.content_public.browser.LoadUrlParams.buildDataUri (LoadUrlParams.java:27)

  at org.chromium.content_public.browser.LoadUrlParams.createLoadDataParamsWithBaseUrl (LoadUrlParams.java:35)

  at org.chromium.android_webview.AwContents.loadDataWithBaseURL (AwContents.java:431)

  at com.android.webview.chromium.WebViewChromium.loadDataWithBaseURL (WebViewChromium.java:188)

  at android.webkit.WebView.loadDataWithBaseURL (WebView.java:960)

  at com.google.android.gms.ads.internal.webview.p.loadDataWithBaseURL (:com.google.android.gms.DynamiteModulesA:132)

  at com.google.android.gms.ads.internal.webview.o.loadDataWithBaseURL (:com.google.android.gms.DynamiteModulesA:103)

  at com.google.android.gms.ads.internal.renderer.i.a (:com.google.android.gms.DynamiteModulesA:8)

  at com.google.android.gms.ads.internal.renderer.a.c (:com.google.android.gms.DynamiteModulesA:35)

  at com.google.android.gms.ads.internal.renderer.g.a (:com.google.android.gms.DynamiteModulesA:11)

  at com.google.android.gms.ads.internal.k.run (:com.google.android.gms.DynamiteModulesA:28)

  at android.os.Handler.handleCallback (Handler.java:739)

  at android.os.Handler.dispatchMessage (Handler.java:95)

  at android.os.Looper.loop (Looper.java:145)

  at android.app.ActivityThread.main (ActivityThread.java:6939)

  at java.lang.reflect.Method.invoke (Native Method)

  at java.lang.reflect.Method.invoke (Method.java:372)

  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run (ZygoteInit.java:1404)

  at com.android.internal.os.ZygoteInit.main (ZygoteInit.java:1199)

and I have no idea where is coming from, 'cause this error type normally came from images, but I know that don't. And it says something about stringBuilder and I really use a StringBuilder to create a string that will be stored on sharedPreferences, this string is a kind of array, then I use a lot the .append() to put each position and a separator commom. Like this

sb.append("5").append("/"); ...

then the final result is some like this:

5/3/7/27/10

Anyone can tell me whats happen?

Thx

11
  • we need some code to work with Commented Jul 30, 2017 at 15:06
  • Keep going down the stack trace until you see something from your code. (Everything you posted is from Android, Google, Java, etc.) That line of code will be where the problem starts. Commented Jul 30, 2017 at 17:24
  • @Gary99 The problem is I don't have more stack trace to going down... I caught this error on Google Play report and there says only this. But how I work with stringBuilder to create a string array and store it on sharedPreferences I assumed that this can be the error... But I don't have any sure. My doubt is the stringBuilder can cause this error type? I used to see this error just on images... Commented Aug 2, 2017 at 13:08
  • I see. The error happens after AbstractStringBuilder.enlargeBuffer. I couldn't find docs for this but I know in some other cases with dynamically allocated memory, the size is doubled when more is needed. You may only be needing a little more than half of the available memory but still get this error. Have you looked up the specs for the device (or is this happening on multiple devices)? Maybe it only happens on low end devices with small memory. It's happening when you're building a uri/url. Any chance the length of this is really going crazy? Commented Aug 2, 2017 at 13:38
  • @Gary99 I'm new on this, and my native language is not english, so this make Google Play console be a little confusing to me. I don't think so length is going crazy, 'cause is a simple string array, it can have from 0 to 30 itens, no more (some like this: 3/5/4/7... for example), and each time that I write this array on sharedPreferences the old one is overwritten, by (see continuation below) Commented Aug 4, 2017 at 14:50

1 Answer 1

0

The bug originates from google Admob.

specifically

com.google.android.gms.ads.internal.webview.p.loadDataWithBaseURL(...)
...
com.google.android.gms.ads.internal.k.run(...)

I assume that the issue is that it generates erroneously a very long string of url (to load an ad as a webview) in some devices sometimes and crash the app

Although admob says that the fault resides in the user implementation and not the SDK https://groups.google.com/forum/#!topic/google-admob-ads-sdk/xtnAcmnPYFI

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.