-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Android maven resource won't build in Bazel #757
Comments
I released 0.3.33 with the fix. Please try and comment if needed. |
err, 0.3.34 actually |
That worked, awesome. Good work and thanks @nshmyrev Commit a5d788a solved this issue. For others who want to build Vosk Android with Bazel, the results of my work will be Open Sourced here: https://github.com/emexlabs/WearableIntelligenceSystem |
This has caused further errors. While the above solution DID allow vosk to begin building with Bazel, it created issues down the line. I found these further issues working in Bazel and recreated in the original In
To solve this, I comment out the
This will now Gradle syncs and builds. However it raises the following runtime error (after Gradle or Bazel builds):
|
If I unzip the built apk and search for *.so files, I see:
My architecture in Bazel is set for armeabi-v7a, and the Gradle system has abiFilters, so why are libjnidispatch.so artifacts only being packaged for desktop!? |
For anyone wondering... I did eventually solve this issue. The code will be made public here: https://github.com/emexlabs/WearableIntelligenceSystem and you can reach out to me (caydenpierce.com) if you need a hand. Thanks again @nshmyrev |
Problem
We are trying to use the android maven resource
com.alphacephei:vosk-android:0.3.32
within an Android application built by Bazel.The build is failing when
com.alphacephei:vosk-android:0.3.32
is listed as a dependency.Investigation
The error (below) has to do with
vosk-android
library not having access to thenet.java.dev.jna:jna
library during build.Bazel uses
rules_jvm_external
to handle maven resources, and this is implemented in our application. I believerules_jvm_external
uses the pom.xml of the Maven resource to determine if a dependency for that library is needed during build. During system build, whencom.alphacephei:vosk-android:0.3.32
is desugared in Bazel,net.java.dev.jna:jna
library is not made available to it, becausenet.java.dev.jna:jna
is not incom.alphacephei:vosk-android:0.3.32
's declared dependencies.In the Vosk android example
jna
is imported with Gradle as a dependency of the Android application. However,net.java.dev.jna
is not a dependency of the example application (i.e. the users application that imports Vosk), it is a dependency of thevosk-android
library, and so should be declared a dependency of that library (in the POM.xml of the Maven artifact).Config
Bazel uses WORKSPACE file where we import the maven resource:
The android application Bazel BUILD file, where the application is importing those maven resources:
(The /
/third_party:
dependencies are also Maven, I've just made our own calls directly pull from maven here for clarity.)Error
Run the command:
And receive error:
Potential Solution
Update the
com.alphacephei:vosk-android:0.3.32
Maven resource to includenet.java.dev.jna:jna
as a dependency.The text was updated successfully, but these errors were encountered: