0

I have developed an android application using the graphhopper routing library. The library works fine in debug mode or in app-debug.apk but when I create a release apk of the app the library wont work. It is giving me java.lang.IllegalStateException: No input stream found in class path!? exception upon execution of the following code.

/*
*Constants.ROUTE_FILE_PATH = Environment.getExternalStorageDirectory().getPath()+"/.myappfolder/routes";
*/
 File routingFiles = new File(Constants.ROUTE_FILE_PATH);
 GraphHopper tmpHopp = new GraphHopper().forMobile();
 tmpHopp.load(routingFiles.getAbsolutePath());

While creating the release apk i got some warning for the graphhopper library and removed the warnings using

-dontwarn com.graphhopper.**

in the proguard-rules.pro file.

Is there any issue with creating a release apk of the graphhopper project? Why wont the library work in release version of the apk?

Yogesh
  • 444
  • 4
  • 12

1 Answers1

0

Ok so I have found 2 answers to the issue.

Firstly, you can set

minifyEnabled false 

in build.gradle. This works as a solution too but your app wont get minified.

Secondly according to the answer posted here you can set

-keep class com.graphhopper.** { *; }

in the proguard-rules.pro.

So whichever answer suits you best.

Yogesh
  • 444
  • 4
  • 12