Comments (6)
Hi,
The issue is caused by an Android <4.4 limitation. Android versions before Lollipop do not support vector graphics out of the box.
I tried to keep support for Android 4.4 but there are too many differences between that version and newer ones, so I'll drop support for it with next release unless somebody is willing to send patches.
I'll keep this issue open so I remember to raise the minimum Android version required to Lollipop.
from etchdroid.
Maybe avoid the vector graphics usage?
At least an "special build" for android 4.4 users, like me..
from etchdroid.
@c-sanchez Feel free to send a pull request. It should be quite doable with compatibility library (which I'm pretty sure are already used, I might not be doing it right in that particular screen).
I'm simply not interested in it because 1) I haven't had any device running KitKat for years 2) it's like 1% of the user base.
But if anybody sends good patches I'll sure merge them.
from etchdroid.
Relevant code is in this layout: https://github.com/EtchDroid/EtchDroid/blob/master/app/src/main/res/layout/activity_usb_drive_picker.xml
As you can see there's a TextView with an embedded graphic drawableTop
(which is vector and that doesn't work on Android <5).
You should be able to do something like this: https://github.com/Depau/POuLBITS-Android/blob/master/app/src/main/res/layout/activity_main.xml#L31
That is convert the standalone TextView to a ConstraintLayout (or another layout, whatever you prefer) containing an ImageView and a TextView without the image. In the ImageView you should be able to use the attribute app:srcCompat
instead of android:src
, which will be picked up by AndroidX vector compatibility libraries.
It will generate a non-vector version of the drawable that will be used instead of the vector version on older versions of Android.
Note that I enabled the Google Play Store option that automatically reduces the size of the APK when possible, so the non-vector image will only be downloaded by people using older versions of Android.
Anyway, beware that I might still think of dropping support for Android KitKat for some more reasons, namely:
- Android Storage Access Framework was introduced in that particular version (which is why I don't support earlier versions). It behaves a little bit differently than >4.4 so it might be a pain
- Notifications also work a bit differently. In fact IIRC I wasn't able to get the progress bar on Android 4.4 (relevant code [here](https://github.com/EtchDroid/EtchDroid/blob/master/app/src/main/java/eu/depau/etchdroid/services/UsbWriteService.kt#L44 and following lines). You may want to look into that too.
As I mentioned in my development update in my blog I will be able to finish later this summer the changes I started in February, currenty pending in the development
branch. If I find some way to test it on KitKat with my current hardware I definitely will keep an eye on it. But if I cannot find a way, I will have to rely on someone else or end up dropping support for it.
I would also like to implement instrumented integration tests which would be VERY helpful for problems like this. And that's going to suck because I have no idea how to emulate USB drives in a Travis CI-like environment. I'll keep you posted though.
from etchdroid.
Oh and, by the way, I'm quite sure that if you plug in the USB drive before starting the app, Android won't even try to render the drawable so it should not crash. That can be a nasty workaround for the time being lol
from etchdroid.
I eventually dropped support for Android 4.4 because of all this little issues and inconsistencies. 5.0 and up will only be supported, that is unless somebody steps in and helps me fix it. I'll close this issue for now.
from etchdroid.
Related Issues (20)
- [Bug] self-closure apk HOT 2
- No[Bug] Please fill in the title
- Support Windows ISOs HOT 1
- [Bug] ANR after choosing image from internal storage HOT 5
- [Bug] Please fill in the title HOT 2
- [Bug] Attempt to get length of null array HOT 2
- [Stupid text?]in TV Android4.4.4 run etchdroid HOT 2
- [Bug] it's stuck at 18%
- [Bug] Please fill in the title HOT 2
- https://github.com/EtchDroid/EtchDroid/issues/117#issue-797542390
- [Bug] Write failed at block 0, 0.0 B written. Error: java.io.IOException: MAX_RECOVERY_ATTEMPTS Exceeded while trying to transfer command to device, please reattach device and try again HOT 1
- [email protected]
- Support for writing Apple DMG removed HOT 1
- Unable to create ChromeOS installer HOT 4
- Tried Windows iso but Write failed. Just read that windows iso isn't supported so user error :-)
- Bug report HOT 4
- Attempt to invoke virtual method 'boolean java.lang.Class.isInterface()' on a null object reference
- [Improvement] Add some type of crash log collection system
- [QA, help appreciated!] Ensure the app displays correctly on many form factors
- Accidentally unplugged USB flash drive and I am unable to format it HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from etchdroid.