I'm trying to create an android app that can identify the object in the image and gives its name as result. I know caffe-library can be used for this but getting error when i run ./build.py .
command :
user_name#sysetm_name:~/caffe-android-lib$ ./build.py /bin/android-ndk-r10d/ndk-build
Error :
Traceback (most recent call last):
File "./build.py", line 102, in <module>
main(sys.argv[1:])
File "./build.py", line 94, in main
setup()
File "./build.py", line 24, in setup
call(['curl', '-O', PROTOBUF_URL])
File "/usr/lib/python2.7/subprocess.py", line 522, in call
return Popen(*popenargs, **kwargs).wait()
File "/usr/lib/python2.7/subprocess.py", line 710, in __init__
errread, errwrite)
File "/usr/lib/python2.7/subprocess.py", line 1327, in _execute_child
raise child_exception
OSError: [Errno 2] No such file or directory
Make sure that the clone is recursive to include the dependencies:
*** caffe-android-lib Dependency:
Boost-for-Android
protobuf
Eigen
E.g.:
git clone --recursive https://github.com/sh1r0/caffe-android-lib.git
cd caffe-android-lib
./build.py $(NDK_PATH)
Or have you tried to install the dependencies (especially protobuf) from source?
Given the dependencies are correctly installed, then you will have a successful caffe-android build:
E.g.:
https://gist.github.com/melvincabatuan/6b5e37444b77326ae7b3
...updated 10980 targets...
Done!
...
[armeabi-v7a] Install : libcaffe_jni.so => libs/armeabi-v7a/libcaffe_jni.so
Related
I was able to build Android image for my Development Board by applying my custom patch to AOSP code. The generated binaries(Say Version 1) was working fine. I have made few changes to my patch, built the latest image(Say Version 2). This also working good.
I have respective target_files for these versions by running dist command
make dist
What worked:
When i try to generate incremental ota package on my Linux machine(say PC-1), the ota.zip file was generated and working fine.
./build/tools/releasetools/ota_from_target_files -i ./version1_target_file.zip ./version2_target_file.zip oat_file_version_1_to_2.zip
unzipping target target-files...
unzipping source target-files...
unable to load device-specific module; assuming none
Loading target...
Loading source...
2 diffs to compute
0.41 sec 316 / 307886 bytes ( 0.10%) system/etc/recovery-resource.dat
1.43 sec 1799 / 2521277 bytes ( 0.07%) system/priv-app/Calander.apk
building image from target_files BOOT...
building image from target_files BOOT...
building image from target_files RECOVERY...
building image from target_files RECOVERY...
boot target: 5414912 source: 5414912 diff: 1086759
boot image changed; including.
recovery image changed; including as patch from boot.
done.
What not worked:
The same when tried in another Linux PC(other than PC-1), there are dependency error making my script to fail.
./build/tools/releasetools/ota_from_target_files -i ./version1_target_file.zip ./version2_target_file.zip oat_file_version_1_to_2.zip
unzipping target target-files...
unzipping source target-files...
unable to load device-specific module; assuming none
Loading target...
Loading source...
2 diffs to compute
[Errno 2] No such file or directory
Exception in thread Thread-2:
Traceback (most recent call last):
File "/usr/lib/python2.7/threading.py", line 801, in __bootstrap_inner
self.run()
File "/usr/lib/python2.7/threading.py", line 754, in run
self.__target(*self.__args, **self.__kwargs)
File "/home/ubuntu/otaPackageBuildTest/test/build/tools/releasetools/common.py", line 919, in worker
d.ComputePatch()
File "/home/ubuntu/otaPackageBuildTest/test/build/tools/releasetools/common.py", line 879, in ComputePatch
p = Run(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
File "/home/ubuntu/otaPackageBuildTest/test/build/tools/releasetools/common.py", line 68, in Run
return subprocess.Popen(args, **kwargs)
File "/usr/lib/python2.7/subprocess.py", line 711, in __init__
errread, errwrite)
File "/usr/lib/python2.7/subprocess.py", line 1343, in _execute_child
raise child_exception
OSError: [Errno 2] No such file or directory
[Errno 2] No such file or directory
Exception in thread Thread-1:
Traceback (most recent call last):
File "/usr/lib/python2.7/threading.py", line 801, in __bootstrap_inner
self.run()
File "/usr/lib/python2.7/threading.py", line 754, in run
self.__target(*self.__args, **self.__kwargs)
File "/home/ubuntu/otaPackageBuildTest/test/build/tools/releasetools/common.py", line 919, in worker
d.ComputePatch()
File "/home/ubuntu/otaPackageBuildTest/test/build/tools/releasetools/common.py", line 879, in ComputePatch
p = Run(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
File "/home/ubuntu/otaPackageBuildTest/test/build/tools/releasetools/common.py", line 68, in Run
return subprocess.Popen(args, **kwargs)
File "/usr/lib/python2.7/subprocess.py", line 711, in __init__
errread, errwrite)
File "/usr/lib/python2.7/subprocess.py", line 1343, in _execute_child
raise child_exception
OSError: [Errno 2] No such file or directory
building image from target_files BOOT...
Traceback (most recent call last):
File "./build/tools/releasetools/ota_from_target_files", line 914, in <module>
main(sys.argv[1:])
File "./build/tools/releasetools/ota_from_target_files", line 899, in main
WriteIncrementalOTAPackage(input_zip, source_zip, output_zip)
File "./build/tools/releasetools/ota_from_target_files", line 605, in WriteIncrementalOTAPackage
OPTIONS.source_info_dict)
File "/home/ubuntu/otaPackageBuildTest/test/build/tools/releasetools/common.py", line 344, in GetBootableImage
info_dict))
File "/home/ubuntu/otaPackageBuildTest/test/build/tools/releasetools/common.py", line 281, in BuildBootableImage
p1 = Run(cmd, stdout=subprocess.PIPE)
File "/home/ubuntu/otaPackageBuildTest/test/build/tools/releasetools/common.py", line 68, in Run
return subprocess.Popen(args, **kwargs)
File "/usr/lib/python2.7/subprocess.py", line 711, in __init__
errread, errwrite)
File "/usr/lib/python2.7/subprocess.py", line 1343, in _execute_child
raise child_exception
OSError: [Errno 2] No such file or directory
Question:
What are the minimal packages required to generate incremental ota file on a fresh Linux PC?
I would install all necessary AOSP libs as stated from: https://source.android.com/source/initializing
For Ubuntu 14.04 / 16.04:
sudo apt-get install git-core gnupg flex bison gperf build-essential
zip curl zlib1g-dev gcc-multilib g++-multilib libc6-dev-i386
lib32ncurses5-dev x11proto-core-dev libx11-dev lib32z-dev ccache
libgl1-mesa-dev libxml2-utils xsltproc unzip
Also, sometimes its helps to pass in the host arch (-p arg) and verbose option (-v) to get more debugging information from the command itself:
I.E.
./build/tools/releasetools/ota_from_target_files -v --block -p out/host/linux-x86 -k build/target/product/security/releasekey -i previous_signed_target_files.zip signed_target_files.zip incremental.zip
I'm trying to use the Infer tool to analyze my app code. I followed these steps and every time I'm trying to run infer -- gradle build I'm getting the below errors :
infer -- gradle build
Running and capturing gradle compilation...
Traceback (most recent call last):
File "/usr/local/bin/infer", line 183, in <module>
main()
File "/usr/local/bin/infer", line 147, in main
capture_exitcode = imported_module.gen_instance(args,cmd).capture()
File "/usr/local/Cellar/infer/0.8.1/libexec/infer/lib/python/inferlib/capture/gradle.py", line 87, in capture
cmds = self.get_infer_commands(util.get_build_output(self.build_cmd))
File "/usr/local/Cellar/infer/0.8.1/libexec/infer/lib/python/inferlib/capture/util.py", line 25, in get_build_output
proc = subprocess.Popen(build_cmd, stdout=subprocess.PIPE)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py", line 710, in __init__
errread, errwrite)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py", line 1335, in _execute_child
raise child_exception
OSError: [Errno 2] No such file or directory
Any idea would be appreciated !!
I found that Infer is already included in the new android studio 2.2 where you can run it directly from Analyze->Infer Nullity then specify the scope.
I get an error when building Android from source which I have not tinkered with and it should really by all means work (I'm quite certain I've got all the libs installed, Java and Python in the correct version). Error messages go as follows:
> Traceback (most recent call last):
File "../../base/android/jni_generator/jni_generator.py", line 1065, in <module>
sys.exit(main(sys.argv))
File "../../base/android/jni_generator/jni_generator.py", line 1061, in main
options.optimize_generation)
File "../../base/android/jni_generator/jni_generator.py", line 996, in GenerateJNIHeader
jni_from_javap = JNIFromJavaP.CreateFromClass(input_file, namespace)
File "../../base/android/jni_generator/jni_generator.py", line 507, in CreateFromClass
stderr=subprocess.PIPE)
File "/usr/lib/python2.7/subprocess.py", line 710, in __init__
errread, errwrite)
File "/usr/lib/python2.7/subprocess.py", line 1327, in _execute_child
raise child_exception
OSError: [Errno 2] No such file or directory
make: *** [out/target/product/rk3066/obj/GYP/shared_intermediates/ui/gl/jni/Surface_jni.h] Error 1
make: *** Waiting for unfinished jobs....
I'm not really a specialist, so maybe the information I have provided is not complete. In this case - let me know.
At line 507 in file external/chromium_org/base/android/jni_generator/jni_generator.py
p = subprocess.Popen(args=['javap', class_name],
cwd=os.path.dirname(class_file),
stdout=subprocess.PIPE,
stderr=subprocess.PIPE)
It seems you don't have javap available in your PATH
If you have installed the jdk1.6.0_45 in usr/lib/jvm, then you can run this command
sudo update-alternatives --install /usr/bin/javap javap /usr/lib/jvm/jdk1.6.0_45/bin/javap 1
I am trying to build unmodified Chromium following official instructions, but i am getting the following error, I tried reinstalling Ubuntu 8, 12 but no difference:
[10/6591] ACTION Creating jsr_305_javalib jar
FAILED: cd ../../third_party/jsr-305; python ../../build/android/jar.py "--classes-dir=../../out/Release/gen/jsr_305_javalib/classes" "--jar-path=../../out/Release/lib.java/jsr_305_javalib.jar" "--excluded-classes=\"*/R.class\" \"*/R##*.class\"" "--ignore=035ff3d8153c7ebb3e17803d6ec654de -"
Traceback (most recent call last):
File "../../build/android/jar.py", line 53, in <module>
sys.exit(main(sys.argv))
File "../../build/android/jar.py", line 46, in main
DoJar(options)
File "../../build/android/jar.py", line 30, in DoJar
subprocess.check_call(jar_cmd, cwd=jar_cwd)
File "/usr/lib/python2.7/subprocess.py", line 506, in check_call
retcode = call(*popenargs, **kwargs)
File "/usr/lib/python2.7/subprocess.py", line 493, in call
return Popen(*popenargs, **kwargs).wait()
File "/usr/lib/python2.7/subprocess.py", line 679, in __init__
errread, errwrite)
File "/usr/lib/python2.7/subprocess.py", line 1249, in _execute_child
raise child_exception
OSError: [Errno 2] No such file or directory
I'd stopped at same error. Finally, I found my stupid mistake that I forgot to add PATH of jar command. The following command is needed in addition to the java set up guide in Chromium official build instructions.
sudo update-alternatives --install /usr/bin/jar jar /usr/lib/jvm/jdk1.6.0_xx/bin/jar 50000
You must install the depot_tools package. Try this commands;
git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git
export PATH=$PATH:/path/to/depot_tools
I am new to Android. I wanted take a look at the Andriod source and started the download process. I am having a problem in initialising the repo. I am getting a below error:
$ repo init -u https://android.googlesource.com/platform/manifest
Traceback (most recent call last):
File "/bin/repo", line 685, in <module>
main(sys.argv[1:])
File "/bin/repo", line 652, in main
_Init(args)
File "/bin/repo", line 184, in _Init
_CheckGitVersion()
File "/bin/repo", line 209, in _CheckGitVersion
proc = subprocess.Popen(cmd, stdout=subprocess.PIPE)
File "/usr/lib/python2.6/subprocess.py", line 633, in __init__
errread, errwrite)
File "/usr/lib/python2.6/subprocess.py", line 1139, in _execute_child
raise child_exception
OSError: [Errno 2] No such file or directory
You need to install git. The typical command would be :
$ sudo apt-get install git-core