Android device manager: Cannot change ObservableCollection during a CollectionChanged event - android

I'll start off by saying I'm doing this on a school computer (high school), I have full permission to do this and my teacher enters her admin credentials when needed but I can't figure out why it's throwing this error. I followed Microsoft's guide on installing the android emulator for Xamarin in Visual Studio and should have all the prerequisites installed correctly but when I attempt to create a device in android device manager it gets stuck on creating, and when I close it and visit the log I get this at the error:
[20-03-10 19:17:23.90] [SaveInner] CreateAvdAsync failure: System.InvalidOperationException: Cannot change ObservableCollection during a CollectionChanged event.
at System.Collections.ObjectModel.ObservableCollection`1.CheckReentrancy()
at System.Collections.ObjectModel.ObservableCollection`1.InsertItem(Int32 index, T item)
at Xamarin.DeviceManager.Common.ViewModels.MainWindowViewModel.<>c__DisplayClass9_0.<AvdManager_AvdAdded>b__0()
at System.Windows.Threading.DispatcherOperation.InvokeDelegateCore()
at System.Windows.Threading.DispatcherOperation.InvokeImpl()
Any ideas as to how to fix this? I'm unsure what I should do but am very eager to get this completely installed.
Edit: Came back to the same class 2 days later and it fixed itself. Not sure what was wrong.

I had the same issue. I was able to work around this problem by first starting the ADM from Visual Studio, then selecting "+ New" in the ADM, rather than from the Visual Studio menu item "Create Android Emulator...".
In my case, it may be related to the need to download a new image for running a device type for Android TV and maybe for any case where a new image must be downloaded.
Microsoft: this is a bug that should be resolved.

Related

App isn't installed on your device error in very first program

There seem to be too many bugs which have not been properly documented, regarding android studio. I am trying to run a basic Hello world app, and this error is truly making me give up any more efforts.
What I did:
Open Android studio(also tried running as administrator) and tried to run the default Hello world app on an Android 10 device(Xiaomi). At the start it shows Failed to start monitoring 7D8XXCOJGQQCZLJV(device number). At first I ignored it being a beginner and clicked on the run button. The file was successfully built and the RUN section shows 'Install successfully finished'.
Now for clarity here are some screenshots that will display what happened on my android device after the above steps:
The app seemed to be installed correctly, but whenever I click on the app logo the response I get is really frustrating:
As per the this link I tried to go to the device manager and do some changes, by setting and enabling Xiaomi drivers for Portable devices.
But then windows shows:
If anybody knows how to solve this, please do help me in doing so. It is quite discouraging to experience so many errors, right at the beginning. If somebody could give a working solution then that would really help me in continuing my android journey.
There was just a tiny error that led to this entire problem. This was because I had set the value of android:exported="false" in the main activity, which had to be set to true. Hope that this may help anybody in the future!
set the value of android:exported="true" in the AndroidManifest

When I try creating a new project in Android studio installed in my Mac it doesn't get created and it gets stuck.Can someone tell me whats happening?

I am a new Mac user and I installed Android studio in my Mac.Installation went smooth.I then tried creating a new project however the project does not get created and it gets stuck forever with the message 'Building 'My Application'Gradle project info'.
Another point to note , when I disconnect my network the project gets created however the gradle sync doesn't happen.
So I imagine in the first place ,when I am connected to the network and try creating a new project probably Studio is trying to download more files etc ?If so how do I see whats happening behind the scene and understand its ETA ?
Can someone help ?

Deploying my first app is giving me a blackscreen

Im completly new to Android App development and need help to get on my feet to start my first project.
So I just created a simple project, a blank app android project in visual studio.
And when i try to deploy it, it doesnt want to start up, and it doesnt show the error in the solution explorer.
Here if the first picture
And this is what it looks like
Solution.
If you havent already install this
https://xamarin.com/android-player
If you are still getting error, update the oracle VM VirtualBox to 5.0.16
And if you are still having issues, restart your PC and it will work!

Why is Android Studio not loading after successful installation?

I have installed Java JDK for Android and after successful installation of
the Android Studio bundle I wanted to start Android. The green box and yellow line all successfully appeared and after that I got
Fetching Android component information
and after that
Downloading SDK components
dialogue box appears and nothing happens. The main screen of Android Studio is not appearing. I am stuck here. I tried again re-installing but no use.
Can anyone help me out?
Unless the process stopped responding, looking at your picture it just looks like it actually is downloading.
The Android SDK is at least over 100MB, and depending on which addons and libraries you add, the download can easily double or triple that, and take a long time to finish.
I believe you should just let it keep on downloading until it's completed, as it needs to do it once before the IDE will open for the first time.

Possible reasons/fixes for build error for Android Emulator

STEPS-TAKEN: Not sure what the source of the problem is, but the quick description of the bug is that:
I install all required software, SDKs, configs,
Then create two new projects each using the tabbed-window template, each of which support deployment to Android.
Then I run one project via Titanium Studio's Run option, let the Android Emulator load, and confirm it's the app is installed an working.
Then I closed the emulator, and then run the other project the same way as the last, though when the app is shown on the screen it has the name of the first app, not the app run.
FIXES-TRIED: I've attempt executing "Project >> Clean" for all projects before the second run, and still get the same "bug".
SETUP: To my knowledge all of my configs are correct, and clearly the build "works" though it is very possible there is something wrong with my installation build chain to get to the point I'm running the app in Titanium Studio via the Android Emulator.
ERRORS: I've reviewed the console output for FastDev, AppInstall, Android-Emulator, etc and have seen no error messages that jump out; meaning I have seen no error messages, except for build.py error after the first script runs saying it didn't find the script running on a port when it attempt to kill it; given the request is to kill itself, and it's not found, I just assume this is a confusing way of saying the script did what it was suppose to do.
Current build: is on Windows-XP-SP3 using TiStudio 2.0.1 build, JavaSDK 1.6, r18-Android, and Android-2.2
Recent emulators have persistent state, so your second launch probably gets back the system you were running before.
You should not have to resort to this on a regular basis unless something is broken in the workflow, but deleting the AVD and making a new one should get you a clean slate.
I believe there is also a startup flag to the emulator which tells it not to use the checkpoint from a previous run, but start from scratch - you could try to change your configuration to use that flag.
A downside to either deleting or forgoing checkpoints is that the emulator will take longer to start up.
Really though, you are supposed to be able to re-install or launch a given application, or install a completely different one, all within the same running of an emulator. You aren't supposed to need a new emulator, any more than you need to go buy a new device (or perform a factory reset on it). So something is not right in the setup, and the best solution for long term productivity is to identify and fix that. Short term of course, you might need to wipe the slate clean if that helps you meet today's deadline.

Categories

Resources