Closed brianbolze closed 3 years ago
We were finally able to track down the issue and resolve this with the following addition to the proguard-rules.pro
file:
-keep class koma.** { *; }
We were able to find that since the Matrix factory classes are inflated in koma
sources using reflection, proguard considered them as unused and simply deleted them from the release build.
Note: If you see this and make this fix, don't forget to Clean Project before running.
Context We have an Android app built in Kotlin and we've split our algorithms layer into a separate Android Project. We import that as a dependency using Gradle using the following code:
In
build.gradle
:This algos-android project has koma as its own dependency defined in the
algos-android
project'sbuild.gradle
file as follows:Issue This works completely fine when running the app in a
debug
mode (defined inbuildTypes
in thebuild.gradle
). However, when running inrelease
mode, we are seeing an error at runtime when our algorithms layer tries to use koma. Specifically, when trying to create Double Matrices.The following error shows up in the console:
java.lang.IllegalStateException: No double matrix factories available. (Did you forget to import a koma-core implementation?)
Has anyone run into issues like this before? We're stuck!!
Things We've Tried Moving all of the files from our
algos-android
project directly into the main project and importingkoma
directly in the main project'sgradle.build
file. Didn't work.Environment