2

I was using the AndDown library (using the artifact from Gradle) for Markdown in Android for formatting. Yesterday, I included the latest version of play services from Google,

com.google.gms:google-services:1.5.0-beta2

After including this library, I get a weird error:

An exception occurred during request network execution :dalvik.system.PathClassLoader[DexPathList[[zip file "/data/app/com.example.app.debug-1/base.apk"],nativeLibraryDirectories=[/data/app/com.example.app.debug-1/lib/arm, /vendor/lib, /system/lib]]] couldn't find "libanddown.so"
dalvik.system.PathClassLoader[DexPathList[[zip file "/data/app/com.com.example.app.debug-1.debug-1/base.apk"],nativeLibraryDirectories=[/data/app/com.example.app.debug-1/lib/arm, /vendor/lib, /system/lib]]] couldn't find "libanddown.so"

Is there something missing in the latest AndDown library?

Remi Guan
  • 21,506
  • 17
  • 64
  • 87
user3747512
  • 203
  • 1
  • 6
  • 15
  • If you remove the Play Services dependency, does it build? If you create a scrap project that references AndDown, does it build? The demo project builds for me (`debug` uses a local copy of the library; `release` uses the artifact). – CommonsWare Nov 16 '15 at 12:13
  • I get a similar exception (listed at the bottom) when changing from Android gradle plugin 1.4.0-beta6 to 1.5.0-beta1. The markdown library worked great using 1.4.0-beta6! java.lang.UnsatisfiedLinkError: dalvik.system.PathClassLoader[DexPathList[[zip file "/data/app/com.example.android-1/base.apk"],nativeLibraryDirectories=[/vendor/lib, /system/lib]]] couldn't find "libanddown.so" – developer_7 Nov 16 '15 at 15:15
  • If I remove the play services or downgrade the library to a lower one (gcm:8.1.0; google-services:1.4.0-beta3), it works fine, the problem with the lower version is that there is a problem with the plugin which doesn't generate debug builds, upgrading to the newer version(gcm:8.3.0;google-services:1.5.0-beta2) fixes the debug build issue; but now causes this libanddown issue. Strange, Should I take this up with google.. – user3747512 Nov 17 '15 at 04:18
  • And answer to the previous question: yes this happens in the release build as well: I get the same exception java.lang.UnsatisfiedLinkError: dalvik.system.PathClassLoader[DexPathList[[zip file "/data/app/com.example.app-1/base.apk"],nativeLibraryDirectories=[/data/app/com.philips.moonshot-1/lib/arm, /vendor/lib, /system/lib]]] couldn't find "libanddown.so" – user3747512 Nov 17 '15 at 04:56

2 Answers2

2

There is some bug with that Gradle plugin that is interfering with native libraries, at least those coming from AARs. It is not unique to AndDown, as I get the same results with SQLCipher for Android. You will need to take this up with Google and whoever maintains that plugin.

CommonsWare
  • 986,068
  • 189
  • 2,389
  • 2,491
  • Is this something that Google has to address? – user3747512 Nov 17 '15 at 04:19
  • @user3747512: Since I was able to reproduce the problem with somebody else's AAR that contains native libraries, it is not a problem with my AAR that contains native libraries. Hence, it is not something that *I* can address, since it is not a problem with my project. Whether you choose to try to work with Google to fix the problem with their plugin, or whether you just stop using the plugin (or roll back to some earlier version that does not exhibit the problem, per your comment on the question), is up to you. – CommonsWare Nov 17 '15 at 11:31
  • Just updated the Android gradle plugin to com.android.tools.build:gradle:1.5.0 and am no longer seeing a crash when trying to use the library. – developer_7 Nov 18 '15 at 14:19
  • Also, you can view all versions of the plugin at https://bintray.com/android/android-tools/com.android.tools.build.gradle/view – developer_7 Nov 18 '15 at 14:20
0

For what it's worth, I had this error today and changing:

compile 'com.commonsware.cwac:anddown:0.2.0

to:

compile 'com.commonsware.cwac:anddown:0.2.4

in the build.gradle file resolved this issue for me. You could also try:

compile 'com.commonsware.cwac:anddown:0.2.+

though it is generally good to specify specific versions. So, for me, updating to the latest version of AndDown resolved the issue, though as mentioned above you could also potentially contact Google or use a lower version of the conflicting gradle or Google plugin/library could also be a solution if you are okay with a lower version of one of those.

David M
  • 1,151
  • 12
  • 21