如何在Bazel Android项目中使用Maven依赖项

时间:2019-10-28 05:42:32

标签: android maven bazel

我是bazel的新手,正在尝试导入托管在maven上的第三方库。我已添加

maven_install(
     artifacts = ["com.opentok.android:opentok-android-sdk:2.16.2",],
    ],
   repositories = ["https://tokbox.bintray.com/maven",],
)

在WORKSPACE文件中,以及

android_library(
    name = "app_lib",
    srcs = glob(["*.java"]),
    manifest = "AndroidManifest.xml",
    resource_files = glob(["res/**"]),
    deps = [
              "@maven//:com_opentok_android_opentok_android_sdk"
 ],
)
android_binary(
    name = "MyApp",
    manifest = "AndroidManifest.xml",
    manifest_values = {"applicationId": "com.example.apps.myapp"},
    multidex = "native",
    deps = [
        ":app_lib",
    ],
)

在BUILD文件中。 项目正在构建中,但无法import用Java编写类。

0 个答案:

没有答案