Breakpoints in Android Platform source - android

Using Intellj-idea I'm trying to debug into the Android source API 17 but when I set breakpoints in the platform source they are being ignored when run. Looking at the breakpoint whilst debugging there is a cross in it with a message stating "no executable code found at line 15,508 in class android.view"
I've tried running against an emulator with API 17 set as well as a phone with Android 4.2.2 but both don't work. I can sort of debug into the methods but the cursor jumps around.
So I'm guessing that there is no debug info as well as some optimisations that have gone on. So my question:
Is there a way I can properly debug the Android Platform from the perspective of my application and set breakpoints that work in it? Maybe a an emulator that has been been built with debug info?
Any help would be appreciated?
Regards
Lee

It depends on what application you are trying to debug: your own application, a system application such as android.process.acore.
To debug platform source running in your own application
The main issue is the line numbers of the platform source you have downloaded on your computer must match what is running on the device. Your best bet will be to debug on Google Nexus device such as the Nexus 5 or Nexus 7 since it should be running a compiled version of the source exactly as it was released by Google which you downloaded with the Android SDK. Just add the sourcepath to the sdk in IntelliJ, attach the debugger and set the breakpoint. Make sure you choose the same API level source as is running on the device. That should do it.
To debug platform source running in a system application
You will need eng build of the Android platform to debug system processes. If you haven't built and installed the Android platform before it is quite a bit of work and requires an unlocked bootloader. Maybe there are prebuilt eng builds of cyanogenmod or something that can be downloaded but I can't find any after some trivial Googling. You may also make an eng build of AOSP yourself and run the emulator on your machine. See Running emulator after building Android from source and the "Choose a target" section on the AOSP site for info on building your own eng build if you are feeling very ambitious.

Related

"App not installed" error on almost every device I try my Unity app

I made a very simple 2d game for android.
Build was success with 0 errors. I uploaded the .apk file to my drive. From there I downloaded it to my HUAWEI P8 (Android 6.0) old phone.
Everythings works.
I've downloaded it again to a LENOVO (Android 9.0).
I got "App not installed" error with nothing else. I tried several Android emulators. On every one of them I got "App not installed" error. On one of them I got "Your phone is not compatible" beside the other error and that's it.
Things I've tried:
Turning off Play Protect (from Google Play)
Allowing apps from untrusted sources
Cleaning more free space
Setting "Install Location" to Automatic (from Player settings)
Downloading/importing the .apk from somewhere else
Setting Android 9.0 as a Target version
Checking ARMv7 too as a Target architecture
After a long time wondering and playing with the settings I think its working now. Here are some of my options in the Player settings:
Scripting backend: IL2CPP
Api compatibility level: .NET Standard 2.0
Target Architectures: ARMv7, ARM64, x86 (deprecated).
Install location: Automatic
Write Permission: Internal
Beside the things I've written in the question I also checked all three architectures as targets (even the deprecated one). I've connected the tablet with USB in order to use Build and Run option and didn't see any error (when I later changed target architectures a error told me that I should target ARMv7 too) and everything worked as expected.
I later uploaded it to my drive again and installed it from there too.
I've tried & tested in emulators too (I think the deprecated architecture is used).
Hi I had Shared the steps, It will definitely resolve the issue regarding Unity App Not Installed
Check is you bundle identifier is same with previous build
PlayerSettings > Enable build il2cpp Armv7 and 64bit build and donot split the build
Assign the keystore and assign password
Set the player setting SDK Card to Automatic
Make Sure your previous build is assigned with same keystore
Target Api Level should be Equal or greater than previous one

Compiling Kivy project and run it with Android emulator

I am thinking of writing a simple app with Python+Kivy, mostly for my own use - nothing fancy. For development, I would like to be able to
Compile the app into a package
Run it on an Android emulator
Sadly, at the moment I cannot quite close the loop - and googling didn't help.
I believe I downloaded all the relevant tools: Kivy, buildozer, Android SDK. I typed in the Kivy 'hello world' app, and it runs fine without Android emulation - unfortunately, when running it under the emulator (with suggested architecture x86), I get an error INSTALL_FAILED_NO_MATCHING_ABIS. If I make an emulator device with an ARM architecture (which is pretty slow to run), I can at least install the app on the emulated device - but it crashes once loaded. Error message is not informative.
I am guessing somehow I need to build the package for the native x86 architecture (?) which is the recommended default emulator in the Android emulator wizard - is that right? If so, how do I do it with buildozer tool? Or maybe I can run it on the ARM architecture, without it crashing?
Some finer detail:
I am running on OSX
I am building the package with the suggested command buildozer -v android debug
To install the app, I drag it onto the emulator window (there probably is a better way..?)
The emulator is the one coming with Android SDK, I'm emulating the default 'Nexus 5X' phone
Android SDK version is 23
I suggest trying to install the app on a real device and connecting the device to your pc in debug mode and use adb logcat to get the log of the device to know what is causing the error. This way you can make sure if the problem rises from your code or your emulator environment.
Your setup sounds fine, the immediate problem is entirely the architecture (although the crash on your ARM emulator suggests that your app has a bug, which you can debug by checking out the logcat log).
python-for-android supports x86 and will work on the emulator this way. You can use this with --arch=x86. However, buildozer does not currently expose this option (it hardcodes armeabi-v7a). This wouldn't be difficult to fix, feel free to open an issue in the buildozer github repository about it.
I'll note that if you have a device available, debugging using that isn't really any different (or slower/faster) than using the emulator. Buildozer/python-for-android can push the apk and run it automatically, and viewing the logcat output works the same in both cases.

Missing files in android build for multi device hybrid apps

I am attempting to debug my application on my android device. running 4.1.2
The app builds and installs correctly but nothing displayed. I get an error message in the debugger that WinJS is undefined. so I check to make sure everything is referenced. and it appears all my scripts and files are not being added to the app package. This only happens when debugging on the android device the app runs fine on the ripple emulator and for windows phone device and windows store.
I have made sure the build tools revision 19 and all drivers are installed.
Please assist

qt for android doesn't find my physical device

I'm trying to write android applications with Qt5.1. I installed everything according to these instructions and I wrote my application and built it successfully. My problem is that when I click run on android version, instead of running the application on the device that I have connected or even asking whether I want to use the virtual device or physical device ( like eclipse does ) it just opens ADV.
I know I have connected my device properly because I can run applications I write with eclipse on my device. But not with Qt.
Can anybody help me?
Just in case you need to know I'm using the latest version of ndk and for sdk I'm using the one that comes with adt's latest version. If any other information I should provide please let me know.
thank you
I have had this problem as well, your device is not corresponding with the QT run settings. When you press run (probably in QT Creator?) it will search for devices which allow the application to run on.
There are a few possibilities when it comes to this:
Your device is not set up correctly:
run "adb start-server" and then "adb devices" in your command prompt. Does it say it found 1 device with status: "device"? If not your device probably doesn't have USB debugging enabled (you can enable this in the dev settings on your device).
You are building in the wrong mode:
Make sure you are creating a program for ARM (ARM GCC 4.7 QT 5.1 for example).
Deploying for the wrong API level:
Are you running the program on a device that supports API level 17 ? If not you can change these settings (API Level) in your QT project settings.
You don't have the recent API level installed:
Start the android sdk manager and download + install the new API's.
It worked for me after performing these steps, should you have any other difficulties feel free to ask!
Edit
If these steps did not work check if your android sdk is located in a location with write permission.

apk build by corona is not install in device

I am new with corona developing.
I am creating a new project and them build as android apk target 2.2.
It will make build successfully bt if i run this build on my device it shows "not installed".
I am using trial version of corona is this make a problem?
Thanks for your valuable time.
When I had a similar problem, it was because the architecture on my device wasn't ARMv7.
The developers behind Corona have made these points regarding Android deployment:
You do not need to install the Android SDK. However, you will need to install the x86 (32-bit) version of the Java 6 Development Kit if you're using Windows. Corona does not support JDK7. See Java Development Kit Setup for details.
The Android build process generates a standard .apk file. You can build and test apps on Android devices without creating a Google developer account, but you will need an account if you wish to publish to the Google Play marketplace. The current price of the program is $25, mandated and managed by Google.
We only support Android devices that run Android 2.2 or higher with an ARMv7 processor. This can create some confusion because ARM processors are identified by both a family and an architecture. Family names do not have a "v" in them. For instance, the ARM7 processor is actually a ARMv3 architecture, and ARM11 is a ARMv6 architecture. See this guide to help identify the various processors.
Source: http://docs.coronalabs.com/guide/distribution/androidBuild/index.html (worth a read if you haven't seen it already)
Download some app to your device like app manager or Es File Explorer(
https://play.google.com/store/apps/details?id=com.estrongs.android.pop&feature=search_result#?t=W251bGwsMSwxLDEsImNvbS5lc3Ryb25ncy5hbmRyb2lkLnBvcCJd)
And open that app, select your .apk file, and there u can install it.
Good luck ;)
I find the simplest way is to just attach the .apk file to an e-mail and open the attachment in Gmail on the phone.
You can build for Android using the Trial version of Corona. Just use the default key. (I might have enabled a setting under Apps to allow installing apps from outside Google Play, I don't remember.)
I had to install my app via a adb console with my phone's USB debugging turned on for it to work.
The command was:
[path to adb.exe] install -r [path to apk file]
I've had this problem before so I will share you my experience.
It could be one of two problems:
Your device isn't ARMv7. That means it needs to be 2.2 or higher. I would recommend using Android 4.0 or higher for a test device, that's just my opinion though.
You could have a syntax error or you could be requiring a document that doesn't exist. In some rare instances Corona doesn't detect the error until it's on the device. To see what the error is, run adb logcat.
Let me know if this works for you :)

Categories

Resources