Even if I create a new project I can't run it on API 23 and above. I have received only "waiting for target device to come online". Lower versions(22 and so on) work perfectly, they compile, run, I can create projects on them. I don't understand what could be the reason that for some API an empty project won't start.
I'm on Android Studio on Ubuntu. I tried basic solutions like updates, re-installing SDK Tools, e.t.c. I have tried on many emulators and versions. The amount of RAM is also not a problem.
What could be causing this behavior? what is the problem? How i can fix that?
Related
new freelancer dev here.
I've been developing an Android App with Android Studio as apart of some freelance work I've been doing. I do all my testing and debugging on a virtual emulator of an android device while my client reviews the app on his tablet after the testing is done. With this latest version, everything worked perfectly on my emulator, but the app won't even start on my client's tablet. He tried testing the app on a different tablet and while the app runs, it doesn't function properly (Such as buttons not running different methods, crashing after specific inputs, etc.). We are both very confused at what is going on and don't know how to begin tackling this problem. Previous versions of the app work, but they do not have all the required functionality. Nothing major a lot was added or changed from the last version and this most current version. The app has worked on a variety of different emulator settings as well.
I am using the Android Studio built in emulator tools for testing and using Android Studio as my IDE. My app is written in full java while using XML for the layouts of the different pages of the app.
I'm not looking for any immediate fixes/solutions, but more of a general direction to go, because I don't even know how to start fixing this issue.
Also, I'd like to reiterate, previous versions of the app have worked perfectly fine, and all versions of the app work fine on my emulator. The most recent version only fails to start/run properly when run on my client's tablet(s).
I've tried matching my emulator to my client's tablet as closely as possible to try to recreate any potential issues, but I haven't been able to get any of the errors or bugs to appear during debugging. Since we're pretty far apart, I haven't been able to have access to either of the two tablets that he has tried running the app on. My client formatted the original tablet that he was using to test the app but is still having the same issue of the app not starting.
We are debugging an issue with one of our apps which affects only Huawei devices. To debug it, we purchased P20 Lite ANE-LX1. We've placed some breakpoints in our code and are investigating the full stack trace. The device has Android 8.0 installed, and we have the same SDK downloaded in our Android Studio.
When we attach our device to a debugger and try to investigate the stack trace we get the following errors in system source files:
After playing with the stack trace, we can confirm that indeed our source files do not correspond to what is installed on the device. Sometimes, the debugger points to a line where functionA is called, and in the stack trace, we see that functionB is called instead. The files which we could confirm are affected by this issue are:
VideoView,
MediaPlayer,
ContentProvider.
We've tried all the possible solutions which we could find, including cleaning the project, deleting any additional SDKs from Android Studio, modifying project settings - nothing helps to resolve this issue.
This leads us to believe that Huawei installs a modified version of Android 8.0 on their devices which is why we cannot debug the stack trace for the system files. We did contact Huawei to try and clarify this.
In the meantime, we'd appreciate if you could throw any relevant ideas at us. Maybe you know where to get the source files which Huawei installs on their devices? Or maybe you know how to fix this mismatch between source code and bytecode in some other way?
Update 1
Following the advice of Robert, I uninstalled the source codes for Android 26 and ran the app again on my Huawei. As soon as I jumped into the VideoView file, I saw the following picture:
I clicked on "Download" and it started downloading the source files:
After this, I was able to step into VideoView and it seemed to work fine. However, after this line it became obvious that these source files are also wrong:
When I try to step into the requestLayout function I get this:
And it is obviously a wrong result. In fact, if I click on "Step to the next line" I see the message about source code mismatch with the bytecode again.
Apparently Huawei forked AOSP and modified it's sources. This is what many manufacturers do and it's perfectly fine as long as source passes the Compatibility Test Suite. I myself saw encrypted video playback issues on Huawei P20 related to their approach to customizing the ROM.
But getting back to the point - you can get the exact framework code running on your device from /system/framework/arm/boot.oat or boot-framework.oat or /system/framework/boot.vdex. I don't know exactly how these files are structured but it varies between Android versions and between manufacturers. Once you get these files by adb pull (You surely need root to do this) you can perform oat->dex, dex->jar using dex2jar or other tools and you'll get the source. Traditionally it was possible to get framework code from /system/framework/framework.jar but after ART was introduced these files are often empty on system images and precompiled framework code is used instead.
I believe I ran into a similar issue on my phone, but I am using a Google Pixel. I was initially concerned that the phone was compromised somehow. I think it is less likely an issue with Huawei and more likely an issue with Android Studio not keeping the source packages up to date. Your Component Installer screenshot shows Android Studio downloading revision 1 of the SDK Source - yet most SDKs are using a later revision.
I detailed the solution to my problem elsewhere on StackOverflow: Source code does not match the bytecode for Android's View.java
I have been developing an application via Android Studio for some time and testing it on my phone (Galaxy S5 Active) using the app-debug.apk file. I would update the .apk then send it to my email.
On my phone, I would download and install the app and test it to see how it works.
Recently, however, I get an error:
Describe
There is a problem parsing the package.
Before, my phone would warn me about installing apps from unknown sources, to which I would just turn off the warning and it would install anyways. It no longer makes it to that point.
The odd thing about this is, other people are able to install the app still. My phone seems to be the only one that no longer wants anything to do with it.
I have looked into other options but none have seemed to fix my issue. I tried using AndExplorer to install it, same error. Ive uninstalled the old version. Ive even tried installing a different application that I made quickly to test.
Any thoughts on what the issue is?
I'm trying to use Bluecove for an application I'm writing. Version 2.1 of the jar didn't work, so a little Google showed me that it had always had issues with x64, so I turned to the latest 2.1.1 "snapshot", and I still get that the bluecove_x64 dll is missing. Am I doing something wrong, or should I just look for another API?
I encountered this problem after installing a vendor's bluetooth stack and management utilities. My java app which used bluetooth worked fine before this, after the install I got the bluecove_x64.dll not found error. After much searching, I reverted to an earlier system checkpoint (before I tried installing the "newer" bluetooth) and all was back to normal.
On another system, the toshiba bluetooth software had already been installed. I did a system checkpoint (in case the following was to not work), then went into the device manager, and uninstalled every "device" under bluetooth. Be sure to check the "delete driver software" box too, or they will come right back.
After this, the bluetooth device will appear to be gone. Go to the top of the tree, right click, and do "scan for hardware changes". This should install the Microsoft generic bluetooth drives which then work (for me) just fine on Win7_x64. If this doesn't install them, then you may try searching for a download, or another stack.
I've turned on USB debugging. I have the latest HTC Sync and android SDK components. I'm using Eclipse 3.5 on windows XP. I'm running Android 2.2, and am asking for 2.1 as the minimum in the debugger. I work in Eclipse/Java just about every day, and have for several years. I'm even writing an Eclipse plugin at work as I type this.... neither Eclipse nor Java are new to me by quite a stretch.
When I start a debug session for the "Skeleton App" sample project, I can see my Evo, and the activity launches (with any freshly saved changes), should I select it.
BUT: my breakpoints are ignored, and logCat doesn't see my app's output(see comments below).
*W*hat a *T*errible *F*ailure (As the api so artfully puts it)!
(oh look... a formatting bug. Looks like bold text wants white space to function properly 10/15/2010)
I have tried different android connection types (charge only, disk drive, HTC Sync, and USB tethering) to no avail. I've tried Eclipse 3.6 for a bit before yielding to the inevitable and reinstalling 3.5. I monkeyed with the emulator for a while but ran into a different set of issues (I had to reboot the emulator every time I wanted to make a change... Eclipse's auto-build/hot-swap has me spoiled).
Is there something I can add to (or remove from) the AndroidManifest.XML to deal with this? A magical incantation perhaps? Must I pray towards San Jose three times a day on a rug woven from kernel gurus' vast and scruffy beards? Is my Evo not Kosher? Must I be "sky clad" while debugging? Shall I teach my laptop to genuflect?
Have you followed all the points from here ? You need to set a flag in the manifest and also enable debugging on the actual device.
I found the solution to the debugger issue. Google comes through again:
I found an IOException hiding in my DDMS log: Address family not supported by protocol family: bind
Googling for that, plus "android" turned up the answer in the first link. Windows Vista specifies "localhost" as ":::1", but android doesn't really support IPv6 yet. Changing localhost to "127.0.0.1" resolved the issue.
This is defined in c:/windows/system32/drivers/etc/hosts. I needed to run notepad "as admin" in order to save the changes.
I also have an HTC Evo 4G, and have been having the same debugging problems with Eclipse Helios (3.6). I just learned to use this debugger a day or two ago, and it worked fine. I noticed that there was an automatic Android OS update in the last day or two, also. Perhaps this is just a coincidence.
BUT - my beard was indeed scruffy yesterday, as you suggest, and the debugger was working. I've since shaved. Bad idea, apparently.
Butt seriously - I powered down both Evo and computer (HP running Vista), removed battery from both, then started over. Same result, that is, no debugging.