簡體   English   中英

使用 Bazel 在 Android 中實現 Crashylytics 時生成文件錯誤

[英]BUILD file error while implementing Crashylytics in Android using Bazel

我一直在按照教程在我的應用程序中實現Crashlytics 我在構建 apk 時遇到此錯誤,

WARNING: The major revision of the Android NDK referenced by android_ndk_repository rule 'androidndk' is 20. The major revisions supported by Bazel are [10, 11, 12, 13, 14, 15, 16, 17, 18]. Bazel will attempt to treat the NDK as if it was r18. This may cause compilation and linkage problems. Please download a supported NDK version.
ERROR: /home/sensen/GIT/UntitledFolder2/tensorflow/SenANPR/BUILD:37:1: in android_library rule //SenANPR:crashlytics_lib: The location of your BUILD file determines the Java package used for Android resource processing. A directory named "java" or "javatests" will be used as your Java source root and the path of your BUILD file relative to the Java source root will be used as the package for Android resource processing. The Java source root could not be determined for "SenANPR". Move your BUILD file under a java or javatests directory, or set the 'custom_package' attribute.
WARNING: /home/sensen/GIT/UntitledFolder2/tensorflow/tensorflow/contrib/lite/java/BUILD:43:12: in srcs attribute of android_library rule //tensorflow/contrib/lite/java:tensorflowlite: please do not import '//tensorflow/lite/delegates/nnapi/java/src/main/java/org/tensorflow/lite/nnapi:NnApiDelegate.java' directly. You should either move the file to this package or depend on an appropriate rule there
ERROR: Analysis of target '//SenANPR:senanpr' failed; build aborted: Analysis of target '//SenANPR:crashlytics_lib' failed; build aborted
INFO: Elapsed time: 0.174s
INFO: 0 processes.
FAILED: Build did NOT complete successfully (1 packages loaded, 155 targets configured)

但是我已經在我的 android_binary 中聲明了 custom_package。

必須為不在java根目錄下的BUILD文件中的所有規則設置custom_package ,因為這些規則可能獨立於任何其他規則構建。 因此,請嘗試為您的android_library規則設置custom_package

只是您工作的路徑應該有一個名為java的文件夾!

如果您查看官方示例,他們有java文件夾,然后是組成package name的其余文件夾。

https://github.com/google/mediapipe/tree/master/mediapipe/examples/android/src/java/com/google/mediapipe/apps

對我來說,我有這個

mediapipe/myAndroidApps/java/net/rmasoft/appName1

其中package namenet.rmasoft.appname1

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM