Android ndk example app doesn't seem to build to missing JNI headers while mobile-install works fine
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 3/5
- Tiempo estimado
- 1-2 días
- Aptitud para principiantes
- 35/100
- Tipo de issue
- Error
- Claridad
- Bastante claro
- Estado de actividad
- Estancado
- Stack tecnológico
- android, cpp
- Área
- build-system, mobile-dev
Línea de trabajo
Empieza por app/src/main/BUILD.bazel y app/src/main/cpp/native-lib.cpp, luego reproduce el fallo con el comando bazel build indicado y compáralo con bazel mobile-install. Se considera terminado cuando el ejemplo de Android NDK se compila correctamente con //app/src/main:app y ya no informa de que falta jni.h.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Hi,
I am trying to build cpp with ndk for android project and started noticing issues while building. I noticed the same issue is happening in examples repository as well with ndk example...
Ran the below command:
bazel build //app/src/main:app --fat_apk_cpu=x86 --android_crosstool_top=@androidndk//:toolchain
And noticing the below issue in the command prompt.
Starting local Bazel server and connecting to it...
WARNING: For repository 'rules_jvm_external', the root module requires module version [email protected], but got [email protected] in the resolved dependency graph.
DEBUG: /private/var/tmp/_bazel_prasadpamidi/f649ff770c75e43e391c14e7c6ebc48c/external/rules_jvm_external~/private/extensions/maven.bzl:154:14: The maven repository 'maven' is used in two different bazel modules, originally in '' and now in 'protobuf'
DEBUG: /private/var/tmp/_bazel_prasadpamidi/f649ff770c75e43e391c14e7c6ebc48c/external/rules_jvm_external~/private/extensions/maven.bzl:154:14: The maven repository 'maven' is used in two different bazel modules, originally in '' and now in 'protobuf'
DEBUG: /private/var/tmp/_bazel_prasadpamidi/f649ff770c75e43e391c14e7c6ebc48c/external/rules_jvm_external~/private/extensions/maven.bzl:154:14: The maven repository 'maven' is used in two different bazel modules, originally in '' and now in 'protobuf'
WARNING: /private/var/tmp/_bazel_prasadpamidi/f649ff770c75e43e391c14e7c6ebc48c/external/rules_android~/tools/android/BUILD:271:6: in alias rule @@rules_android~//tools/android:dexsharder: Target '@@rules_android~//tools/android:dexsharder' violates visibility of target '@@bazel_tools//src/tools/android/java/com/google/devtools/build/android/dexer:DexFileSplitter'. Continuing because --nocheck_visibility is active
INFO: Analyzed target //app/src/main:app (368 packages loaded, 17520 targets configured).
INFO: From Building external/rules_jvm_external~/private/tools/java/com/github/bazelbuild/rules_jvm_external/zip/libzip.jar (1 source file) [for tool]:
warning: [options] source value 8 is obsolete and will be removed in a future release
warning: [options] target value 8 is obsolete and will be removed in a future release
warning: [options] To suppress warnings about obsolete options, use -Xlint:-options.
INFO: From Building external/rules_jvm_external~/private/tools/java/com/github/bazelbuild/rules_jvm_external/jar/AddJarManifestEntry.jar (1 source file) [for tool]:
warning: [options] source value 8 is obsolete and will be removed in a future release
warning: [options] target value 8 is obsolete and will be removed in a future release
warning: [options] To suppress warnings about obsolete options, use -Xlint:-options.
INFO: From Building external/bazel_tools/src/tools/android/java/com/google/devtools/build/android/dexer/DexFileSplitter.jar (5 source files) and running annotation processors (AutoValueProcessor) [for tool]:
warning: [options] source value 8 is obsolete and will be removed in a future release
warning: [options] target value 8 is obsolete and will be removed in a future release
warning: [options] To suppress warnings about obsolete options, use -Xlint:-options.
ERROR: /Users/prasadpamidi/examples/android/ndk/app/src/main/BUILD.bazel:17:11: Compiling app/src/main/cpp/native-lib.cpp failed: (Exit 1): cc_wrapper.sh failed: error executing CppCompile command (from target //app/src/main:jni_lib) external/bazel_tools~cc_configure_extension~local_config_cc/cc_wrapper.sh -U_FORTIFY_SOURCE -fstack-protector -Wall -Wthread-safety -Wself-assign -Wunused-but-set-parameter -Wno-free-nonheap-object ... (remaining 21 arguments skipped)
Use --sandbox_debug to see verbose messages from the sandbox and retain the sandbox build root for debugging
app/src/main/cpp/native-lib.cpp:1:10: fatal error: 'jni.h' file not found
#include <jni.h>
^~~~~~~
1 error generated.
Target //app/src/main:app failed to build
Use --verbose_failures to see the command lines of failed build steps.
INFO: Elapsed time: 30.667s, Critical Path: 3.90s
INFO: 44 processes: 11 internal, 30 darwin-sandbox, 3 worker.
This issue isn't happening when i run bazel mobile-install //app/src/main:app --fat_apk_cpu=x86 --start_app --android_crosstool_top=@androidndk//:toolchain.
Am I doing something wrong? is the cpp with ndk not supposed to work with build?
- Lenguaje dominante
- Starlark
- Estrellas
- 958
- Forks
- 582
- Métricas de merge de PR
- Sin PR fusionados en 30 d
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Sin plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de bazelbuild/examples
-
Dificultad 4/5 3-5 días Aptitud para principiantes 30/100
bazelbuild/examples#722 · 1 comentario ·
-
Dificultad 3/5 1-2 días Aptitud para principiantes 48/100
bazelbuild/examples#721 ·
-
[Bazel CI] ERROR: rules_rust_prost: implicit attribute defaults to @bazel_tools//tools/cpp:empty, fails single-file check (08-grpc-client-server)Posiblemente ocupada @deepalak56 la tomó hace 45 días. Abierto
Dificultad 3/5 1-2 días Aptitud para principiantes 64/100
bazelbuild/examples#710 · 2 comentarios ·
-
Dificultad 4/5 3-5 días Aptitud para principiantes 30/100
bazelbuild/examples#650 · 1 comentario ·
-
Dificultad 4/5 3-5 días Aptitud para principiantes 25/100
bazelbuild/examples#642 ·
Todos los issues de bazelbuild/examples
Issues similares
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 65/100
bazelbuild/apple_support#707 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 1/5 Menos de una hora Aptitud para principiantes 92/100
-
blocky: new version 0.38.0Abiertoout-of-date
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
CachyOS/CachyOS-PKGBUILDS#2232 ·
Los mantenedores suelen responder en 1 día
-
blast/large refactor risk/low spend-dem
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
chriskelly/MusicWall#87 · 2 comentarios ·
Los mantenedores suelen responder en 1 día
-
bug
Dificultad 1/5 Menos de una hora Aptitud para principiantes 77/100