How to fix "App not installed" - Xamarin app distribution - android

I used Microsoft's "Preparing an Application for Release" and "Signing the Android Application Package" tutorials in order to run an APK of an app I built on my Samsung Galaxy S8 phone.
When I try to run the APK, I am getting a message "Do you want to install an update to this existing application?...", and when tap "install", it shows an "installing" screen, and after couple of seconds I am getting a message "App not installed".
I have done these steps couple of times, each time I got the same result.
Did it happen to anyone?
Is there a way to know for 100% what causes this problem? There is not error code and it leaves me hanging.

I would like to thank #Blu and #Cheesebaron for their guidance.
OK, so after trying to understand where my error was (a lot of ctrl+f's), I had:
"failure copying native libraries error code=-113".
This means I had to my app.Android in Solution Explorer -> Properties -> Android Options -> Advanced -> unchecked all except the last one, then unchecked it, and it checked right back what was needed for it to work.
Then it didn't work AGAIN.
So I looked up again in logcat (after trying to install again, so that I will see the new error), and I found this:
"signatures do not match previously installed version; ignoring!".
I went to Settings -> Apps -> searched my app by its name -> Uninstalled.
Then I tried installing again, and it worked!
BTW, for the sake of other people - How to use logcat? (generally! you may experience some issues, google it and you'll do fine):
Connect your phone to your computer.
go into: c:\Users\YOURUSERNAME\AppData\Local\Android\Sdk\platform-tools
type "adb logcat".

Related

Easiest Way to Deploy Xamarin Android App in VS 2017?

I have an Android app that I made maybe like 2 years back. I never deployed it to google store as it really is just for me.
I deployed it on my phone and installed via apk or through VS itself (I can't remember).
I recently formatted my phone and now would like to get my app back. I still have the code and opened it in VS 2017, it did an upgrade of my project but I can't figure out how to deploy it to my phone.
I enabled developer mode but still can't figure it out. I tried to copy the apk that VS generated but when I try to install it, I just get "it is corrupt and can't install".
The app is extremely simple. It is one screen with 6 textboxes and 1 dropdown on it.
Just trying to get it back on my phone as fast as possible so I can use it.
I do get some error when I try to see if it will load on the emulator in VS 2017
Severity Code Description Project File Line Suppression State
Error ADB0010: Failure [INSTALL_FAILED_NO_MATCHING_ABIS: Failed to extract native libraries, res=-113]
at Mono.AndroidTools.Internal.AdbOutputParsing.CheckInstallSuccess(String output, String packageName)
at Mono.AndroidTools.AndroidDevice.<>c__DisplayClass94_0.<InstallPackage>b__0(Task`1 t)
at System.Threading.Tasks.ContinuationTaskFromResultTask`1.InnerInvoke()
at System.Threading.Tasks.Task.Execute()
0
This is only easiest way you are doing. Plug your device via USB cable & press F5.
I am sure you need to check all supported CPU architectures in Visual Studio.
Right click on your project- go to properties
Properties-->Android options-->Advanced-->Supported Architecures
armeabi;
armeabi-v7a;
x86;
x86_64
& check if available, uninstall your app from your real device
settings->apps->uninstall.
Hope it help you.

Android Logcat is empty when debug with device in android studio

When I try to debug using android device in android studio Logcat shows nothing. But when I use emulator LogCat shows all the messages. How should view the Logcat messages when debugging on actual device?
Thank You !
In Android studio 0.8.0 you should enable ADB integration through Tools -> Android, before run your app. Then the log cat will work correctly. Notice that if you make ADB integration disabled while your app is running and again make it enable, then the log cat dosen't show anything unless you rebuild your project.
Restart the phone. And it solves magically
I was using Lenovo A7000plus powered by Android 6.0 M and found out that my Android Studio was unable to record the debug process, but somehow other's phone debug report could be recorded. Plus, I tried use Memu emulator and it recorded normally.
Strangely, that device was recognized by Android Studio and ready to be debugged, but no recorded debug report at all from all application that ran on the device. Of course, USB debug was tuned on.
What I did before, I turned off Developer option on that phone in order to play my favourite mobile game (F/GO) which forbids USB Debugging is turned on in the device.
A few hours later, after trying any method in Internet and not success, accidentally I found simple but strange solution that is Restart the phone. I restarted the phone while it was connecting to PC, and somehow the logcat showed all debug process in Logcat like normal.
It sounds like non-engineering solution at all, but that's really work for my case.
As of 0.4.0 I have noticed that the logcat tab does not work in the debugger window - only in the Android DDMS window (hit Alt+6 to bring up the working logcat while debugging). Awkward I know :)
In Android studio 1.0.2 or later: you should enable ADB integration through Tools -> Android, before run your app
In Android studio 1.* if logcat messages have disappeared for me helps the next trick:
Tools -> Android -> disable )) "enable ADB integration" (if it've been enabled)
Tools -> Android -> enable it again "enable ADB integration"
In 0.8.2 the DDMS window doesn't show up. However restarting the adb logcat windows by pressing Alt+6 (Twice, if it's already opened) fixes the issue. It worked for me.
I understand that this question is over 2 years old, but from my searches a few people are still having a persistent problem with this. One possible solution to this (which worked for me after two hours!) is that your phone settings may have its "Log Switch" set to off, hence it isn't sending your log data to the IDE.
Here is the solution - "Unable to open log device '/dev/log/main': No such file or directory"
Hope it helps!
If anyone's still having trouble with this despite trying all the answers here, just use System.out.println instead of log.* and your debug messages will output.
Updated: I finally got the cause of the problem in my case. If I switch of my device's wifi, the log shows. Otherwise, the log will not show. I tried several times and it the always show full logs when I turn off my wifi.
My device is: Gsmart Classic, OS: Android OS, v5.1 (Lollipop). I met the problem when I updated the gradle build tool from 'com.android.tools.build:gradle:2.0.0-alpha1' to 'com.android.tools.build:gradle:2.0.0-alpha3' in Android Studio 2.0-preview. After trying all the solutions with no luck, I tried un applied all the instant run choices and re-apply it again. Then the logs show up.
Note: if it still doesn't help. You can as well try to switch back-and-forth the back ground process limit. Unfortunately, I couldn't reproduce the error.
In Android Studio 2.x I used to have to restart to get it working but often switching back and forth between the applications works or running
adb kill-server;
adb start-server;
to restart adb fixes many things as well.
The problem seems to have different causes.
For me, the issue was that I had two emulators with the same name (I created it, deleted it, and then created it again with the same name). There were two emulator entries in the logcat dropdown and it was connected to the wrong one. All I had to do was switch to the other one. I prevented the problem permanently by renaming the emulator.
I believe that the problem has various causes for different users. I experienced the same issue with logcat not displaying any information when my application crashed, and we all know how frustrating this can be.
The following are the solutions that worked for me.
Invalidating caches and restarting android studio
In the developer option in your physical device make sure the logger Buffer size is set to 1MB per logger buffer.
Restart your physical device.
Hope this helps.

Eclipse fails compiling apk

Im new to android.
I have been writing my first app, I testing it about 2 weeks now.
Everything is went good, when today my apk doesnt want to be installed on my Phone.
So the followings happen:
I use eclipse.
I export the app with the right way:
Android Tools -> Export Signed Application -> bablabla I got a key and everything so..
The Emulator runs it perfectly, but when I try to install it on my phone, its icon not showing as an android application, its like 3 blank pages, so it shows as an "unknow" file format, and when i try to install, error message appears: "No applications can perform this action"
It seems like Eclipse didnt build my project as an .apk file.
Can somebody helps me?
What changed? Before this I could ran my apks on my Phone.
(Samsung Galaxy S, but I dont think its really matter, I guess it will be an Eclipse thingee)
Check out this documentation: debbuging android app on device
It looks rather like problem with manifest file, but I think You can run Your app by description from the link.

Debugging and Running a Mono-Droid application

I have been quite interested in developing an application for my Android device. I downloaded the all the required tools for VS2010 following this guide - http://mono-android.net/Installation/Visual_Studio and everything went pretty smoothly.
Now, the first time I ran the default application and it copied everything to the emulator, it ran perfectly. If I make a simple change to the application and hit F5 to redeploy - it starts the app, but it seems to have the old version on there still and doesn't show my changes. I've cleaned the solution and rebuilt the application, so I don't think its that. I've also completely changed the code (just in case it was something I was doing wrong), but that didn't work either. Oh and the build also succeeds!
Now the Emulator seems a bit flaky and slow...but is it something that I am doing? Is there somewhere I need to clear before hitting F5?
When it is doing the deploy, does it say "Uninstalling the previous version"?
Another thing to try is to manually remove the app from the emulator (Settings -> Applications -> Manage Applications -> -> Uninstall. Then deploy again and see if the new version is copying. This should narrow down if it's a deployment issue or a build issue.

"DeviceMonitor]Sending jdwp tracking request failed!" in Eclipse / Android

I'm a noob learning Eclipse and Android. Whenever I close the emulator I get "DeviceMonitor]Sending jdwp tracking request failed!" in the Console tab. Infact that seems to be the ONLY thing I get in the console tab - I don't get all the emulator loading messages and other things I used to see.
Everything else seems to work, I can build, run in the emulator, debug in the emulator (via Run>Debug after setting a Debug configuration . . . I can't get "Debug As" to work, see: "Debug As..." in Eclipse for Android - don't know if that's relevant to this problem).
What does this message mean, and how do I correct it? Thanks in advance!
The message you receive is in the normal console of Eclipse and isn't really important, because it just reports you that the connection to the emulator was lost. That ok as you described you closed it.
The normal android log is only visible via the adb tool (via console) or with the view in Eclipse called LogCat. You can add that to your working screen if you go to Window -> View -> Other -> Android -> LogCat
I recommend to look at the other views of the android tools, too. Like Device or Explorer.
What might happen with the LogCat output is that it went blank. Than you need to clear the LogCat (there is a button for that on the top of the view) and if this doesn't help try to click on the emulator in the device list. If nothing of that helped: close eclipse and the emulator and start them again.
I fixed by changing the usb cable which was connected to PC and device.
Before that restarting dev machine, eclipse, even the device dint help.
Close eclipse, stop adb process. From command line, "adb kill-server".
Launch your eclipse project.
I don't know if this will help for sure, but I had a similar problem and I solved it by changing my workspace to a different folder where I placed copies of the projects and changed the names of the folders just one caracter so that It would not tell me they are already in use. Then I worked I just had to import the projects again and I refactored their names to match the code (just the project names).
This error is mostly result of incorrect permissions set for "ddms"/ "android" scrips residing in "your sdk location"/tools.
If you are getting only
Sending tracking request failed!
error then change the permissions assigned to tools/android.
To do that open the directory "your sdk location"/tools/ using file browser. You should see a file named android, right click-> properties -> permissions tab -> select allow executing and program. [chmod].
If your error is
Sending jdwp tracking request failed!
then you need to apply same procedure described above for "your sdk location/tools/ddms"

Categories

Resources