1

I am using Android studio. Even the simplest of apps that I make fail to run on Android versions below 10 (Android Q). I have two virtual devices. One virtual device that has API 29 runs everything nicely. The other one with API 26 (Android 8.0). My apps also fail to run on my LG G6 that runs Android 8.0. I don't possess an Android Q device to test the app outside the emulator on that version. When I open Logcat after the app crash on Android 8.0 virt. device I get a ridiculous amount of errors tracing back to some Java files like View, ViewGroup, ImageView, BitmapDrawable, etc. At this point, the app I'm trying to run is a mere image with a black background and a text field.

xml errors kotlin

I did choose API 15 as the minimum API, which is like freakin' Android 4.0.3 or something... The app should be able to at least run on versions above that.

Michiel Leegwater
  • 1,172
  • 4
  • 11
  • 27
Monolith
  • 11
  • 5
  • Are you using AndroidX and latest buildTools version? – Narek Hayrapetyan Oct 10 '19 at 14:20
  • 1
    Hello Monolith, welcome to SO! Unlike your name, Android apps are not monolithic (or don't have to), so you're going to need to provide _the ridiculous amount of errors_ or at the very least, post your source code/failing project somehwere. Without any of these pieces, we know *less* than you about your problem... please, follow SO rules and [provide a minimum reproducible example](https://stackoverflow.com/help/minimal-reproducible-example) and we'll be glad to help :) – Martin Marconcini Oct 10 '19 at 14:57
  • 1
    First of all, thank you for your attention. I attached a screenshot to my post, as the text mechanism asks me to indent my code. I don't know why and I don't know-how. On the screen, you can also see the design. I haven't added anything to mainactivity.kt yet. – Monolith Oct 10 '19 at 15:15
  • https://pastebin.com/wieUj6UH (MainActivity.kt code) – Monolith Oct 10 '19 at 15:33
  • https://pastebin.com/dFNWxWKn (xml code) – Monolith Oct 10 '19 at 15:33
  • It seems the image dlabgold is too big. Try to compress/reduce its size – guipivoto Oct 10 '19 at 15:45
  • You are quite right. Thank you very much. THIS seems to be the real issue, as without the image the app runs just fine. How's android 10 still able to display it, though? – Monolith Oct 10 '19 at 16:18
  • I compressed the file and the app still crashes. – Monolith Oct 10 '19 at 16:25

1 Answers1

0

Probably the image you're showing is too big, and resizing it will fix your problem. Which size is it (physical size, not filesize) and in which folder is it? The issue can be the same as Android Studio Canvas: drawing too large bitmap

Arne517
  • 825
  • 2
  • 8
  • 14
  • A 3000x3000 png image called dlabgold.png was the culprit. Everything works more than fine without it. Do you happen to know what size is the maximum for android apps? Thank you in advance. – Monolith Oct 11 '19 at 15:21