2

错误日志:

E/art(1564): Throwing OutOfMemoryError "Failed to allocate a 14908018 byte allocation with 10763166 free bytes and 10MB until OOM"    
E/AndroidRuntime(1564): Error reporting crash    
E/AndroidRuntime(1564): java.lang.OutOfMemoryError: Failed to allocate a 14908018 byte allocation with 10763166 free bytes and 10MB until OOM    
E/AndroidRuntime(1564):     at java.lang.AbstractStringBuilder.enlargeBuffer(AbstractStringBuilder.java:95)    
E/AndroidRuntime(1564):     at java.lang.AbstractStringBuilder.append0(AbstractStringBuilder.java:125)    
E/AndroidRuntime(1564):     at java.lang.StringBuffer.append(StringBuffer.java:278)    
E/AndroidRuntime(1564):     at java.io.StringWriter.write(StringWriter.java:123)    
E/AndroidRuntime(1564):     at com.android.internal.util.FastPrintWriter.flushLocked(FastPrintWriter.java:358)    
E/AndroidRuntime(1564):     at com.android.internal.util.FastPrintWriter.appendLocked(FastPrintWriter.java:303)    
E/AndroidRuntime(1564):     at com.android.internal.util.FastPrintWriter.write(FastPrintWriter.java:625)    
E/AndroidRuntime(1564):     at com.android.internal.util.FastPrintWriter.append(FastPrintWriter.java:658)    
E/AndroidRuntime(1564):     at java.io.PrintWriter.append(PrintWriter.java:691)    
E/AndroidRuntime(1564):     at java.io.PrintWriter.append(PrintWriter.java:31)    
E/AndroidRuntime(1564):     at java.lang.Throwable.printStackTrace(Throwable.java:324)    
E/AndroidRuntime(1564):     at java.lang.Throwable.printStackTrace(Throwable.java:300)    
E/AndroidRuntime(1564):     at android.util.Log.getStackTraceString(Log.java:335)    
E/AndroidRuntime(1564):     at com.android.internal.os.RuntimeInit.Clog_e(RuntimeInit.java:59)    
E/AndroidRuntime(1564):     at com.android.internal.os.RuntimeInit.access$200(RuntimeInit.java:43)    
E/AndroidRuntime(1564):     at com.android.internal.os.RuntimeInit$UncaughtHandler.uncaughtException(RuntimeInit.java:85)    
E/AndroidRuntime(1564):     at java.lang.ThreadGroup.uncaughtException(ThreadGroup.java:693)    
E/AndroidRuntime(1564):     at java.lang.ThreadGroup.uncaughtException(ThreadGroup.java:690)    
E/NMGDevice(1619): Exception:Attempt to invoke virtual method 'java.lang.String java.lang.String.trim()' on a null object reference

我找不到有关此问题的更多信息。只有我知道当我加载图像时会崩溃。我的应用在其他版本上还可以,但在 5.0. 我猜是 ART 和 Dalvik,还是关于“NMGDevice”类的东西?

为什么程序在 Android 5 上崩溃?

4

1 回答 1

1

由此,您的内存不足:

 E/AndroidRuntime(1564): java.lang.OutOfMemoryError: Failed to allocate a 14908018 byte allocation with 10763166 free bytes and 10MB until OOM 

然后,您尝试访问null您返回的参考:

E/NMGDevice(1619): Exception:Attempt to invoke virtual method 'java.lang.String java.lang.String.trim()' on a null object reference

验证您的返回值。停止吞咽异常。

于 2014-12-08T07:19:48.820 回答