Closed Marvin182 closed 11 years ago
proguardOptions += "-keep class net.sourceforge.zbar.** { *; }"
to your settings, then clean and rebuild?show unmanaged-jars
SBT command? Can you run (in a terminal) dexdump target/classes-*.dex | grep "Class descr"
and tell me if you see any of ZBar's classes?Does proguard have anything to do with the native libraries? We have special handling for dependencies which are native libraries (only) but I'm not sure that the native libraries get copied if they are simply inside a JAR file.
[info] ArrayBuffer(Attributed(C:\Users\Marvin\Dropbox\workspace\TicketChecker\lib\zbar.jar), Attributed(C:\Portables\and roid-sdk\sdk\platforms\android-16\android.jar), Attributed(C:\Portables\android-sdk\sdk\platforms\android-16\android.jar ), Attributed(C:\Portables\android-sdk\sdk\platforms\android-16\android.jar))
I uploaded the project to https://github.com/Marvin182/TicketChecker
@appamatto, I don't think native libraries inside JARs are included either, but I could be wrong, I have never tested that a lot.
@Marvin182 : Actually, just put the .so files inside ./src/main/libs
(so you'll have ./src/main/libs/armeabi/...
and so on). The JARs stay inside ./lib/
, and it works for me. It was probably done that way to be able to use the NDK more easily, but... that shouldn't be so hard for simple projects like yours. I'll look into it!
wtf -.-
I spend hours on searching for a solution, but it was never mentioned that the libs should be in src/main/libs ...
Thank you! :)
Took me a while to guess as well.
For the record, when I tried running show native<TAB>
after a while, it showed me a list of exactly one potential candidate setting, and then it didn't take me long to guess that natives-lib-path
was where SBT looked for .so files... Could be handy next time you have an issue like that!
Anyway, this sucks, I think I'll try to change that to be the same as the JARs, plus it makes no sense (besides catering to old-style Ant Android projects) to put libs
inside src/main
, as I don't see any source in .so files!
I tried building an Android app using the ZBar Android SDK, but failed with sbt (elipse works just fine), because they use native libraries which are not copied to the apk. I believe that proguard removes a little bit to much in my case, but I couldn't figure out how to tell it, that it should keep and include the library files.
@fxthomas: I also tried your testing branch, but it didn't work out much better. With compile I got a dex file which was big enough to have the 3 native libraries included, but the android app crashed anyway.