Xamarin no longer debugging my app - android

I've been working on a Xamarin project for a few days and have been testing it fine, but today it has suddenly stopped allowing me to debug the app, either via Live Player, or by connecting my smart phone via USB.
The only error I am getting, as far as I can see, is
Failed to debug your app
I've not got a way of testing it on iOS devices, but the built-in Windows Phone emulator runs the app fine, albeit with an error in my code popping up now and then.
What could be causing the Android version to stop debugging, or how do I at least fix it?

There are a couple of steps that can help with that issue:
Clean the solution and exit visual studio
manually delete the .vs folder in your solution directory
Delete the /obj and /bin folders in your shared code, and in each project for the platforms you are using
if you are developing for iOS, sometimes it helps to restart your mac
Start Visual Studio
Rebuild your shared code project
Rebuild every native project
Beyond that also make sure that you are using the latest versions of Visual Studio, Xamarin and Xamarin.Forms on all your computers, and that the nuGet Packages your project is using are at the very same version each in shared and native code
Also check, if your app isn't throwing an unexpected exception during its initialization. Especially if not caught, it can happen that your app crashes before your code gets executed at all.
In addition you may find further information about what is going on at Help -> Xamarin -> Open logs or in the device management in XCode (iOS only)

Try this :
Close visual studio if open.
Open App Data and then go to
(a) Local\Xamarin
(B) Local\Xamarin\Xamarin.Android
Empty these folders.
Open your project and then try to build your application.

Not a proper solution, but I uninstalled and reinstalled Visual Studio. This seems to have fixed the problem, but I've still no idea why it stopped working in the first place.

Related

Android Studio Flutter Manifest Multiple Errors

I am an intermediate Android Apps developer who uses java. Recently I tried to switch to Flutter and default app works fine debug on my cell phone through cable.
I just happened to look at Android Manifest and there are multiple error showing:
But to my surprise it shows no error on device.
I have set Flutter, dart and git path already. It would be nice if someone can help with theses errors.
This is normal since you are operating on a Flutter project, and not an Android one.
Try to Open the project from your-app-folder/android.

Android Studio : The application could not be installed: SHELL_UNRESPONSIVE

i'm trying to install my app debug from my android studio. it's work well yesterday, but today when i try to install it again, the application cant be installed on my device and showing error like below on my android studio.
Installation did not succeed.
The application could not be installed: SHELL_UNRESPONSIVE
The device timed out while trying to install the application.
Retry
what should i do? i tried install on other device, and it worked fine. My device is Redmi 4X and other device is Samsung J3
Faced the same issue, not sure of the reason but in Android studio, Click on the File -> Invalidate Caches/ Restart and then it starts to work.
I got same issue with my device. i restart my device and its work properly.
The problem is because you don't have the proper SDK for the Android version. I'm telling you because a month has passed for me too. The solution is to download the appropriate pack in the SDK Manager.
If you have doubts how to enter:
Close the project.
In the welcome panel click on settings, then choose the SDK Manager option.
Click show package details and select the version for Android and choose all packages.
Finally you click ok XD
Try this method if it works perfect greetings
If other answers didn't help and previously application was installing correctly on your device, try to check your AndroidManifest file. Check that nothing forbids to install your app because of os version conflict or manifest merging errors or other reasons.
I came across this problem recently, through process of elimination I determined the cause was related to dependencies in the build.gradle(your app name).
I suggest working backwards and comment out everything that was added since the last known working build/install.
In my case I have a legacy app developed back in 2016 being rewritten, dependencies for signalR have changed quite a bit since then, the original libs where causing the install to fail while everything else seemed excellent, not even a single build error was occurring. Commenting out the libs and references got the application to a runnable state.
In my case, I deleted the emulator and recreated it. It solved the issue.
Before this, I had already tried following which did not work for me:
From menu: File->Invalidate cache/restart.
Deleting .cxx, .idea, .gradle, build folders and rebuilding.
Cold boot device emulator
Posting this in case someone is trapped in my kind of situation.

Android Studio 3.5 deploy issue on my smartphone

I have just updated my Android Studio to 3.5 and I am starting to use the new "Apply Changes" feature. I can deploy my apps without problems using AVD, but when I use my smartphone (Galaxy S9+ with Oreo) the process keeps crashing and all the times I have to kill manually the app and click Start.
I've already tried to create a new project, kill all the apps, plug & unplug the USB cable and restart my device. I tried also Invalidate cache/restart and clean project.
This is the error that the IDE gives me:
E/zygote64: Bad JNI version passed to GetEnv: 805372416
E/studio.deploy: Error retrieving JVMTI function table.
Changes were not applied.
We were unable to deploy your changes: MISSING_AGENT_RESPONSES
Thanks for your help
After contacting the Google Team they have opened a new issue, here's the link if you want to stay updated: https://issuetracker.google.com/issues/139942372
UPDATE: Google has marked this issue as fixed, I think that in the next update everything will be fine.
If this is happening with a plain project, my guess is that there is some incompatibility between your device and the "Apply Changes" feature in Android Studio 3.5.
This issue seems to match your symptoms. Keep an eye on it, and with luck this will get fixed in Android Studio 3.5.1, either by fixing the IDE or at least detecting that "Apply Changes" will not work and reacting better.

Android Studio reports "Could not identify launch activity: Default Activity not found" when building Kotlin projects

I'm trying to build an Android app using Kotlin and Anko. When I select "Run" in Android Studio I get the error:
Could not identify launch activity: Default Activity not found
Error while Launching activity
and the app does not start. I get this error with both the emulator and with a real phone.
To try and narrow down the problem I tried a couple of sample Anko projects, including android-anko-sample, and they all exhibit this same broken behavior.
I have other Android projects I've written in Java, and they run without this problem, which suggests that this is somehow a Kotlin or Anko specific issue. I can even switch back and forth between one of my Java apps and the "android-anko-sample" app linked above, and reproduce the problem with android-anko-sample consistently, while my Java app works correctly every time.
I have looked at other questions involving this error message, and the solutions posted were either not applicable or didn't help.
One thing I have noticed that's weird is that when I open AndroidManifest.xml (of any of these Anko apps) in Android Studio the names of the activities are shown in red, as if they are errors. Here's how the one from android-anko-sample looks:
Note that the app does get installed on the phone/emulator, and I can tap on the icon and run it. It just won't automatically start when I select run from Android Studio, which is pretty inconvenient.
How do I fix this issue?
I'm using:
Android Studio 2.1.2
Ubuntu Linux 16.04
Oracle JDK 1.8.0_131-b11
Code is here:
https://github.com/vsouhrada/android-anko-sample
The complete contents of a few of Android Studio's panes are available in this gist:
https://gist.github.com/xenomachina/e8027b385661038c3f020a543493eebf
This was caused by not having the Kotlin plugin installed in Android Studio.
To fix, go to File → Settings → Plugins → Browse Repositories, find "Kotlin", and install it.

Android Studio stuck while building application

I recently switched from Eclipse to Android Studio because I read that it is now the official IDE for Android application development. I downloaded and installed the latest version (1.0.2) for Windows. When using the program for the first time, I decided to create a test application to see if the program was working correctly. Unfortunately, it was not. Once I clicked the finish button to complete the New Project Wizard, A loading bar showed up that said Gradle: Build. This is where the program gets stuck. There is no error message and it appears that the program is running fine, however the build never actually completes. I am never given my MainActivity.Java class, or my activitymain.xml document. If I click the cancel button, the program freezes and I have to use the TaskManager to kill the program. If I re-enter the program and choose to open an existing project, my project will be there. However, upon trying to open the project, I am greeted with the same Gradle: Build loading bar.. I have been searching for an answer for the last 3 days and nothing has worked. Any help is greatly appreciated!
Things I have tried:
Simply letting the program sit for a while to see if it was actually downloading something and was just really slow. I let it sit for 45+ minutes before killing the program.
Uninstalling and re-installing Android Studio
Restarting my computer
Turning off my firewall (Kaspersky)
Running the program as an administrator
Connecting to a different network
Disconnecting my computer from any networks (to force the program to build in offline mode)
Manually downloading Gradle from the link that Android Studio attempts to use when it gets stuck and telling the program to use that file instead of downloading another one.
(I went to this link https://services.gradle.org/distributions/gradle-2.2.1-all.zip, downloaded the file, unzipped it, went to Gradle settings in Android Studio, checked the Offline work checkbox, and finally set the service directory path to my unzipped Gradle folder.)
Hopefully I have given enough information and made it clear what my problem is. If not please tell me what else I need to explain so I can get this issue resolved. Thanks!
Please note I am working on a 64 bit machine running Windows 8. Also, I use studio64.exe
to run the program.
From the discussion we had in the comments, it does not look like you have your gradle on your windows path.
Please change the below to point to your gradle install:
set GRADLE_HOME=C:\<installation location>\gradle-1.11
set PATH=%PATH%;%GRADLE_HOME%\bin
After this, verify that in the terminal running the following works:
gradle tasks
once you get this working, you will want to run the following in your project:
gradle wrapper
This will produce a .bat file which you can then use to run gradle through the wrapper, letting you support multiple native gradle installations.

Categories

Resources