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
Related
Getting errors as below, when I follow step 4 of the instruction from Getting Started with ARC Open Source on Linux. OS is Ubuntu 14.04 LTS running in Hyper-V.
UBUNTU14:~/arc$ ./configure
ERROR:root:While running
['third_party/tools/depot_tools/third_party/gsutil/gsutil', 'cp',
'gs://arc-build/naclports/builds/pepper_40/python.zip',
'/tmp/tmpUZ0IoK/naclports-python'] ERROR:root:GSResponseError:
status=403, code=None, reason=Forbidden.
ERROR:root:Try prodaccess, and if it does not solve the problem try rm
~/.devstore_token ###STEP_WARNINGS### ERROR:root:Retrying after 9 s
sleeping Traceback (most recent call last): File
"/home/fkiller/arc/src/build/build_common.py", line 938, in wrapper
return func(*args, **kwargs) File "/home/fkiller/arc/src/build/util/download_package_util.py", line 243,
in _download_package_with_retries
self._download_method(url, download_package_path) File "/home/fkiller/arc/src/build/util/download_package_util.py", line 119,
in _download
build_common.get_gsutil_executable(), 'cp', url, destination_path]) File
"/home/fkiller/arc/src/build/util/download_package_util.py", line 97,
in execute_subprocess
output = subprocess.check_output(cmd, cwd=cwd, stderr=subprocess.STDOUT) File "/usr/lib/python2.7/subprocess.py",
line 573, in check_output
raise CalledProcessError(retcode, cmd, output=output) CalledProcessError: Command
'['third_party/tools/depot_tools/third_party/gsutil/gsutil', 'cp',
'gs://arc-build/naclports/builds/pepper_40/python.zip',
'/tmp/tmpUZ0IoK/naclports-python']' returned non-zero exit status 1
Any idea to resolve this without changing build script? I may manually pointing python.zip from other sources such as https://naclports.storage.googleapis.com/builds/pepper_40/trunk-147-g49eb4c9/publish/python/pnacl/python.zip, but I want to build it as is without changing scripts.
I've already tried to setup gsutil and its authenticator, but it didn't fix the issue.
EDIT: After #elijah-taylor fixed ACL, now I'm getting errors below
Traceback (most recent call last): File "src/build/configure.py",
line 365, in
sys.exit(main()) File "src/build/configure.py", line 347, in main
_gclient_sync_third_party() File "src/build/configure.py", line 132, in _gclient_sync_third_party
subprocess.check_output(cmd, cwd=os.path.dirname(gclient_filename)) File
"/usr/lib/python2.7/subprocess.py", line 566, in check_output
process = Popen(stdout=PIPE, *popenargs, **kwargs) 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
In the line 132,
File "src/build/configure.py", line 132, in _gclient_sync_third_party
subprocess.check_output(cmd, cwd=os.path.dirname(gclient_filename))
gclient_filename is "third_party/.gclient" and os.path.dirname(gclient_filename) is "thrid_party".
The problem was bad ACLs on the files. I reached out to #elijah-taylor for a fix, it should now work!
faced same issue..fixed after running the following.
apt-get install gsutil
apt-get install libwww-perl
chmod +x ./third_party/tools/depot_tools/third_party/gsutil/gsutil
I have created a pygame application. Now I want to create an APK and for that I need to install pygame_sdl2. However, when I try to install by running python setup.py install I get this error
Traceback (most recent call last):
File "C:\pygame_sdl2-master\setup.py", line 36, in <module>
parse_cflags([ "sh", "-c", "sdl2-config --cflags" ])
File "C:\pygame_sdl2-master\setuplib.py", line 93, in parse_cflags
output = subprocess.check_output(command, universal_newlines=True)
File "C:\Python27\lib\subprocess.py", line 566, in check_output
process = Popen(stdout=PIPE, *popenargs, **kwargs)
File "C:\Python27\lib\subprocess.py", line 710, in __init__
errread, errwrite)
File "C:\Python27\lib\subprocess.py", line 958, in _execute_child
startupinfo)
WindowsError: [Error 2] The system cannot find the file specified
Any help in this context would be appreciated.
Download the version you need here https://bitbucket.org/marcusva/py-sdl2/downloads
Exctract, open the cmd and navigate to the folder.
Run python setup.py install
Working for me this way.I downloaded PySDL2-0.9.3.zip file
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
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