Xamarin Android Debugging Issue in VS 2017 - android

We want to debug our android app with the real device but the project contains unmanaged projects (cpp pojects) and I think that this causes the problem.
We have the latest VS version (15.8.4) and when we try to debug, nothing happining after deploying. In the output window, we see
Start debugging Android application ...
Starting Android application ...
A colleague could debug but after he updated the newest VS, he cannot debug as well and we do not know his VS version.
Is there anybody faced this problem?
OS: Windows 10
Android API: 24

Related

Android studio 4.1 emulator crash

I just upgraded my android studio to 4.1 version:
And tried to run some project on this emulator:
And for some reason, this specific emulator is crashing my android studio, I have noticed that I am getting an error:
After reading about the subject, I uninstalled "Riot Vanguard" but it did not solve my problem.
More info (and partially solving the problem ) can be found in "Update" at the bottom of the question.
In addition, moments after my android studio will get closed I will get a windows blue screen (happens every time).
I didn't have this problem earlier with android studio below 4.1 version, why is this happening?
Update (problem solved for others emulators)
I have run into the same problem on other emulators as well, but I could open those emulators so I could fix the problem:
Solution 1
According to most threads that I have run into, You will need to disable or uninstall "Riot Vanguard":
Open task manager, go to the startup tab, right click on Riot Vanguard, and press disable
Solution 2
If step 1 didn't fix the problem you may want to enable developer mode on your emulator.
For some reason with android studio 4.1 android studio could not find the emulator (It will tell you that there are "No connected devices") without enabling the developer mode
Before Android studio 4.1 version I didn't need to enable the developer mode to run projects on emulators and this is what solved the problem for other emulators for me.
BUT
Although I don't have any problems with other emulators at all I still can`t even open Pixel_3a_API_30c68 emulator without it crashing
How can I fix this problem on the specific emulator?
Update 2
The problem still occurs even After updating android studio to 4.1.1
Without having "Riot Vanguard" I also could not run any emulator in Android Studio since I upgraded to version 4.1. After some hours I finally found out what caused the problem (in my case):
"Android SDK Tools" have been replaced by other SDK tools (which ?) and is obsolete now. As soon as I UNINSTALLED "Android SDK Tools" the emulator worked again.
I would be interested to know if the java version makes a different. I moved from Windows to Linux because of problems running the emulator.
Linux worked great until I moved to Android Studio 4.1. So check java and it was version 11. Changed to java8 and it worked straight first time.
Seem to remember there was a setting in Android Studio to set the SDK which I think was version 8. But can no longer find this in settings in Studio 4.1.
Updating to the latest system image of the SDK helped me.

Android Studio refuses to build and install any app on my phones

Since the time I have updated android studio to 3.5, I have been unable to run any app on multiple of my physical phones (Redmi Note 4 and OnePlus6). The app isn't installing on any of them. But it is installing on the emulated devices of the same respective versions (Android 24 and Android 28), so it is not an issue with the code.
Moreover, I tried to build the previous versions of my app stored on Git, and now Android Studio does not build the app showing - "linking error". While that same code version was working fine a few months ago (prior to the android studio update). Which is why I think the problem is somehow with the Android Studio and not the code...
Things I have tried
Disable instant Run (Not an option anymore in Android Studio >=3.5.1)
Enable USB debugging, connect using the device using "Transfer Files" mode and not "Charging Device" Mode
Turn off MIUI Optimization and Reboot
Uninstall App and re install
Build the apk, transfer the apk to the device and then try the install (This works on OnePlus 6 but not on Redmi Note 4)
The apps I have tried target Sdk >=27, and use androidx. However, I tried to go back to a previous version of the app, which didn't use androidx (and used the legacy support libraries), but still got the same error.
My system is Ubuntu 18.04, and current Android studio version is 3.5.3
Errors I have been getting include:
INSTALL_FAILED_USER_RESTRICTED
Device Not Found
UPDATE:
- Just tried to install on OnePlus6, doesn't install there as well. Earlier I had tested only for Redmi Note 4.
- Tried uninstalling and reinstalling the app, building the apk and
transferring on the phone then manually installing.
- This is happening across projects, at least for Redmi Note 4. I tried this with one of my course projects, same/similar problems.
My guess is problems with Android Studio update and the recent migration to androidx from the "legacy" support libraries
How I solved it:
Disable "Use libusb backend" in the Settings -> Build, Execution and Deployment -> Debugger
Sorry Android Studio 3.5 for the curses
How I found the solution:
I checked the logs of android studio by going to Help -> Compress Logs and Show in Files. In the folder which opened, I saw the logs by the name adb.1000.log (because adb - android debug bridge, handles the communication with the device). In the last few lines I saw - "read transfer failed: LIBUSB_TRANSFER_CANCELLED". I read here about the option of libusb
Did you try to clean/rebuild... under /Build/Clean Project, after that /Build/Rebuild Project and after cleaning and rebuilding you can try under /File/Invalidate caches

Visual Studio 2015 / 2017 unable to debug Android Application on Android 8.0 devices

I have been using Visual Studio 2015 / 2017 for Android application development for few years. I can deploy and debug my android apps on an Android 7.0 device without any problem. However, right after I upgraded my phone to Android 8.0, the deploy / debug operation failed with the following error message:
Could not install application 'com.omnigsoft.gameenginedemo' (my apk file path ...) on the device 'CJL5T16107010699'. Installation succeeded but the applications was not found on the device.
My android app is actually installed on the device successfully (I can start it on device manually) but it seems like that Visual Studio can not list and find the installed app (by ADB shell / pm list command), as the result, I'm unable to start debugger to debug my app on Android 8.0 device.
I notice there was another developer reported the same problem but got no answer. I'm frustrated by this right now, many thanks for any suggestions!
I finally solved the problem.
It turns out that this is an obvious bug in VS 2015 and VS 2017 (version 15.5).
Luckly, VS team has fixed this bug in the latest version so the simple solution is update VS with the latest version 15.7 update 2 (aka 15.7.2) from the official site:
https://visualstudio.microsoft.com/thank-you-downloading-visual-studio/?sku=Professional&rel=15#
Interestingly, here is what I found the bug is, in VS 2017 earlier versions, create a simply Android app named "Android1", when build and deploy to an Android 7 device, the app package is installed as:
package:/data/app/com.Android1-1/base.apk=com.Android1
When deploy to an Android 8 device, the package is istalled as:
package:/data/app/com.Android1-GLGROUzYL85gF8mDWG9J6A==/base.apk=com.HelloAndroid1
Oviously the strange surffix "GLGROUzYL85gF8mDWG9J6A==" appended after the installed folder make VS unable to detect the installed app package, then it reports deployment failure.
I use ADB command "adb shell pm list packages -f -3" to list installed apps on device, I guess VS does the same thing.
Anyway, it is fixed in VS 15.7.2. Cheers!
Update:
The app package installation path still contains sort of encrypted string on Android 8 deivce, buy VS now can detect the app package anyway.

Visual Studio 2017 - Xamarin shows device as Android Version 7.99 instead of 8.0

I'm trying to debug a Xamarin App on my Google Pixel with Android 8.0 installed. When I deploy, Xamarin says it is Google Pixel (Android 7.99).
When I debug, it says unable to connect to logcat, GetProcessId returned 0
Are these two related? How can I fix? I've reinstalled drivers, installed the latest SDKs, restarted ADB server, and still have this issue.
7.99 refers to an unreleased version. It will change to 8.0 when it's released. Xamarin.iOS does a similar item with their releases:
https://developer.xamarin.com/releases/ios/xamarin.ios_10/xamarin.ios_10.99/ (Notice the note of "preview")
As for the bug, this is a known issue with Visual Studio on Windows and Android Oreo devices:
https://bugzilla.xamarin.com/show_bug.cgi?id=56740
Visual Studio for Mac does not experience this issue, so you could workaround that problem by using a Mac temporarily. Otherwise just use a non-Oreo device/emulator until we get this fixed.
For a future note to help save you time, use our Bugzilla repository and paste the error you are seeing. i.e. unable to connect to logcat, GetProcessId returned 0. If there's an existing issue, you can comment on it, and if there is not, feel free to file a bug and our teams will assist you as soon as we can!

Xamarin for android crashes on VM

I am completely lost.
It has been 2 days of trying after countless uninstall and reinstall just to get xamarin working.
I am trying to compile for android using xamarin running on Visual Studio 2015.
Compiling against Android 7.1 Nougat, running on KitKat 4.4 VM, it crashes right at startup, both debug and release.
Since i am new, i have no idea where to look at and seeking for help.

Categories

Resources