Incremental OTA zip is not generating - android

I am trying to generate minor.zip(Incremental OTA zip)file.
Home$build/tools/releasetools/ota_from_target_files -i
out/target/product/xxx/OTA_20170916.zip
out/target/product/xxx/OTA-20171010.zip
out/target/product/xxx/minor.zip
unzipping target target-files...
Traceback (most recent call last):
File "build/tools/releasetools/ota_from_target_files", line 2028, in
<module>
main(sys.argv[1:])
File "build/tools/releasetools/ota_from_target_files", line 1937, in
main
OPTIONS.info_dict = common.LoadInfoDict(input_zip)
File "build/tools/releasetools/common.py", line 141, in LoadInfoDict
raise ValueError("can't find recovery API version in input target-files")
ValueError: can't find recovery API version in input target-files
This error is coming...
I followed this site http://solarex.github.io/wiki/Android/android_ota_update.html
Could you please help to overcome this error

I got solution for incremental OTA zip creation.
Step 1: Copy new OTA and old OTA zip files from out/target/product/xxx/obj/PACKAGING/target_files_intermediates/
Step 2: ./build/tools/releasetools/ota_from_target_files -i old.zip new.zip update.zip
Incremental OTA file will be generate.

Related

Unable to access signapk.jar

So, I am trying to create an OTA package in AOSP and I run into this error at the very end.
2020-07-23 09:09:28 - common.py - INFO : using prebuilt boot.img from IMAGES...
2020-07-23 09:09:28 - common.py - INFO : boot size (13910016) is 20.73% of limit (67108864)
2020-07-23 09:09:29 - ota_from_target_files.py - ERROR :
ERROR:
Traceback (most recent call last):
File "/home/shen/android-11/out/host/linux-x86/bin/ota_from_target_files/ota_from_target_files.py", line 2263, in <module>
File "/home/shen/android-11/out/host/linux-x86/bin/ota_from_target_files/ota_from_target_files.py", line 2243, in main
File "/home/shen/android-11/out/host/linux-x86/bin/ota_from_target_files/ota_from_target_files.py", line 1986, in GenerateNonAbOtaPackage
File "/home/shen/android-11/out/host/linux-x86/bin/ota_from_target_files/ota_from_target_files.py", line 884, in WriteFullOTAPackage
File "/home/shen/android-11/out/host/linux-x86/bin/ota_from_target_files/ota_from_target_files.py", line 1332, in FinalizeMetadata
File "/home/shen/android-11/out/host/linux-x86/bin/ota_from_target_files/ota_from_target_files.py", line 1318, in ComputeAllPropertyFiles
File "/home/shen/android-11/out/host/linux-x86/bin/ota_from_target_files/ota_from_target_files.py", line 495, in SignOutput
File "/home/shen/android-11/out/host/linux-x86/bin/ota_from_target_files/common.py", line 1898, in SignFile
proc.returncode, stdoutdata))
ExternalError: Failed to run signapk.jar: return code 1:
Error: Unable to access jarfile out/host/linux-x86/framework/signapk.jar
Compressing system.new.dat with brotli
Compressing vendor.new.dat with brotli
09:09:30 ninja failed with: exit status 1
#### failed to build some targets (01:44 (mm:ss)) ####
I checked and there is no signapk.jar created in the out directory.
I found the answer in case anybody face it in future. Building the signapk.jar separately fixes the issue. So do a make signapk.jar

Buildozer error when compiling Android: list index out of range inside _install_p4a

I'm currently trying to compile a simple Kivy app for use on Android. It runs in both my windows and linux environments without errors or warnings. When I go to package it using buildozer I get an error almost immediately. I did search for this error and although the title is very similar to other questions, the error is not.
Output from buildozer:
(mykivyinstall) oli#Bud: buildozer android debug
# Check configuration tokens
# Ensure build layout
# Check configuration tokens
# Preparing build
# Check requirements for android
# Install platform
Traceback (most recent call last):
File "/home/oli/mykivyinstall/bin/buildozer", line 11, in <module>
sys.exit(main())
File "/home/oli/mykivyinstall/lib/python3.6/site-packages/buildozer/scripts/client.py", line 13, in main
Buildozer().run_command(sys.argv[1:])
File "/home/oli/mykivyinstall/lib/python3.6/site-packages/buildozer/__init__.py", line 1059, in run_command
self.target.run_commands(args)
File "/home/oli/mykivyinstall/lib/python3.6/site-packages/buildozer/target.py", line 92, in run_commands
func(args)
File "/home/oli/mykivyinstall/lib/python3.6/site-packages/buildozer/target.py", line 102, in cmd_debug
self.buildozer.prepare_for_build()
File "/home/oli/mykivyinstall/lib/python3.6/site-packages/buildozer/__init__.py", line 176, in prepare_for_build
self.target.install_platform()
File "/home/oli/mykivyinstall/lib/python3.6/site-packages/buildozer/targets/android.py", line 467, in install_platform
self._install_p4a()
File "/home/oli/mykivyinstall/lib/python3.6/site-packages/buildozer/targets/android.py", line 524, in _install_p4a
deps = re.findall("^install_reqs = (\[[^\]]*\])", setup, re.DOTALL | re.MULTILINE)[0]
IndexError: list index out of range
My environment:
buildozer version=0.35
cython version=0.25.2
python version=3.6.6
OS is Ubuntu=18.04
Am I mixing and matching the wrong versions of things?
This seems a like a bug in the latest version of buildozer. The solution is to edit the file "../python3.6/site-packages/buildozer/targets/android.py" and replace the line
deps = re.findall("^install_reqs = (\[[^\]]*\])", setup, re.DOTALL | re.MULTILINE)[0]
with
deps = re.findall("install_reqs = (\[[^\]]*\])", setup, re.DOTALL | re.MULTILINE)[0]
Then run buildozer -v android debug

How to set temporary directory when building cyanogenmod

I am trying to build cyanogenmod, but the build fails with the following. My drive on /mnt has plenty of space, however the root-partition where /tmp resides has less space, so I assume this happens while writing a temporary file.
Therefore I would like to redirect the temporary directory for this to somewhere under /mnt as well, how can I do this in cyanogenmod/Android build system? I tried setting TMP and TEMP but they don't seem to have any effect.
Package OTA: /mnt/android/system/out/target/product/oneplus3/cm_oneplus3-ota-178d4560f4.zip
unzipping target target-files...
running: unzip -o -q /mnt/android/system/out/target/product/oneplus3/obj/PACKAGING/target_files_intermediates/cm_oneplus3-target_files-178d4560f4.zip -d /tmp/targetfiles-RM6VsH
--- target info ---
...
cache_size = (int) 268435456
...
recovery_size = (int) 67108864
...
userdata_size = (int) 57436708864
(using device-specific extensions from target_files)
loaded device-specific extensions from /tmp/targetfiles-RM6VsH/META/releasetools.py
Warning: could not find RADIO/filesmap in <zipfile.ZipFile object at 0x2b4193f91fd0>.
using prebuilt recovery.img from BOOTABLE_IMAGES...
using system.img from target-files
Total of 770048 4096-byte output blocks in 2698 input chunks.
Generating digraph...
Finding vertex sequence...
Reversing backward edges...
0/0 dependencies (0.00%) were violated; 0 source blocks stashed.
Improving vertex order...
Revising stash size...
Total 0 blocks are packed as new blocks due to insufficient cache size.
Reticulating splines...
Traceback (most recent call last):
File "./build/tools/releasetools/ota_from_target_files", line 1772, in <module>
main(sys.argv[1:])
File "./build/tools/releasetools/ota_from_target_files", line 1727, in main
WriteFullOTAPackage(input_zip, output_zip)
File "./build/tools/releasetools/ota_from_target_files", line 664, in WriteFullOTAPackage
system_diff = common.BlockDifference("system", system_tgt, src=None)
File "/mnt/android/system/build/tools/releasetools/common.py", line 1302, in __init__
b.Compute(self.path)
File "/mnt/android/system/build/tools/releasetools/blockimgdiff.py", line 299, in Compute
self.ComputePatches(prefix)
File "/mnt/android/system/build/tools/releasetools/blockimgdiff.py", line 618, in ComputePatches
new_f.write(piece)
IOError: [Errno 28] No space left on device
make: *** [/mnt/android/system/out/target/product/oneplus3/cm_oneplus3-ota-178d4560f4.zip] Error 1
make: Leaving directory `/mnt/android/system'
Update: I found a workaround by editing /mnt/android/system/build/tools/releasetools/common.py and setting a temp-dir manually with something like tmpdir = tempfile.mkdtemp(dir='/mnt/tmp') at line 1299, according to documentation mkdtemp should use TMP and TEMP, however that seems to not have worked for me here! Python is at version 2.7.6.
To set the TMPDIR environment variable, specify a directory that is accessible to the user ID that runs the replication or publishing programs. Ensure that files cannot be deleted by other user IDs.
For example, the following command specifies the /home/repldba/tempfiles/ directory:
export TMPDIR=/home/repldba/tempfiles/

Unable to compile python for android kivy distribution with pyserial

I am unable to compile a distribution for android when i include pyserial in the python for android build requirements.
I am using the ubuntu kivy vm supplied from the kivy website.
After running the following command:
./distribute.sh -m "pil kivy pyjnius pyserial"
It compiles all the packages except the last one (pyserial) and I get this error:
Installing collected packages: pyserial Running setup.py install for
pyserial
changing mode of build/scripts-2.7/miniterm.py from 664 to 775
changing mode of /tmp/tmp0r9vlU/bin/miniterm.py to 775 Successfully installed pyserial Cleaning up... Exception: Traceback
(most recent call last): File
"/home/kivy/android/python-for-android/build/venv/local/lib/python2.7/site-packages/pip/basecommand.py",
line 122, in main
status = self.run(options, args) File "/home/kivy/android/python-for-android/build/venv/local/lib/python2.7/site-packages/pip/commands/install.py",
line 311, in run
os.path.join(options.target_dir, item) File "/usr/lib/python2.7/shutil.py", line 291, in move
raise Error, "Destination path '%s' already exists" % real_dst Error: Destination path
'/home/kivy/android/python-for-android/build/python-install/lib/python2.7/site-packages/pyserial-2.7-py2.7.egg-info/pyserial-2.7-py2.7.egg-info'
already exists
Storing debug log for failure in /home/kivy/.pip/pip.log
Any help solving this would be appreciated.
I have solved this after a bit of checking the error log.
I will list it here in case someone has the same problem.
The following line:
Error: Destination path
'/home/kivy/android/python-for-android/build/python-install/lib/python2.7/site-packages/pyserial-2.7-py2.7.egg-info/pyserial-2.7-py2.7.egg-info'
already exists
indicates that the directory mentioned should be deleted, but this does not not help. Running the build script after deleting it generates the same error.
The solution was to also delete the directory named "serial" which can also be found in the "site-packages" directory.

compilation error with the build.py script in Kivy

I have recently installed a Ubuntu 13.10 virtual machine and have set the Kivy development environment for it i.e cloning kivy, building a distribution with distribute.sh and building an apk with the build.py script. While packaging my project to APK file and while running the ./build.py script i had the following error :
[aidl] /home/administrator/sdk/build-tools/19.0.1/aidl: error while loading shared libraries: libstdc++.so.6: cannot open shared object file: No such file or directory
BUILD FAILED
/home/administrator/sdk/tools/ant/build.xml:653: The following error occurred while executing this line:
/home/administrator/sdk/tools/ant/build.xml:659: null returned: 127
Total time: 1 second
Traceback (most recent call last):
File "./build.py", line 412, in <module>
make_package(args)
File "./build.py", line 336, in make_package
subprocess.check_call([ANT, arg])
File "/usr/lib/python2.7/subprocess.py", line 540, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['ant', 'debug']' returned non-zero exit status 1 re
it is really confusing! I have downloaded SDK and NDK and pointed to where these files are located while setting my environmental variables. what am I missing?
Well i have solved it in the end! And the clue was here
[aidl] /home/administrator/sdk/build-tools/19.0.1/aidl: error while loading shared libraries: libstdc++.so.6: cannot open shared object file: No such file or directory
Explained : the Linux distro that i am working on is on a 64 bit machine so some c++ libraries were necessary to be able to run 32 bit applications so what i did is the following:
$ sudo apt-get install lib32stdc++6
and it was solved!

Categories

Resources