I'm trying to set up a new Android app development environment at home and I've run into a problem that is a showstopper.
First, here is my environment:
I'm following this tutorial: MSDN tutorial
When I go to debug my test app, here is what happens.
No errors are displayed in Visual Studio and when i turn on Android logging it's a such a massive overflow of information that I don't really know where to begin searching for a problem.
Please also note that when I first set up the app, according to the tutorial, debugging on the tablet worked fine. The initial build is simply a template with a few basic controls.
In between then and when it stopped working I also added and successfully tested a Windows Phone project on a Windows Phone device.
Once I got to the section where I was modifying the project is when the problem started. I thought that perhaps a change in the code I did caused this issue so I tried another blank app and that blank app now crashes as well.
When I deploy the tutorial app to an emulator it crashes immediately but when I deploy a blank app it doesn't crash.
I also tried restoring the tablet to factory defaults and testing again. Same scenario: Blank app and tutorial app run for a few seconds, debugging stops, app closes.
Any clue as to what type of problem I'm looking at?
Debug mode enables you to see logs of various Tapjoy actions (sessions, placements, purchases, custom events, etc. ). These will appear in the Tapjoy Developer Console. To get to the developer console, go to the wrench icon in the top navigation bar of the dashboard and select "Developer Console" from the drop down.
To start debugging an APK, click Profile or debug APK from the Android Studio Welcome screen. Or, if you already have a project open, click File > Profile or Debug APK from the menu bar. In the next dialog window, select the APK you want to import into Android Studio and click OK.
What fixed it for me in Visual Studio 2017 is going to :
Tools → Options → Xamarin → Android Settings
and uncheck:
Preserve Application data cache on device between deploys
Solution
Directory Path
./AndroidProject/obj/Debug
./AndroidProject/obj/Release
I had also uninstalled the app before from the device and restarted it, I don't know whether this is required anymore, because the app is now being "reinstalled" by newer Xamarin versions anyway.
adb uninstall com.your.domain
Story and Background information
Have had the same issue with a device running Android 5.0.
Basically, the app was just stopping without any note. When I now restarted the phone, The log was extended (once) by the following line:
Device could not find component named: *com.your.domain*/{*md5hash*}.*{Activity}
It turns out that with Andrpod 5.0 a hashing mechanism was implemented:
With the 5.0 release, the default package names for Android Callable Wrappers will be based on the MD5SUM of the assembly-qualified name of the type being exported. This allows the same fully-qualified name to be provided from two different assemblies and not get a packaging error. See this for further information Xamarin.Android 5.1
So, if the md5-hash now changes from time to time, a simple Clean of your project is not enough.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With