I created a simple Xamarin ANDROID App. I set up my phone to development mode and deployed my app to the phone via USB.
The app continues to work on the phone as a regular app.
I then created a Xamarin MOBILE App which was more complex. I deployed it to my android phone via Visual Studio debug mode as with my previous app and it ran perfectly. But when I attempt to run the app directly from my phone, it won’t run. The first screen partially loads without anything on it and then disappears. My phone puts a message up saying that my app keeps stopping and would I like to close the app. I make use of a file placed in Assets. Might this be an issue when not debugging from the computer?
Might there be a difference between deploying a xamarin android app and a xamarin mobile app.
A minor thing is that it has added the name ‘.droid’ to the name of my app which I would like to get rid of.
I am new to deploying apps to a phone
I have solved it thanks to your helpful prompts.
I looked at the error logs and the error was ‘FATAL’ in a mono dll. This was indirectly helpful in that I knew it wasn’t the logic in my code.
I also made the discovery that running my app directly in the emulator also failed in the same manner as on my phone. I also ruled out that it might be an issue with transferring an asset -a file the my app uses- as I bypassed using the asset.
(Running my app via visual studio in both the emulator and my phone worked perfectly.)
I then decided to re-house my forms and classes in a new template as I suspected it was corruption in some xml configuration setting that didn’t bother Visual Studio. This worked great and the app now runs stand alone on the phone (and emulator).
Related
Recently, I tried to build an empty activity app using Android Studio for some poc purposes. I connected the app to a physical device through USB. When running the app, it is working on the device just fine except that it does not save the app to the device.
Whereas when I created the app using basic activity and run in the device, it saves the app on my device's screen and installed it into the memory.
Does anybody know the reason and solution for this?
FYR, I am using Huawei VOG-L29 as the device for testing.
You missed the app in the device somehow. The template you use to create the initial project doesn't matter- its not part of the final build. Android Studio doesn't even remember it once it's done generating the initial files. When you upload an app to the device, it will be saved to internal storage and should appear in settings.
I'm experiencing pesky SIGSEGV faults in my Android app. They are inconsistent to reproduce and mostly happen after my app has been restarted a couple of times. The problem is, when the app restarts, Android Studio stops showing the logs, making it very hard for me to figure out what the issue is. When I restart the app using the Android Studio restart button, it loads a fresh install of the app onto my phone, which is an issue because the errors don't seem to happen on very fresh installs.
My question is: can I somehow have Android Studio still show the live logs WITHOUT reinstalling the app every time, OR can I run the app without being connected to any PC, and dump a crash log file locally to the phone when the app crashes, so that I can open the logs later on?
Filtering logcat
The problem is, when the app restarts, Android Studio stops showing the logs, making it very hard for me to figure out what the issue is.
It sounds like the logcat in android studio is filtering by application. You can change it to no filter and set the text filter to your application's id. This way the logcat will not be cleared once the application process dies/restarts.
Extracting the tombstones
Since this is an Android native crash it will not be sent to bug capturing software such as Crashlytics or Bugfender etc.. you can pull the tombstone[s] directly from the device with adb.
adb bugreport bugreport.zip
Once extracted, the tombstones will be under path /bugreport/FS/data/tombstones/.
Typically 10 tombstones will get saved to device storage but will get overwritten by earlier native crashes once the limit to the number of retained tombstones has been met.
Android documentation: Using bugreport
Android documentation: Debugging tombstones
I use my mobile device to run my flutter applications. I know all about the hot reload but I'm so tired of having to wait every time I connect back to my phone again maybe the next day and then the app has to be re installed and the gradle task assembler has to be built again. Please I want to ask if there is a way to reconnect easily and a way for the apps to run easily again any time I want to work on a project again after a while.
There are a couple of alternatives to building the APK and installing it on a physical device:
Use an emulated android device
You can use an android emulator. The easiest way to set that up is probably the graphical interface in Android Studio (see https://developer.android.com/studio/run/managing-avds), but you can also use flutter emulators --create [--name <Name>] to create a new virtual device. Then use the button in the bottom right of VS Code to select that device, before launching the debugger.
Build for desktop
Depending on the dependencies of your app, you could try building the app for the platform you're developing on (Windows, Linux, or macOS). This has the same visual result as an Android app, but does not need an emulator or physical device. The rendering engine is the same (Skia) on all platforms. The obvious downside is that some plugins may not be available for desktop.
See https://docs.flutter.dev/development/platform-integration/desktop on how to set that up.
I have written a simple login page using xamarin forms. When I try to deploy it on emulator, the emulator opens but my app is not visible.
1) Does it take time for the app to be deployed? Or would it appear on start up?
2) Should warnings be considered? I have no errors though.
Most Android emulated devices are slow. I have found that some of them simply won't render an app. This is not an indication that the physical device, which you are trying to emulate, won't work however. Try testing what works in an emulator and then creating a copy of what works in the device manager. Then make slight changes that are closer to the target device in the copy. Deploy every time to ensure that it is working. This process takes patience. If you are fortunate enough to have the physical device, debug through the USB connection.
I've been working with PhoneGap for about two weeks now, yesterday I've build a new android app all went well except that the app starts very slow on my android device. It first shows me for three seconds just a black background except the navbar. So I want to ask how to boost it up or which files I could remove or what I've done wrong please I would be happy if you explain me also the file structure. Thanks in forward for your answers!
Your question is little bit vague. Please, give us more information about your app, about your config and what you’ve already tried.
If my app is slow on any device, I do generally the following:
Check if the same problem occurs in the browser
What’s going on at the start of the app in the browser (Chrome Dev Tools)
If nothing unusual happens, check the logs on the device
For Android, I’m using Logcat for checking what’s happening on the phone.
In order to use Logcat:
1.) Enable debugging mode on your Android phone
2.) You need Android Studio
3.) Connect your phone to your computer and start Logcat in Android Studio 3.1.2
4.) Check the logs while you are starting your app on the phone