I trying build tensorflow_demo for android with Bazel, but I get this error:
ERROR: no such package 'tensorflow/tensorflow/examples/android': BUILD file not found on package path.
I have build file in directory (MacOS):
/Users/pavelgosteev/tensorflow/tensorflow/examples/android
build command:
(tensorflow) MBP-Pavel:tensorflow pavelgosteev$ bazel build //tensorflow/tensorflow/examples/android:tensorflow_demo
What's wrong? Why can't Bazel see build file?
I think you need one fewer "tensorflow" in the build target name. Try:
bazel build //tensorflow/examples/android:tensorflow_demo
Further instructions can be found in the Tensorflow Android tutorial.
Related
I am trying to build my React Native Android app on Visual Studio App Center and I get this error:
Task : Shell script
Description : Run a shell script using Bash
Version : 2.165.0
Author : Microsoft Corporation
Help : https://learn.microsoft.com/azure/devops/pipelines/tasks/utility/shell-script
==============================================================================
[command]/bin/bash /Users/runner/runners/2.165.2/scripts/android-postprocess.sh /Users/runner/runners/2.165.2/work/1/s/mobile/android/app/app/build/outputs/apk
Removing all ABI or density dependent APKs…
find: /Users/runner/runners/2.165.2/work/1/s/mobile/android/app/app/build/outputs/apk: No such file or directory
find: /Users/runner/runners/2.165.2/work/1/s/mobile/android/app/app/build/outputs/apk: No such file or directory
find: /Users/runner/runners/2.165.2/work/1/s/mobile/android/app/app/build/outputs/apk: No such file or directory
Found 0 APK file(s)
Found 0 unaligned APK file(s)
find: /Users/runner/runners/2.165.2/work/1/s/mobile/android/app/app/build/outputs/apk: No such file or directory
/Users/runner/runners/2.165.2/scripts/android-postprocess.sh: line 36: pushd: /Users/runner/runners/2.165.2/work/1/s/mobile/android/app/app/build/outputs/apk/..: No such file or directory
/Users/runner/runners/2.165.2/scripts/android-postprocess.sh: line 43: popd: directory stack empty
##[error]The process '/bin/bash' failed with exit code 1
##[error]Bash failed with error: The process '/bin/bash' failed with exit code 1
##[section]Finishing: Android Postprocess
##[section]Starting: Post Build Script
It's incorrectly looking for my APK in the app/app/build/... instead of app/build/...So I want to copy the files to app/app/build/.. so it finds them there.
I can't copy the files with a post-build script because it runs after the script that throws the error.
Is it possible to somehow achieve copying with Gradle? Or maybe have multiple build paths? Or some other solution?
The problem was that I had gradlew, gradlew.bat and gradle folder in my appmodule folder. I must have mistakenly opened the app folder alone in Android Studio and synced the project.
I solved it by creating a fresh React Native project.
I am using Jenkins to build Xamarin Android project.
And I see error:
/Library/Frameworks/Xamarin.Android.framework/Versions/Current/bin/mono-symbolicate:
line 6: exec: mono: not found
/Library/Frameworks/Mono.framework/External/xbuild/Xamarin/Android/Xamarin.Android.Common.targets(2194,3):
error MSB3073: The command
""/Library/Frameworks/Xamarin.Android.framework/Versions/Current/bin/mono-symbolicate"
store-symbols "bin/Release/com.companyname.preoject.apk.mSYM"
"obj/Release/android/assets"" exited with code 127.
[/Users/Shared/Jenkins/Home/workspace/project_test_android/Droid/Project.Droid.csproj]
Done Building Project
"/Users/Shared/Jenkins/Home/workspace/project_test_android/Droid/Project.Droid.csproj"
(PackageForAndroid target(s)) -- FAILED.
Build FAILED.
I found https://forums.xamarin.com/discussion/81671/cant-archive-any-android-project but it doesn't help me.
my build command
/p:Configuration=Release /t:PackageForAndroid /p:AndroidSdkDirectory=/Users/user/Library/Developer/Xamarin/android-sdk-macosx
Thank you
I found solution. I just added /p:MonoSymbolArchive=False to my command line
when i run the tensorflow android demo.
i have installed the bazel for a long time to build the environment.
and then when all tool is done.then run the demo in Android Studio.
the gradle console show me this:
the error image
and the error occured when the task of buildNative executed.
the full command line display in the gradle console:
Starting process 'command '/usr/local/bin/bazel''. Working directory: /Users/colarking/Workspace/tensorflow Command: /usr/local/bin/bazel build -c opt tensorflow/examples/android:tensorflow_native_libs --crosstool_top=//external:android/crosstool --cpu=armeabi-v7a --verbose_failures --host_crosstool_top=#bazel_tools//tools/cpp:toolchain
Successfully started process 'command '/usr/local/bin/bazel''
Did you build native libs with these commands?
CPU=armeabi-v7a
bazel build //tensorflow/examples/android:tensorflow_native_libs --crosstool_top=//external:android/crosstool --cpu=$CPU --host_crosstool_top=#bazel_tools//tools/cpp:toolchain
NATIVE_FOLDER=tensorflow/examples/android/libs/$CPU
mkdir -p $NATIVE_FOLDER
cp bazel-bin/tensorflow/examples/android/libtensorflow_demo.so $NATIVE_FOLDER
Source: https://github.com/tensorflow/tensorflow/issues/3444
Tensorflow cannot see the path to the NDK. You need to update the WORKSPACE file in the projects root folder with the NDK and sdk paths. you also need to install the correct NDK for your machine. Follow the instructions here
I downloaded the ActionBarSherlock ViewPagerTutorial from here:
http://www.androidbegin.com/tutorial/android-actionbarsherlock-viewpager-tabs-tutorial/
But when I try to build the package it errors out saying:
$ ant debug
Buildfile: build.xml does not exist!
Build failed
Where can I find the build.xml file for this package?
Where can I find the build.xml file for this package?
You create it, by running the android update project command.
I Want to build apk using commandline, I am using ant server by using it I am building apk with commandline but when I give this command ant debug it shows error BUILD FAILED Unable to locate tools.jar and then it gives error source resource doesnt exist
This might be because your JAVA_HOME is not set to your C:\Program Files\Java\jdk folder.
instead it might be set to C:\Program Files\Java\jre so it's not getting tools.jar.
just check out this.
You can do this in this way:
C:\>set JAVA_HOME=C:\Program Files\Java\jdk
C:\>ant debug
You need tools.jar file from your jdk/lib/ folder.