AOSP: Can't Run Emulator - android

I'm an AOSP newbie. I am following this tutorial.
I have successfully synced my repo to tag android-11.0.0_r29.
I set lunch to aosp_arm-eng (I've also tried aosp_x86_64-eng). The build reports:
...
[ 99% 90444/90520] //art/build/apex:art-check-debug-apex-gen generate art-check-debug-apex-gen.dummy
--bitness=auto, trying to autodetect. This may be incorrect!
Detected multilib
[100% 90520/90520] Target vbmeta image: out/target/product/generic_arm64/vbmeta.img
#### build completed successfully (05:25:57 (hh:mm:ss)) ####
However, when I attempt to run the emulator:
clayton#ubuntu-20-aosp:~/aosp$ emulator
emulator: ERROR: Can't get kernel version from the kernel image file: '/home/clayton/aosp/prebuilts/qemu-kernel/arm64/ranchu/kernel-qemu'
Have not found a solution. Please help.

I use lunch sdk_phone_x86_64-userdebug, and it works fine with Android 11 on my x86 architecture laptop.

Related

jack-admin: command not found

I am running Ubuntu 14.04.5 LTS to compile Android 7.1.1 on a VM inside windows with 11GB of RAM assigned. Android keeps failing to build due to "out of memory errors" as seen below.
Out of memory error (version 1.2-rc4 'Carnac'(298900f95d7bdecfceb327f9d201a1348397ed8a843843 by android-jack-team#google.com)).
GC overhead limit exceeded.
Try increasing heap size with java option '-Xmx<size>'.
Warning: This may have produced partial or corrupted output.
ninja: build stopped: subcommand failed.
make: *** [ninja_wrapper] Error 1
[0;31m#### make failed to build some targets (03:04:37 (hh:mm:ss)) ####
I am trying to follow this guide: Android source code compile error: "Try increasing heap size with java option '-Xmx<size>'" to increase the heap size.
As the top answer suggests the jack server needs to be stopped and started using jack-admin.
When I use this command I am given the error message: "jack-admin: command cannot be found" how do I add jack-admin to the path?
The jack server can be found in the Android source code in the location of prebuilts/sdk/tools and can be run from there.
prebuilts/sdk/tools$ ./jack-admin stop-server
prebuilts/sdk/tools$ ./jack-admin start-server
Or this folder can then be added to the PATH by running:
export PATH=$PATH:~/myandroid/prebuilts/sdk/tools

`gomobile build` and `gomobile install` throws "gomobile: EOF"

I'm trying to build an android application using gomobile but the commands gomobile install and gomobile build fail with gomobile: EOF . Before this error I was getting this error:
# golang.org/x/mobile/gl
In file included from /root/go/src/golang.org/x/mobile/gl/gl.go:17:0:
work.h:6:23: fatal error: GLES2/gl2.h: No such file or directory
compilation terminated. but it was fixed with yum install make gcc mesa-libGLES-devel mesa-libEGL-devel.
The application is mostly a networking application. Here are the imports. Do only certain packages work with gomobile or all of them?
"golang.org/x/mobile/app"
"golang.org/x/net/websocket"
"os/exec"
"flag"
"fmt"
log "github.com/golang/glog"
"io/ioutil"
"net"
"net/http"
"net/url"
"strconv"
OS: Fedora 22.
More info: I'm able to build https://github.com/golang/mobile/blob/master/example/network/main.go so I can only assume the issue is specific to my application.
It failed because AndroidManifest.xml was empty.

Need Help AOSP Build Error for snapdragon 8974

I'm trying to build Android 5.0 source code from code-aurora for snapdragon 8074. Encountered the following error:
target SharedLib: libandroid_runtime (out/target/product/msm8974/obj/SHARED_LIBRARIES/libandroid_runtime_intermediates/LINKED/libandroid_runtime.so)
frameworks/base/core/jni/android/graphics/Paint.cpp:809: error: undefined reference to 'android::uirenderer::Blur::convertRadiusToSigma(float)'
collect2: error: ld returned 1 exit status
make: *** [out/target/product/msm8974/obj/SHARED_LIBRARIES/libandroid_runtime_intermediates/LINKED/libandroid_runtime.so] Error 1
#### make failed to build some targets (06:19:52 (hh:mm:ss)) ####
And I had downloaded the source code mentioned for the snapdragon8074.
I ran the following commands to build
$ source build/envsetup.sh
$ lunch msm8974-userdebug
$ make
Can anyone kindly help with the issue?
Thanks
You need to add USE_OPENGL_RENDERER := true to your BoardConfig.mk (in your case this file is under device/qcom/msm8974).
This is so because on modern builds of Android hardware accelerated graphics are pretty much mandatory. See here.
As a side note, for Code Aurora you should be using choosecombo instead of lunch (in your case choosecombo 1 msm8974 2).

How to test android Goldfish Kernel 3.10 on Versatilepb Suported QEMU?

I'm trying to port Android on VersatilePB using [Android Goldfish 3.10 kernel](https://android.googlesource.com/kernel/goldfish/+/android-goldfish-3.10).
First, I configured kernel for versatile_defconfig and I successfully built it. I got .config file, renamed it as versatile_config and added Android base configuration to that using the following command
ARCH=arm scripts/kconfig/merge_config.sh versatile_config android/configs/android-base.cfg
Again, I built the kernel successfully. After that, I built the Android Google source code and I have taken ramdisk.img from google_src_v4.4/out/target/product/generic. After that, I tested using following command,
qemu-system-arm -M versatilepb -kernel ./arch/arm/boot/zImage -initrd ramdisk.img -append "console=ttyAMA0 root=/dev/ram0 rw" -serial stdio
but I'm getting the following error. Kernel panic - not syncing: Attempted to kill init! exitcode=0x00000004
CPU: 0 PID: 1 Comm: init Not tainted 3.10.0 #15
[<c001271c>] (unwind_backtrace+0x0/0xe8) from [<c001129c>] (show_stack+0x10/0x14)
[<c001129c>] (show_stack+0x10/0x14) from [<c0368304>] (panic+0x8c/0x1d4)
[<c0368304>] (panic+0x8c/0x1d4) from [<c001fe94>] (do_exit+0x7f8/0x8d8)
[<c001fe94>] (do_exit+0x7f8/0x8d8) from [<c001ffe0>] (do_group_exit+0x40/0xd4)
[<c001ffe0>] (do_group_exit+0x40/0xd4) from [<c002a75c>] (get_signal_to_deliver+0x178/0x5c4)
[<c002a75c>] (get_signal_to_deliver+0x178/0x5c4) from [<c00109a4>] (do_signal+0xd0/0x434)
[<c00109a4>] (do_signal+0xd0/0x434) from [<c0010ea4>] (do_work_pending+0xa8/0xb8)
[] (do_work_pending+0xa8/0xb8) from [] (work_pending+0xc/0x20)
Somehow related to the "init()" function, where kernel is trying to create the very first process (in userspace) for the first time - this is also where LInux and Android differs. So did you use the QEMU from Android?:
https://github.com/android/platform_external_qemu
And see the discussion here:
https://balau82.wordpress.com/2010/03/22/compiling-linux-kernel-for-qemu-arm-emulator/
there are some hints here:
Run Android app in qemu-arm?
And here has commandline for emulation:
How to compile android goldfish 3.4 kernel and run on emulator

Qt Sensors Qml compile error

I am looking at the example application for the Qt Sensors that comes with qt and I've complied it on windows with no errors, but as soon as I try to put it onto my android I get this compile error.
10:41:51: Running steps for project qmlqtsensors...
10:41:51: Configuration unchanged, skipping qmake step.
10:41:51: Starting: "C:\Qt\Qt5.2.1\Tools\mingw48_32\bin\mingw32-make.exe"
mingw32-make: Nothing to be done for 'first'.
10:41:52: The process "C:\Qt\Qt5.2.1\Tools\mingw48_32\bin\mingw32-make.exe" exited normally.
10:41:52: Removing directory C:\Qt\Qt5.2.1\5.2.1\android_x86\examples\sensors\build-qmlqtsensors-Android_for_armeabi_v7a_GCC_4_8_Qt_5_2_1-Release\android-build
10:41:52: Starting: "C:\Qt\Qt5.2.1\Tools\mingw48_32\bin\mingw32-make.exe" INSTALL_ROOT="C:\Qt\Qt5.2.1\5.2.1\android_x86\examples\sensors\build-qmlqtsensors-Android_for_armeabi_v7a_GCC_4_8_Qt_5_2_1-Release\android-build" install
copy /y "libqmlqtsensors.so" "C:\Qt\Qt5.2.1\5.2.1\android_x86\examples\sensors\build-qmlqtsensors-Android_for_armeabi_v7a_GCC_4_8_Qt_5_2_1-Release\android-build\libs\armeabi-v7a\libqmlqtsensors.so"
1 file(s) copied.
The full path of C:C:\Qt\Qt5.2.1\5.2.1\android_x86\examples\sensors\build-qmlqtsensors-Android_for_armeabi_v7a_GCC_4_8_Qt_5_2_1-Release\android-build\Qt\Qt5.2.1\5.2.1\android_armv7\examples\qtsensors\qmlqtsensors is too long.
makefile:873: recipe for target 'install_app' failed
mingw32-make: *** [install_app] Error 1
10:41:53: The process "C:\Qt\Qt5.2.1\Tools\mingw48_32\bin\mingw32-make.exe" exited with code 2.
Error while building/deploying project qmlqtsensors (kit: Android for armeabi-v7a (GCC 4.8, Qt 5.2.1))
When executing step 'Copy application data'
10:41:53: Elapsed time: 00:02.
I've looked on google with no avail. Can anyone help me with this problem please?
It seems the error or at least one of them is because the path to your file qmlqtsensors is too long.
The full path of C:C:\Qt\Qt5.2.1\5.2.1\android_x86\examples\sensors\build-qmlqtsensors-Android_for_armeabi_v7a_GCC_4_8_Qt_5_2_1-Release\android-build\Qt\Qt5.2.1\5.2.1\android_armv7\examples\qtsensors\qmlqtsensors is too long.
Try to compile and run your project at a different location with a shorter path.
I get the error on this example (and had the same on previous examples some while ago).
My problem turned out to be that when the Makefile is generated, it generates 'wrong' code. It generates stuff like:
mkdir C:$(INSTALL_ROOT)/........
which is fine if $(INSTALL_ROOT) evaluates to a relative path but in fact it resolved to an absolute path, that is:
mkdir C:C:/Qt/.......
So simply edited the Makefile replacing all occurrences of 'C:$(INSTALL_ROOT)' with '$(INSTALL_ROOT)'. It worked for me and hopefully you too.

Categories

Resources