You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by GitBox <gi...@apache.org> on 2018/11/06 16:44:31 UTC

[GitHub] brodybits opened a new issue #902: Using Android NDK libraries in plugins

brodybits opened a new issue #902: Using Android NDK libraries in plugins
URL: https://github.com/apache/cordova-docs/issues/902
 
 
   As discussed in <https://github.com/dpa99c/cordova-plugin-hello-c/issues/8> ([[1]](https://github.com/dpa99c/cordova-plugin-hello-c/issues/8)) and <https://github.com/litehelpers/Cordova-sqlite-storage/issues/729> ([[2]](https://github.com/litehelpers/Cordova-sqlite-storage/issues/729)) the change in the project directory structure caused issues with plugins using Android NDK libraries (with JNI).
   
   I can think of the following alternative solutions, from least-recommended to most-recommended:
   - Use new destination directory structure in `plugin.xml`, as done in <https://github.com/dpa99c/cordova-plugin-hello-c/commit/b5f4d9c3085dd0c70a3d0a6fd84f39adb17a7ecd> ([[3]](https://github.com/dpa99c/cordova-plugin-hello-c/commit/b5f4d9c3085dd0c70a3d0a6fd84f39adb17a7ecd)) (downside is that this solution will not work on cordova-android@6, consequentially not supporting Android pre-4.4)
   - Bundle the NDK objects in a JAR and use `lib-file` tags in `config.xml` to add the JAR dependencies on Android, as described in <https://github.com/litehelpers/Cordova-sqlite-storage/issues/729#issuecomment-355194460> ([[4]](https://github.com/litehelpers/Cordova-sqlite-storage/issues/729#issuecomment-355194460)) and [[5]](https://stackoverflow.com/questions/34115571/add-external-jar-library-to-build-cordova-plugin-ionic-framework/34129929#34129929). This solution would work on both cordova-android@6 and cordova-android@7.
   - Use AAR from Maven as described in <https://stackoverflow.com/questions/34115571/add-external-jar-library-to-build-cordova-plugin-ionic-framework/34129929#34129929> ([[5]](https://stackoverflow.com/questions/34115571/add-external-jar-library-to-build-cordova-plugin-ionic-framework/34129929#34129929)), like I did in <https://github.com/brodybits/cordova-sqlcipher-adapter/commit/05a9166eb691faca9eeb135a8acdd748bd4df331> ([[6]](https://github.com/brodybits/cordova-sqlcipher-adapter/commit/05a9166eb691faca9eeb135a8acdd748bd4df331))
   
   [1] <https://github.com/dpa99c/cordova-plugin-hello-c/issues/8>
   [2] <https://github.com/litehelpers/Cordova-sqlite-storage/issues/729>
   [3] <https://github.com/dpa99c/cordova-plugin-hello-c/commit/b5f4d9c3085dd0c70a3d0a6fd84f39adb17a7ecd>
   [4] <https://github.com/litehelpers/Cordova-sqlite-storage/issues/729#issuecomment-355194460>
   [5] <https://stackoverflow.com/questions/34115571/add-external-jar-library-to-build-cordova-plugin-ionic-framework/34129929#34129929>
   [6] <https://github.com/brodybits/cordova-sqlcipher-adapter/commit/05a9166eb691faca9eeb135a8acdd748bd4df331>

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org