Android Kernel Configs - android

I am a newbie in Android13 I have setup the AOSP by following steps-
repo init -u https://android.googlesource.com/platform/manifest -b android-13.0.0_r31
repo sync
source build/envsetup.sh
lunch aosp_cf_x86_auto-userdebug
emulator
But I am getting following errors:
> WARNING: encryption is off
> WARNING: lavapipe is not a conformant vulkan implementation, testing use only.
> WARNING: Ignoring invalid http proxy: Bad format: invalid port number (must be decimal)
> INFO: IniFile.cpp:177: Failed to process .ini file /home/dsx1pu/.android/emu-update-last-check.ini for reading.
> WARNING: UpdateCheck: Failure: Error
> WARNING: UpdateCheck: failed to get the latest version, skipping check (current version '30.3.0-6946397')
> WARNING: UpdateCheck: Failure: Error
> ^CSaving state on exit with session uptime 28291 ms
>
Note: I am working inside Virtual Box.
My requirement is I want to explore the automotive OS and to somehow build from source code and emulate any one of the product on my x86 laptop.
So I can experiment with the AOSP and see the effect on my emulated automotive device what are different approaches.
I was thinking if I can work inside qemu. Please suggest.
Also I see following options, what are these and how they differ:
aosp_car_x86_64-userdebug
car_x86_64-userdebug
what is the difference between the two?
Please excuse me if something is irrevalant in the question.
Please guide.. considering me as a beginner.
Also suggest any article or put some light on android build process.
Any knowledge shared or experience is highly appreciated.
Also to end I will be really thannkful if someone can suggest some forums and community to follow to acquire the knowledge of Android Automotive OS.
Thanks!

Related

recipe for target 'ninja_wrapper' failed / flex core dumps

First time android builder here. I used to do a lot of roll your own back on FreeBSD in the day. Getting back into geekdom with android.
I am trying to build android-7.0.0_r14 for the Nexus 6 NBD90Z to run under emulation. I plan to eventually build for my actual phone and this config is pretty close. I am building on ubuntu 18.04 LTS which is newer than what the docs recommend. Maybe that is a bit adventurous.
Here is what I get when I run make.
... snip
build/core/base_rules.mk:316: warning: ignoring old commands for target
out/target/product/shamu/system/lib/soundfx/libqcomvoiceprocessing.so'
Starting build with ninja
ninja: Entering directory.'
ninja: warning: multiple rules generate out/target/product/shamu/system/etc/gps.conf. builds involving this target will not be correct; continuing anyway [-w dupbuild=warn]
[ 0% 1/35600] Lex: libaidl-common <= system/tools/aidl/aidl_language_l.ll
FAILED: /bin/bash -c "prebuilts/misc/linux-x86/flex/flex-2.5.39 -oout/host/linux-x86/obj/STATIC_LIBRARIES/libaidl-common_intermediates/aidl_language_l.cpp system/tools/aidl/aidl_language_l.ll"
flex-2.5.39: loadlocale.c:130: _nl_intern_locale_data: Assertion `cnt < (sizeof (_nl_value_type_LC_TIME) / sizeof (_nl_value_type_LC_TIME[0]))' failed.
Aborted (core dumped)
ninja: build stopped: subcommand failed.
build/core/ninja.mk:148: recipe for target 'ninja_wrapper' failed
make: *** [ninja_wrapper] Error 1
A core dump for flex was not produced in spite of the error message given.
out/host/linux-x86/obj/STATIC_LIBRARIES/libaidl-common_intermediates/aidl_language_l.cpp does not exist. That entire folder is empty. It would seem that something is not downloading/copying the aidl_language_l.cpp.
Any ideas on what I might have messed up?
I am still a little confused at the complexity of git/repo/make/ninja/soong/lunch to conduct a build. It is likely that I missed something obvious.
Thanks,
Jason C. Wells
Just replace your make by export LC_ALL=C make or put the export in your .bashrc
After I looked at this a little closer I realized the prebuilt prebuilts/misc/linux-x86/flex/flex-2.5.39 would dump core with no arguments. I created a soft link to /usr/bin/flex. Compilation seems to be proceeding.
I haven't answered why the prebuilt was dumping. My goal is to compile android, not troubleshoot the tools.
I performed Snorky's steps. I deleted my output directory for libaidl-common_intermediates. I deleted my soft link and restored the android tree version of flex. I re-ran make at the top of the local repo. The build proceeded past the error above and stopped at a new error. It appears that Snorky's answer worked.
Doh! I'm new so S.O. didn't give credit for my upvote.

Xamarin MultiDex in VisualStudio 2015

Hi everybody I'm in a dead end!
Develop a PCL application using VisualStudio 2015, Xamarin and MvvmCross.
The Android app exceeds the 65K limit. I need to use Multidex!
For its implementation I have undertaken these guidelines:
Enabled checkbox for MultiDex
Extended MultiDexApplication class
General considerations:
Debug mode
MinSdk: 21
TargetSdk: 25
BuildTools: 23.0.3
Jdk 1.8.0_121
Xamarin.Android 7.3
Results:
"java.exe" exited with code 2. C:\Program Files (x86)\MSBuild\Xamarin \Android\Xamarin.Android.Common.targets 1965
<!-- Compile java code to dalvik -->
<CompileToDalvik
DxJarPath="$(DxJarPath)"
JavaToolPath="$(JavaToolPath)"
JavaMaximumHeapSize="$(JavaMaximumHeapSize)"
JavaOptions="$(JavaOptions)"
ClassesOutputDirectory="$(IntermediateOutputPath)android\bin\classes"
ToolPath="$(DxToolPath)"
ToolExe="$(DxToolExe)"
UseDx="$(UseDx)"
MultiDexEnabled="$(AndroidEnableMultiDex)"
MultiDexMainDexListFile="$(_AndroidMainDexListFile)"
JavaLibrariesToCompile="#(_JavaLibrariesToCompileForAppDx)"
OptionalObfuscatedJarFile="$(IntermediateOutputPath)proguard\__proguard_output__.jar"
/>
The error occurs during the compilation process.
I have consulted these sources:
"https://developer.android.com/studio/build/multidex.html"
"http://www.jon-douglas.com/2016/09/05/xamarin-android-multidex/"
"http://www.jon-douglas.com/2016/09/23/xamarin-android-multidex-keep/"
"https://przemekraciborski.eu/"
"https://forums.xamarin.com/discussion/64234/multi-dex-app-with-a-custom-application-class-that-runs-on-pre-lollipop"
"http://frogermcs.github.io/MultiDex-solution-for-64k-limit-in-Dalvik/"
I also have the ClassyShark.jar tool, but no dex or apk file is generated to explore it. Only the mono.android.jar file exists
Please I need help.
Thank you very much.
Responding to answer 1 and Luke Pothier's commentary are the results:
Setting output verbosity = Diagnostic
Case 1:
Using Android Sdk Location: C:\Program Files (x86)\Android\android-sdk installed with Visual Studio 2015.
4>_CompileToDalvikWithDx:
4> Creating directory "obj\Debug\proguard".
4> C:\Program Files\Java\jdk1.8.0_121\\bin\java.exe -Xmx1G -jar "C:\Program Files (x86)\Android\android-sdk\build-tools\25.0.3\\lib\dx.jar" --no-strict --dex --output= ...
4> trouble writing output: Too many field references: 68102; max is 65536.
4> You may try using --multi-dex option.
4> References by package:
(list of references by packages)
4>C:\Program Files (x86)\MSBuild\Xamarin\Android\Xamarin.Android.Common.targets(1965,3): error MSB6006: "java.exe" exited with code 2.
Case 2:
Using Android Sdk Location: c:\android\sdk with last proguard version 5.3.3 installed with Android Studio.
4>_CompileToDalvikWithDx:
4> Creating directory "obj\Debug\proguard".
4> C:\Program Files\Java\jdk1.8.0_121\\bin\java.exe -Xmx1G -jar C:\Android\sdk\build-tools\25.0.0\\lib\dx.jar --no-strict --dex --output=
4> trouble writing output: Too many field references: 68102; max is 65536.
4> You may try using --multi-dex option.
4> References by package:
(list of references by packages)
4>C:\Program Files (x86)\MSBuild\Xamarin\Android\Xamarin.Android.Common.targets(1965,3): error MSB6006: "java.exe" exited with code 2.
This is likely to be caused by an issue between Xamarin and ProGuard, the fix to which is detailed here. Essentially, you need to replace the proguard.jar file that is in your Android SDK directory with the latest one from SourceForge (v5.3.3 currently).
EDIT: Per the error messages in your edits, the --multi-dex option isn't being passed during compilation. I would check your Android .csproj to make sure that the <AndroidEnableMultiDex> option is set to True for all build configurations. If that doesn't help, you may need to upload a reproducible sample somewhere.
EDIT 2: Per the comments, your Android SDK location needs to be somewhere where the path does not contain spaces. Program Files is no good. Personally I put mine in C:\Android\android-sdk.
After adjusting the path to the android sdk, removing the spaces and setting in the project file for the Droid platform the property AndroidEnableMultiDex in all configurations (appeared AndroidEnableMultipleDex) in true, I was able to compile without errors. Also, I have been able to check the contents of the generated dex files and both have references to Mvvmcross.
When I execute the application, it shows the splash view (ok!!!), but, an exception occurs when processing the view (activity) that has a binded viewmodel. Now, the viewmodel has null value. (Until the moment of having to activate the multidex, the application executed without any incidence)
My challenge now is to know if all the reference to Mvvmcross should be in the main dex, or is it due to another problem that I have overlooked?
Thanks in advance for his time to #LukePothier.
My self response:
After compiling and generate dex classes:
use dex2jar & jd-gui tools following Jon Douglas' hints in http://www.jon-douglas.com/2016/09/23/xamarin-android-multidex-keep/.
be very patient and persevere.
remove innesesary code and plugin if you can do it yourself.
I already have the application running !!!

Cannot compile bazel needed for tensorflow-android

I'm trying to explore the tensorflow android demo. I want to adapt the app using android studio.
However when I simply follow the instructions I get compilation errors no matter what I do:
Trying to compile tensorflow using bazel and NDK r12b:
$bazel build -c opt //tensorflow/examples/android:tensorflow_demo
ERROR: /home/myUser/libs/tensorflow_android/WORKSPACE:3:1: //external:io_bazel_rules_closure: no such attribute 'urls' in 'http_archive' rule.
ERROR: /home/myUser/libs/tensorflow_android/WORKSPACE:3:1: //external:io_bazel_rules_closure: missing value for mandatory attribute 'url' in 'http_archive' rule.
ERROR: com.google.devtools.build.lib.packages.BuildFileContainsErrorsException: error loading package '': Encountered error while reading extension file 'closure/defs.bzl': no such package '#io_bazel_rules_closure//closure': error loading package 'external': Could not load //external package.
INFO: Elapsed time: 0.129s
Trying to compile a newer version of bazel following this advice:
$bazel version
Build label: 0.2.3-jdk7 // This is my current version of bazel
via apt-get:
$sudo apt-get upgrade bazel
Reading package lists... Done
Building dependency tree
Reading state information... Done
Calculating upgrade... Done
E: Unable to locate package bazel
from source (tried bazel-0.4.2 and bazel-0.5.0):
$./compile.sh
INFO: You can skip this first step by providing a path to the bazel binary as second argument:
INFO: ./compile.sh compile /path/to/bazel
🍃 Building Bazel from scratch
ERROR: JDK version (1.7) is lower than 1.8, please set $JAVA_HOME.
or
$bazel build //src:bazel
ERROR: /home/myUser/libs/bazel/bazel-0.4.2/tools/build_rules/genproto.bzl:45:16: Traceback (most recent call last):
File "/home/myUser/libs/bazel/bazel-0.4.2/tools/build_rules/genproto.bzl", line 42
rule(gensrcjar_impl, attrs = {"src": at..."), <2 more arguments>), "_proto_compiler": attr.label(default = Label("//third_party/p..."), <4 more arguments>), "_jar": attr.label(default = Label("#bazel_tools//t..."), <4 more arguments>), "_jdk": attr.label(default = Label("#bazel_tools//t..."), ...)}, ..."})
File "/home/myUser/libs/bazel/bazel-0.4.2/tools/build_rules/genproto.bzl", line 45, in rule
attr.label(allow_files = proto_filetype, sing...)
allow_files should be a boolean or a filetype object.
ERROR: /home/myUser/libs/bazel/bazel-0.4.2/src/BUILD:130:1: error loading package 'src/main/protobuf': Extension file 'tools/build_rules/genproto.bzl' has errors and referenced by '//src:embedded_tools'.
ERROR: Loading failed; build aborted.
INFO: Elapsed time: 0.251s
switching aroung java-versions to see whether the bazel compiling issues come from there:
$sudo update-alternatives --config java
There are 4 choices for the alternative java (providing /usr/bin/java).
Selection Path Priority Status
------------------------------------------------------------
0 /usr/lib/jvm/java-8-oracle/jre/bin/java 1074 auto mode
1 /usr/lib/jvm/java-7-openjdk-amd64/jre/bin/java 1071 manual mode
* 2 /usr/lib/jvm/java-7-oracle/jre/bin/java 1072 manual mode
3 /usr/lib/jvm/java-8-openjdk-amd64/jre/bin/java 1069 manual mode
4 /usr/lib/jvm/java-8-oracle/jre/bin/java 1074 manual mode
No luck so far :-/. Has anyone successfully compiled tensorflow for android from source?
What version of Tensorflow, NDK, bazel, java are required / compatible with each other? Do I really need bazel? (never worked with it anyway) Can't I just compile the android demo in android-studio like any other app?
I'm using Ubuntu 14.04, Cuda8.0, cudnn_v5.1, Titan X Pascal (not sure if these things matter)
Installing Bazel on Ubuntu can be done without compiling.
Follow all steps of the dedicated documentation: Install Bazel on Ubuntu

Installing compile samples 4.0 failed nvidia

While installing NVidia Android CodeWorks I have received an error at the very end of the installation process saying :
installing compile samples 4.0 failed nvidia
Return Code: 2Compile Samples failed. Please check the /home/user/NVPACK//_installer/compile.log. You can send it to TegraDeveloperPack-Users#nvidia.com if you can not resolve it.
Does anyone know how to solve this problem please
So that other people having the same problem might go on something for I have not found an optimal solution to this problem.
I have managed to solve it by simply copying my version of jdk (which is jdk1.8.0_101) to the specified Nvidia Codeworks folder and renaming to the one missing in the log (...\Nvidia\Codeworks_installer\compile.log - \Nvidia\Codeworks\jdk1.8.0_77" does not exist.) In my case it compiled successfully, however it must be noted that this is not a good solution. Messing around with the environment valuables might be a reasonable place to start otherwise.
If your log file shows:
Error: JAVA_HOME is not defined correctly.
make: *** [antbuild_Basic_debug] Error 1
We cannot execute /usr/bin/java
Makefile.Basic.mk:92: recipe for target 'antbuild_Basic_debug' failed
you can fix it by creating a soft link like this:
sudo ln -s $JAVA_HOME/bin/java /usr/bin/java

Kernel Configuration - Nexus Platform join failed

I am doing kernel configuration for ICS. I needed to enable Posix message queue as it is required in one of our applications. But enabling this option resulted in error. The make was successfull. But the image could not be loaded. The dmesg was:-
disagrees about version of symbol module_layout.
init: untracked pid 2038 exited.
logcat :-
mknod : '/dev/nexus_proxy' failed
NEXUS_Platform_Join [CONSTRUCTOR] failed.
Looks like you rebuilt only the kernel.
You need to build any kernel-modules (*.ko files) and
update them onto the filesystem.
Here is a detailed discussion on the disagrees about version of symbol error.

Categories

Resources