libzbarjni.so 具有文本重定位功能.这会浪费内存并防止安全强化



在我的条形码扫描仪应用程序中,使用 zbar lib 扫描条形码。它将运行时异常作为内存不足错误。

任何人都可以帮助解决此问题。

日志猫:

2-16 13:06:01.635: W/linker(15501): libzbarjni.so has text relocations. This is wasting memory and prevents security hardening. Please fix.
12-16 13:06:06.483: E/art(15501): Throwing OutOfMemoryError "Failed to allocate a 53654136 byte allocation with 16777216 free bytes and 47MB until OOM"
12-16 13:06:06.483: E/AndroidRuntime(15501): Error reporting crash
12-16 13:06:06.483: E/AndroidRuntime(15501): java.lang.OutOfMemoryError: Failed to allocate a 53654136 byte allocation with 16777216 free bytes and 47MB until OOM
12-16 13:06:06.483: E/AndroidRuntime(15501):     at java.lang.AbstractStringBuilder.enlargeBuffer(AbstractStringBuilder.java:95)
12-16 13:06:06.483: E/AndroidRuntime(15501):    at java.lang.AbstractStringBuilder.append0(AbstractStringBuilder.java:125)
12-16 13:06:06.483: E/AndroidRuntime(15501):    at java.lang.StringBuffer.append(StringBuffer.java:278)
12-16 13:06:06.483: E/AndroidRuntime(15501):    at java.io.StringWriter.write(StringWriter.java:123)
12-16 13:06:06.483: E/AndroidRuntime(15501):    at com.android.internal.util.FastPrintWriter.flushLocked(FastPrintWriter.java:358)
12-16 13:06:06.483: E/AndroidRuntime(15501):    at com.android.internal.util.FastPrintWriter.appendLocked(FastPrintWriter.java:303)
12-16 13:06:06.483: E/AndroidRuntime(15501):    at com.android.internal.util.FastPrintWriter.write(FastPrintWriter.java:625)
12-16 13:06:06.483: E/AndroidRuntime(15501):    at com.android.internal.util.FastPrintWriter.append(FastPrintWriter.java:658)
12-16 13:06:06.483: E/AndroidRuntime(15501):    at java.io.PrintWriter.append(PrintWriter.java:691)
12-16 13:06:06.483: E/AndroidRuntime(15501):    at java.io.PrintWriter.append(PrintWriter.java:31)
12-16 13:06:06.483: E/AndroidRuntime(15501):    at java.lang.Throwable.printStackTrace(Throwable.java:324)
12-16 13:06:06.483: E/AndroidRuntime(15501):    at java.lang.Throwable.printStackTrace(Throwable.java:300)
12-16 13:06:06.483: E/AndroidRuntime(15501):    at android.util.Log.getStackTraceString(Log.java:335)
12-16 13:06:06.483: E/AndroidRuntime(15501):    at com.android.internal.os.RuntimeInit.Clog_e(RuntimeInit.java:59)
12-16 13:06:06.483: E/AndroidRuntime(15501):    at com.android.internal.os.RuntimeInit.access$200(RuntimeInit.java:43)
12-16 13:06:06.483: E/AndroidRuntime(15501):    at com.android.internal.os.RuntimeInit$UncaughtHandler.uncaughtException(RuntimeInit.java:85)
12-16 13:06:06.483: E/AndroidRuntime(15501):    at java.lang.ThreadGroup.uncaughtException(ThreadGroup.java:693)
12-16 13:06:06.483: E/AndroidRuntime(15501):    at java.lang.ThreadGroup.uncaughtException(ThreadGroup.java:690)

由于内存问题,我在某些设备上收到此错误。我通过在工作区中导入 zbar 整个 lib 代码并使用 zbar lib 应用程序作为工作区中的 lib 而不是在我自己的应用程序中添加/保留 lib(.jar) 来解决这个问题。

相关内容

  • 没有找到相关文章

最新更新