Open pmackinney opened 3 years ago
Galaxy S7 (Android 8) and Galaxy Tab 2 (Android 7) - same crash on launch (Beta 3 and 4)
Pixel 3a (Android 11) - launches successfully.
Galaxy S6 (Android 7) has the same crash. Here's a logcat dump:
01-28 17:56:02.202 9986 9986 E AndroidRuntime: Process: net.mackinney.lepton, PID: 9986
01-28 17:56:02.202 9986 9986 E AndroidRuntime: java.lang.RuntimeException: Unable to start activity ComponentInfo{net.mackinney.lepton/net.mackinney.lepton.MainActivity}: android.view.InflateException: Binary XML file line #160: Binary XML file line #160: Error inflating class net.mackinney.lepton.BoardView
01-28 17:56:02.202 9986 9986 E AndroidRuntime: at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2927)
01-28 17:56:02.202 9986 9986 E AndroidRuntime: at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2988)
01-28 17:56:02.202 9986 9986 E AndroidRuntime: at android.app.ActivityThread.-wrap14(ActivityThread.java)
01-28 17:56:02.202 9986 9986 E AndroidRuntime: at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1631)
01-28 17:56:02.202 9986 9986 E AndroidRuntime: at android.os.Handler.dispatchMessage(Handler.java:102)
01-28 17:56:02.202 9986 9986 E AndroidRuntime: at android.os.Looper.loop(Looper.java:154)
01-28 17:56:02.202 9986 9986 E AndroidRuntime: at android.app.ActivityThread.main(ActivityThread.java:6682)
01-28 17:56:02.202 9986 9986 E AndroidRuntime: at java.lang.reflect.Method.invoke(Native Method)
01-28 17:56:02.202 9986 9986 E AndroidRuntime: at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1520)
01-28 17:56:02.202 9986 9986 E AndroidRuntime: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1410)
01-28 17:56:02.202 9986 9986 E AndroidRuntime: Caused by: android.view.InflateException: Binary XML file line #160: Binary XML file line #160: Error inflating class net.mackinney.lepton.BoardView
01-28 17:56:02.202 9986 9986 E AndroidRuntime: Caused by: android.view.InflateException: Binary XML file line #160: Error inflating class net.mackinney.lepton.BoardView
01-28 17:56:02.202 9986 9986 E AndroidRuntime: Caused by: java.lang.reflect.InvocationTargetException
01-28 17:56:02.202 9986 9986 E AndroidRuntime: at java.lang.reflect.Constructor.newInstance0(Native Method)
01-28 17:56:02.202 9986 9986 E AndroidRuntime: at java.lang.reflect.Constructor.newInstance(Constructor.java:430)
01-28 17:56:02.202 9986 9986 E AndroidRuntime: at android.view.LayoutInflater.createView(LayoutInflater.java:652)
01-28 17:56:02.202 9986 9986 E AndroidRuntime: at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:794)
01-28 17:56:02.202 9986 9986 E AndroidRuntime: at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:734)
01-28 17:56:02.202 9986 9986 E AndroidRuntime: at android.view.LayoutInflater.rInflate(LayoutInflater.java:865)
01-28 17:56:02.202 9986 9986 E AndroidRuntime: at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:828)
01-28 17:56:02.202 9986 9986 E AndroidRuntime: at android.view.LayoutInflater.inflate(LayoutInflater.java:525)
01-28 17:56:02.202 9986 9986 E AndroidRuntime: at android.view.LayoutInflater.inflate(LayoutInflater.java:427)
01-28 17:56:02.202 9986 9986 E AndroidRuntime: at android.view.LayoutInflater.inflate(LayoutInflater.java:378)
01-28 17:56:02.202 9986 9986 E AndroidRuntime: at androidx.appcompat.app.AppCompatDelegateImpl.setContentView(AppCompatDelegateImpl.java:696)
01-28 17:56:02.202 9986 9986 E AndroidRuntime: at androidx.appcompat.app.AppCompatActivity.setContentView(AppCompatActivity.java:170)
01-28 17:56:02.202 9986 9986 E AndroidRuntime: at net.mackinney.lepton.MainActivity.onCreate(MainActivity.java:43)
01-28 17:56:02.202 9986 9986 E AndroidRuntime: at android.app.Activity.performCreate(Activity.java:6942)
01-28 17:56:02.202 9986 9986 E AndroidRuntime: at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1126)
01-28 17:56:02.202 9986 9986 E AndroidRuntime: at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2880)
01-28 17:56:02.202 9986 9986 E AndroidRuntime: at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2988)
01-28 17:56:02.202 9986 9986 E AndroidRuntime: at android.app.ActivityThread.-wrap14(ActivityThread.java)
01-28 17:56:02.202 9986 9986 E AndroidRuntime: at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1631)
01-28 17:56:02.202 9986 9986 E AndroidRuntime: at android.os.Handler.dispatchMessage(Handler.java:102)
01-28 17:56:02.202 9986 9986 E AndroidRuntime: at android.os.Looper.loop(Looper.java:154)
01-28 17:56:02.202 9986 9986 E AndroidRuntime: at android.app.ActivityThread.main(ActivityThread.java:6682)
01-28 17:56:02.202 9986 9986 E AndroidRuntime: at java.lang.reflect.Method.invoke(Native Method)
01-28 17:56:02.202 9986 9986 E AndroidRuntime: at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1520)
01-28 17:56:02.202 9986 9986 E AndroidRuntime: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1410)
01-28 17:56:02.202 9986 9986 E AndroidRuntime: Caused by: java.lang.OutOfMemoryError: Failed to allocate a 222593292 byte allocation with 16777216 free bytes and 34MB until OOM
01-28 17:56:02.202 9986 9986 E AndroidRuntime: at dalvik.system.VMRuntime.newNonMovableArray(Native Method)
01-28 17:56:02.202 9986 9986 E AndroidRuntime: at android.graphics.BitmapFactory.nativeDecodeAsset(Native Method)
01-28 17:56:02.202 9986 9986 E AndroidRuntime: at android.graphics.BitmapFactory.decodeStream(BitmapFactory.java:700)
01-28 17:56:02.202 9986 9986 E AndroidRuntime: at android.graphics.BitmapFactory.decodeResourceStream(BitmapFactory.java:535)
01-28 17:56:02.202 9986 9986 E AndroidRuntime: at android.graphics.BitmapFactory.decodeResource(BitmapFactory.java:558)
01-28 17:56:02.202 9986 9986 E AndroidRuntime: at android.graphics.BitmapFactory.decodeResource(BitmapFactory.java:588)
01-28 17:56:02.202 9986 9986 E AndroidRuntime: at net.mackinney.lepton.BoardView.<init>(BoardView.java:29)
01-28 17:56:02.202 9986 9986 E AndroidRuntime: ... 25 more
My phone has 3 GB of memory (according to GSM arena). It says that the app requests 220 MB or memory but can only get 16 MB.
This appears to happen when decoding the first bitmap resource in the BoardView class https://github.com/pmackinney/LeptonBackgammon/blob/63577f2be2a4d1ab295ee4d20e91729a87f5b5b0/app/src/main/java/net/mackinney/lepton/BoardView.java#L29
LeptonBackgammon b3 Nexus 7 Android 6.0.1
The first time I tried running it on my Nexus 7 running Android 6.0.1, I saw "Unfortunately, Lepton has stopped."