Sign ota package for android - android

I created signed target file with the help of this command:
./build/tools/releasetools/sign_target_files_apks -d ./device/bl/common/security -e app.apk=device/bl/common/security/releasekey -o target.zip signed_target.zip
This instruction finished successful.
Now I tried to create signed ota package with the help of this command:
./build/tools/releasetools/ota_from_target_files -k ./device/bl/common/security/releasekey signed_target.zip ota_signed.zip
But I have error:
Traceback (most recent call last):
File "./build/tools/releasetools/ota_from_target_files", line 925, in <module>
main(sys.argv[1:])
File "./build/tools/releasetools/ota_from_target_files", line 893, in main
WriteFullOTAPackage(input_zip, output_zip, OPTIONS.fota)
File "./build/tools/releasetools/ota_from_target_files", line 464, in WriteFullOTAPackage
MakeRecoveryPatch(OPTIONS.input_tmp, output_zip, recovery_img, boot_img)
File "./build/tools/releasetools/ota_from_target_files", line 386, in MakeRecoveryPatch
boot_type, boot_device = common.GetTypeAndDevice("/boot", OPTIONS.info_dict)
TypeError: 'NoneType' object is not iterable
How can I fix it?

./build/tools/releasetools/ota_from_target_files -d MMC -k ./device/bl/common/security/releasekey signed_target.zip ota_signed.zip

Related

How to install build tools on arch with sdkmanager?

If I don't use sudo I get a permission error:
$ sdkmanager "build-tools;33.0.1"
Traceback (most recent call last):
File "/usr/bin/sdkmanager", line 33, in <module>
sys.exit(load_entry_point('sdkmanager==0.6.0', 'console_scripts', 'sdkmanager')())
File "/usr/lib/python3.10/site-packages/sdkmanager.py", line 1141, in main
method(args.packages)
File "/usr/lib/python3.10/site-packages/sdkmanager.py", line 972, in install
install_dir.parent.mkdir(parents=True, exist_ok=True)
File "/usr/lib/python3.10/pathlib.py", line 1175, in mkdir
self._accessor.mkdir(self, mode)
PermissionError: [Errno 13] Permission denied: '/opt/android-sdk/build-tools'
If I use sudo I get this error (or switch to sudo zsh)
sdkmanager "build-tools;33.0.1"  ✔  root#wiley
Traceback (most recent call last):
File "/usr/bin/sdkmanager", line 33, in <module>
sys.exit(load_entry_point('sdkmanager==0.6.0', 'console_scripts', 'sdkmanager')())
File "/usr/lib/python3.10/site-packages/sdkmanager.py", line 1141, in main
method(args.packages)
File "/usr/lib/python3.10/site-packages/sdkmanager.py", line 954, in install
url = packages[key]
KeyError: ('build-tools', '33.0.1')

systrace: can't create /sys/kernel/debug/tracing/trace_marker: No such file or directory

I try to do a systrace of a react native app running on android:
/home/a/Android/Sdk/platform-tools/systrace/systrace.py --time=5 -o trace.html sched gfx view -a com.mypackage
This is the error I get, but trace_markers seem to be defect:
These categories are unavailable: sched
Starting tracing (5 seconds)
Tracing completed. Collecting output...
/system/bin/sh: <stdin>[2]: can't create /sys/kernel/debug/tracing/trace_marker: No such file or directory
Exception in thread Thread-1:
Traceback (most recent call last):
File "/usr/lib/python2.7/threading.py", line 810, in __bootstrap_inner
self.run()
File "/usr/lib/python2.7/threading.py", line 763, in run
self.__target(*self.__args, **self.__kwargs)
File "/home/r/Android/Sdk/platform-tools/systrace/catapult/systrace/systrace/tracing_agents/atrace_agent.py", line 194, in _collect_and_preprocess
trace_data = self._collect_trace_data()
File "/home/r/Android/Sdk/platform-tools/systrace/catapult/systrace/systrace/tracing_agents/atrace_agent.py", line 259, in _collect_trace_data
raise IOError('Unable to get atrace data. Did you forget adb root?')
IOError: Unable to get atrace data. Did you forget adb root?
Outputting Systrace results...
Tracing complete, writing results
Traceback (most recent call last):
File "/home/r/Android/Sdk/platform-tools/systrace/systrace.py", line 49, in <module>
sys.exit(run_systrace.main())
File "/home/r/Android/Sdk/platform-tools/systrace/catapult/systrace/systrace/run_systrace.py", line 194, in main
main_impl(sys.argv)
File "/home/r/Android/Sdk/platform-tools/systrace/catapult/systrace/systrace/run_systrace.py", line 191, in main_impl
controller.OutputSystraceResults(write_json=options.write_json)
File "/home/r/Android/Sdk/platform-tools/systrace/catapult/systrace/systrace/systrace_runner.py", line 67, in OutputSystraceResults
self._out_filename)
File "/home/r/Android/Sdk/platform-tools/systrace/catapult/systrace/systrace/output_generator.py", line 70, in GenerateHTMLOutput
html_file.write(_ConvertToHtmlString(result.raw_data))
File "/home/r/Android/Sdk/platform-tools/systrace/catapult/systrace/systrace/output_generator.py", line 92, in _ConvertToHtmlString
raise ValueError('Invalid trace result format for HTML output')
ValueError: Invalid trace result format for HTML output
How could I fix this?
React: 16.0.0-alpha.12
React Native: 0.48.2
Android: 7.1.2 (LineageOS 14.1-20170607)
The problem is:
IOError: Unable to get atrace data. Did you forget adb root?
Try this cmd:
python systrace.py -a com.example.myapp -b 16384 \
-o my_systrace_report.html sched freq idle am wm gfx view binder_driver hal \
dalvik camera input res

build chromium android failed with comman "ninja -C out/Default chrome_public_apk"

I try to compile the chromium android in my Ubuntu.x64.14.04.3 according to the official website: https://chromium.googlesource.com/chromium/src/+/master/docs/android_build_instructions.md
But after I run "ninja -C out/Default chrome_public_apk", it goes to failure. with error message as follow:
xxxx#xxxx-VirtualBox:~/chromium/src$ ninja -C out/Default chrome_public_apk
ninja: Entering directory `out/Default'
[2/30589] ACTION //base:android_runtim...d/toolchain/android:android_clang_arm)
FAILED: gen/android_runtime_jni_headers/base/jni/Runtime_jni.h
python ../../base/android/jni_generator/jni_generator.py --depfile gen/base/android_runtime_jni_headers__jni_Runtime.d --jar_file ../../third_party/android_tools/sdk/platforms/android-26/android.jar --input_file java/lang/Runtime.class --ptr_type=long --output_dir gen/android_runtime_jni_headers/base/jni --includes ../../../../../../base/android/jni_generator/jni_generator_helper.h --native_exports_optional
Traceback (most recent call last):
File "../../base/android/jni_generator/jni_generator.py", line 1428, in <module>
sys.exit(main(sys.argv))
File "../../base/android/jni_generator/jni_generator.py", line 1421, in main
GenerateJNIHeader(input_file, output_file, options)
File "../../base/android/jni_generator/jni_generator.py", line 1326, in GenerateJNIHeader
jni_from_javap = JNIFromJavaP.CreateFromClass(input_file, options)
File "../../base/android/jni_generator/jni_generator.py", line 662, 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
[3/30589] ACTION //base:base_jni_heade...d/toolchain/android:android_clang_arm)
ninja: build stopped: subcommand failed.
maybe you miss some dependecies, you execute the
build/install-build-deps-android.sh ?
You need to install JDK on your machine in order to build chromium properly.
sudo apt install openjdk-8-jdk-headless
Make sure these executables point to the same jdk version.
sudo update-alternatives --config java
sudo update-alternatives --config javac

Android Source: Repo not displaying any initialization message

I've followed the instructions Google has provided on downloading the Source Tree, but after I run the command
$ repo init -u https://android.googlesource.com/platform/manifest -b android-2.3.7_r1
and I receive the following error message :
$ repo init -u https://android.googlesource.com/platform/manifest -b android-2.3.7_r1
Traceback (most recent call last):
File "/Users/roboguy12/bin/repo", line 690, in <module>
main(sys.argv[1:])
File "/Users/roboguy12/bin/repo", line 657, in main_Init(args)
File "/Users/roboguy12/bin/repo", line 189, in _Init_CheckGitVersion()
File "/Users/roboguy12/bin/repo", line 214, in _CheckGitVersion
proc = subprocess.Popen(cmd, stdout=subprocess.PIPE)
File "/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/subprocess.py", line 595, in __init__
errread, errwrite)
File "/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/subprocess.py", line 1106, in _execute_child
raise child_exception
OSError: [Errno 2] No such file or directory
What did I do wrong? Or is this just an error on behalf of Repo?
UPDATE: Now that I've installed Python 2.7, I still have almost the exact same error message:
$ repo init -u https://android.googlesource.com/platform/manifest -b android-2.3.7_r1
Traceback (most recent call last):
File "/Users/roboguy12/bin/repo", line 690, in <module>
main(sys.argv[1:])
File "/Users/roboguy12/bin/repo", line 657, in main_Init(args)
File "/Users/roboguy12/bin/repo", line 189, in _Init_CheckGitVersion()
File "/Users/roboguy12/bin/repo", line 214, in _CheckGitVersion
proc = subprocess.Popen(cmd, stdout=subprocess.PIPE)
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py", line 672, in __init__
errread, errwrite)
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py", line 1202, in _execute_child
raise child_exception
OSError: [Errno 2] No such file or directory
I call $ python -V and it says Python 2.7.1, so I don't know what else I can do.
Seems to me you might have not done a couple of things: chmod'd the repo to +x and/or put it in your $PATH statement as the first directory to look for (and could be using another version of repo). Have you tried 'ls -al' instead? The directory you're looking for is hidden and you need the -a argument in ls to view hidden files/directories.
UPDATE: Ah, just saw your update. Since you're using a Mac, you need to use Python 2.7. To do so, you'll need to MacPort it. This website provided much help to me: INSTALLING PYTHON 2.7, EASY_INSTALL, PIP, VIRTUALENV AND VIRTUALENVWRAPPER ON MAC OS X

Downloading Android source code

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

Categories

Resources