I am developing an android app that executes some projection transformations.
Recently I face the following problem.
When I set on gradle script minifyEnabled true my apk may be build without any errors, but when I call
GeodeticCRS targetGCRS = (GeodeticCRS) cRSFactory.getCRS(epsgCode); I get the following error
Unable to access CRS file: epsg . And this is happening only when minifyEnabled true. So it seems there is a confusion with class names of CTS when obfuscation takes place. (check 1 and 2 stackoverflow links)
I ended up excluding org.cts from the process of obfuscation .
To do so you just need to add the following line in proguard file of the app.
-keep class org.cts.** { *; }
In my case I added the line above in proguard-rules.pro file which is configured to be used in my gradle script.
And inside my gradle script I do force my app to use this proguard file.
And here is the location of my proguard file
An finally the contents of the file
I dont expect any action, I just share my workaround for people facing the same problem.
Hi there,
I am developing an android app that executes some projection transformations. Recently I face the following problem. When I set on gradle script
minifyEnabled true
my apk may be build without any errors, but when I callGeodeticCRS targetGCRS = (GeodeticCRS) cRSFactory.getCRS(epsgCode);
I get the following errorUnable to access CRS file: epsg
. And this is happening only whenminifyEnabled true
. So it seems there is a confusion with class names of CTS when obfuscation takes place. (check 1 and 2 stackoverflow links) I ended up excluding org.cts from the process of obfuscation . To do so you just need to add the following line in proguard file of the app.-keep class org.cts.** { *; }
In my case I added the line above inproguard-rules.pro
file which is configured to be used in my gradle script.And inside my gradle script I do force my app to use this proguard file.
And here is the location of my proguard file
An finally the contents of the file
I dont expect any action, I just share my workaround for people facing the same problem.