Building android source and flashing it in emulator - android

I'm trying to build Android Nougat source following the instructions provided here. For the source code and tags I'm not sure what to opt for so I opted for,
N2G48H android-7.1.2_r36 Nougat 2017-10-05
make is successful it created image files within out/target directory. When I tried to flash it on emulator by simply typing emulator I'm seeing some weird device like this.
Got doubted on my target device type so tried following the instructions provided in this answer but still I'm seeing the same weird screen. Any help on this would be much appreciated.

Related

Lime 5.2.1 / Android 4.3 : dlopen fails on stpcpy

I'm trying to build an empty HaxePunk project for Android to test the build chain, and while I'm never getting any error, all my attemps have crashed at run time with the same error message :
Error: dlopen failed: cannot locate symbol "stpcpy" referenced by libzlib.so...
I am running the executable on a pretty old phone with Android 4.3 on it ; a Sony Xperia M.
I have been doing a bit of research, and so far I mostly see the same things being repeated : update your NDK (I've been using the latest one from the android dev website and not the one lime setup android downloads), build for previous API versions (which I am also doing with <config:android target-sdk-version="18" /> in my project.xml file). So I don't know what I'm doing wrong, if anything.
Another thing I found is that I'm using the git version of HXCPP, and when I built the Android libs with neko build.n android in the project subdir, it was using -DHXCPP_ANDROID_PLATFORM=26 whereas the Lime build of my project is using -DHXCPP_ANDROID_PLATFORM=9, so that can't be good. However, I don't really know much about Android at all, but I have read that the SDK version and Android platform are two different things, or so I've read.
Any help with this will be much appreciated.
EDIT : Okay so something weird happened : up until now I was trying to install the APK manually by copying it to my phone's files and launching it from there, which kept crashing. I tried lime test android once without changing anything at all and it worked fine, and from then I could manually install the APK like I used to, and the error never happened again. I can't replicate it, but it's still an open case.

Error while running app in android emulator

So I have just started my first app in which I have a button and when user clicks on it then it just print the message.
But when I build the app and when I run that app on android studio's console then after opening it crashes and then it stops working.
Meanwhile I have searched for the error and they suggested me to see logcat table or the text file in which I can easily see the errors but after it I am stuck because I have no idea that how can I solve such problem.
Please help me with it.
Not sure how capable you are with android and you haven't given us much info to work with.
could you post a brief description of the logcat from launching the apk to the apk actually crashing?
the logcat is gonna be the best option to diagnose it.
Are you using the android sdk and emulator?
Have you updated the resources and api's?
If you go into the resource list there should a online repo with a whole lot more SDK bits you might find help.
What api's and android version is your apk built from and is your emulator emulating the same android build?
Could be the apks GUI resolution or script related, have you checked through it all?
Microsoft visual studios has a very good debug system and trouble shoot but I'm not sure if android is compatible as I've only used wp8 on it. Worth finding out though.

Unable to view HTML trace report generated by Systrace tool in Android SDK

I am trying to generate trace reports with Systrace tool in the Android SDK, but I cant view the report in the browser. It is blank and does not contain any information. I read in some forums that I need to open the report in Chrome browser, I opened it with Chrome as well but the report is blank.
I have enabled USB Debugging from the Developer Options and device is running Android 4.2 and I am using DDMS tool from the Android SDK to generate the traces.
http://developer.android.com/tools/help/systrace.html
Firstly, if anyone is using Chrome v50.0+ on OS X or Windows, just try this please.
open chrome browser and go to "chrome://tracing"
in the tracing page, click load and select the systrace generated html file.
Secondly, I think it's a bug which is confirmed by Google.
It looks like this is because modern versions of Chrome have deprecated the Object.observe function[1][2].
For more information, please see this, https://code.google.com/p/android/issues/detail?id=57135
I also have this problem running chrome on linux.
It seems they have bug in the implementation of javascript drawing the results.
Check JavaScript console.
Mine says.
Uncaught TypeError: undefined is not a function
On Windows , I just can see the result by doing this:
get the trace.html
open trace.html with chrome browser and open the chrome's developer tools then i find out there is 3 error in trace.html
showing like this
go to the error line ,then comment the error function
like this
save the modified html then refresh chrome , you can see the trace result
This is just not the best solution, but any way we can see the result.
I was having the same issue when capturing through eclipse on Ubuntu 12.04.
Worked around it by running the tool directly from the systrace folder (sdk/tools/systrace/)
./systrace.py -t 5 -o trace.html
Update your SDK using SDK manager, select tools and platforms tools to be updated.
Follow the normal procedure, and that's it. Chrome is recomended to see results.
I solved this issue just by updating the SDK, use the SDK manager select tools and platform tools for update and you're done. Python script doesn't work on Windows.
However even if the trace.html is generated and it can be seen, when data overflows, it is not possible to see the bottom part of the page. This because wasd navigation is not enough making the use of the scroll bar needed.
To do this you need to:
If you're in Linux modify the Python script and eliminate the overflow:hidden wherever is found.
If you're using SDK, edit the trace.html and eliminate the overflow:hidden wherever is found.
Hope it helps, it'll be nice that someone in Google can fix this on the source.
I just found the my trace.html, which failed to open in IE/Firefox/Chrome, opened fine in the latest Opera (on my Windows PC).
For me, it didn't work on Firefox v34 but worked in Chrome v37 and I am on Ubuntu 12.04.
I also faced similar issues while trying to open a Systrace generated html file (around 10 MB ) on Firefox 37.0.1. However the same file works brilliantly on Chromium Version 37.0.2062.120 Ubuntu 12.04 (281580) (64-bit).
I've done following:
cd $ANDROID_HOME/platform-tools
git clone https://android.googlesource.com/platform/external/chromium-trace/
mv systrace old-systrace
ln -s chromium-trace/catapult/systrace/systrace/ systrace
that fixed my systrace issue
systrace report work in latest chrome at least
You can try my sample trace.html file to check if your Chrome version is okay or not.
https://github.com/tngotran/systrace-android/blob/master/trace.html
Also here is a link to the official trace.html sample from Google https://source.android.com/devices/tech/debug/perf_traces.zip
By the way, from my experience, the command tool python systrace.py can create an output file trace.html without error, but result is an empty file (even the file size is larger than 5Mb or more).
We have to:
Run the command adb root from your terminal to restart adbd as root
Run the python systrace.py again
Then check your created report .html file in Chrome :)
Suggestion: Try to trace an emulator (they are for development)
The issue may be manufacture customization to the Android OS, making the problem potentially a device configuration issue caused by the manufacture.
There are several answers that may be helpful here.
None of these worked for me... but because of answer https://stackoverflow.com/a/52379567/1815624
I found that it would load data by using the linked trace files:
Also here is a link to the official trace.html sample from Google
https://source.android.com/devices/tech/debug/perf_traces.zip
Using adb root did not work.
On a different device it worked flawlessly right off as well as using an emulator.

Android Building From Source error: could not load boot.img

I have followed the instuctions as posted on http://source.android.com/source/index.html to build an Android Source Environment. I am using Ubuntu 10.04. The process went without problems. After hours of downloading the Source Tree (I Have tried several including 2.1 and 4.0.1) and execution of the make command all image files were created in the directory '/WORKING_DIRECTORY/out/target/product/generic' except the boot.img file. I read across the internet that it is possible to create an own boot.img file using 'mkbootimg'. However I would like to avoid this in first place and use this option only as a last resort, because I am not familiar with the process as it requires some header files I am not certain of where to find them. I am curios why the boot.img file was not created.
Is somebody facing the same issue or maybe has solved the issue?
Best Regards
You've built your image for an emulator. Thus, you not need an boot.img to run an emulator and that's why it is not in your directory. You should make build for a particular device. If this device is Google device you'll have no problems - just follow the instructions on the webpage: http://source.android.com/source/building-devices.html

Application crashes in emulator when loading native shared library, but works fine on a physical device

The header pretty much explains the issue. I'm getting "Unsatisfied link error" on emulator. What could be the cause and what are the possible solutions?
Some time ago, when we started developing the app, it did work fine on emulator, and one day just stopped. It happened on at least two independent machines.
Ideas, anyone?..
Update: created a new emulator - same thing.
Problem solved! it appears, Android QUEMU emulator only supports ARM5 (APP_ABI:=armeabi), and my library was compiled with armeabi-v7a.
Update: the problem no longer exists.
You should check the following :
Using adb shell go in to the sys/lib/ folder and check if your library was copied there
Did you change the package of your class or did some refactoring? If you did and didn't updated the .cpp file this is causing the unsatisfied link error.
You can also try to manually load your library using System.loadLibrary("myLib");
You could also try to create a new emulator, maybe it got messed some how. Happens a lot.

Categories

Resources