Closed fribeau closed 11 months ago
Android does not provide the java.awt. packages and also actively refuses if you try to add such classes, this means any part of Apache POI which uses java.awt. stuff will currently fail this way.
I did some workaround with shading for java.awt.Color before, you can try to do the same for Dimension, see https://github.com/centic9/poi-on-android/blob/master/poishadow/build.gradle#L39 and https://github.com/centic9/poi-on-android/tree/master/poishadow/src/main/java/org/apache/poi/java/awt
Here is an example how I added some java.awt classes for my personal use: https://github.com/LePat/poi-on-android/commit/d38372bd33860088c533f0838ee8830b3a945859
It can be done for any java.awt classes, I just needed to get cell size depending on text size (Rectagle2D.getWidth with comment in french...).
Changes in #110 added some more classes from java.awt. This should now provide at least java.awt.Dimension and a few others.
Please consider sending PRs if you add other classes and think they "good enough" for including here.
I'm trying to insert an image xlsx but I end up with the following error:
This is my code (in Kotlin) :