Dialog Box issues with Android Studio on OSX - macos

Recently, whenever I have Android Studio in fullscreen mode, and a dialog box is presented, the dialog box disappears and I am unable to bring it back into focus so that I can start using the IDE again. I need to force quit the IDE and re-open and it is fine until the next dialog box is presented.

The issue seems to be from OSX 10.11 onwards, and has been reported by a number of users: https://code.google.com/p/android/issues/detail?id=192746
I experienced the same issues on Android Studio v1.5. To save the hassle, I updated to Android Studio 2.0+ on the beta channel, which did not resolve the issue.
I agree, it is very annoying. Hopefully a workaround or patch will come soon.

Related

Can't run a Xamarin App in iPhone Simulator from Visual Studio For Mac

In short: I am unable to run my app in the iPhone Simulator. There is no "Play button" (the triangle), only a Debugger button (hammer):
As you can see above I have "Generic Simulator". When I click on it, there is no list of various iPhones/iPads to choose from:
If I choose Android, I am able to run the app:
I have XCode installed. I ran XCode once.
I also installed the Command Line tools.
I created a new Xamarin Forms App:
Here are my iOS build options:
I am able to run the Simulator separately:
Creating an App in XCode and running in the Simulator works:
info.plist:
Prefrences -> SDK Locations -> Apple
Build -> Configurations:
Here is the kicker though. If I run a Xamarin App on my Windows machine using the iPhone Simulator on the Mac, it works!
What do I need to do so I can run my app inside the Simulator vis Visual Studio for Mac?
Few options you can worth to check. #WorldOfBasti suggested options plus following.
Configuration
Right click on the solution -> options -> Configurations -> Configuration manager -> ProjectName.iOS with Debug|iPhoneSimulator should be checked or if configuration "ProjectName.iOS with Debug|iPhoneSimulator" is not available then add this from General tab
Apple SDK path
Check Apple SDK path is set properly (Preference -> SDK Location -> Apple). It should have green tick mark with Xcode version and SDK path location.
Minimum system version (Deployment Target)
Change Deployment Target to minimum version (ie, lower than your simulator version)
Switch debug <-> release
Today I have also faced same issue which you are facing. I have switched debug to release, iOS to Android. Then reverted back to iOS and debug from the top device selection status bar. Then Simulator option was appearing. So, might be UI updated issue in Visual studio for mac. Please give a try.
I assume that you tried the basics things like restarting your Mac, etc. So here are a few things, that might solve your problem:
Check your build configurations, here is a good video
Close VS for Mac, start Xcode and create a test project which you run on a simulator. If it works try again in VS for Mac
Close VS for Mac, goto Xcode -> Preferences -> Accounts and download the manual profiles of your developer account. Try again in VS for Mac
Clean your project: In VS for Mac, goto Build -> Clean All. Then Close VS for Mac, goto your project folder and delete in "yourprojectname" and "yourprojectname".iOS all bin and obj folders. Try again
If all of this doesn't work, I would try to reinstall it (if you have any important projects, make a backup):
Uninstall VS for Mac and Xcode
Install Xcode again from the App Store
Install Visual Studio for Mac
Hopefully it works..
Looking at the Visual Studio for Mac logs, specifically the IDE log, I found this line ... 'The target name of simulated device could not be added because it's already cached'.
You are welcome to read through all of this ... but you may just want to go down to the Addendum 2 (final?) and see if that works for you ... it ends up being simpler and quicker than anything else I have found.
So, at first, I started clearing the cache with a 'xcrun simctl erase all' command from Terminal, and when I started Visual Studio for Mac I could run a Xamarin App, but launching the simulator took quite a bit of time.
So hare's something I found works that you might want to try ...
Close iOS Simulator on Mac (if any).
Close ALL copies of Visual Studio that are connected to the Mac ... either on the Mac itself or on another computer connected to the Mac (if any).
Start Visual Studio for Mac.
If you can't run a Xamarin App, Close Visual Studio for Mac.
Launch the Simulator manually (I have it in the Dock, so I just click it) ... wait for it to fully startup.
Now close the Simulator (from the Simulator menu).
Now restart Visual Studio for Mac.
If you still can't see the simulator devices to run on ... try the above steps one more time (this time you should only have to close Visual Studio for Mac followed by manually starting the Simulator, waiting for it to start, and then quitting the Simulator and finally restarting Visual Studio for Mac).
It still isn't great, but this has (so far) always worked for me. And the Simulator starts up substantially quicker then if I did a 'xcrun simctl erase all' command from Terminal.
Addendum: Most of the time the above works. But occasionally I still have to clear the cache from the Terminal with 'xcrun simctl erase all' command.
Also: I have also found (although maybe it's just my imagination) that clearing out the Visual Studio for Mac temporary .binlog files that are written in the 'T' folder will sometimes fix the problem (if you look at an IDE log from Visual Studio for Mac; right after the 'The target name of simulated device could not be added because it's already cached' message, you should see some .tmp files being created. The directory where they were created is the 'T' folder I'm talking about). I sometimes delete the tmp*.binlog and tmp*.tmp as a last ditch effort before using the 'xcrun simctl erase all' command to try to get back to where Visual Studio for Mac will see the iOS Simulator Devices.
Finally: This is really starting to feel like a bug in Visual Studio for Mac startup (or possibly during a iOS project load). The reason I say that is I can ALWAYS see the iOS Device list from Visual Studio for Windows (as long as I can connect to the Mac). In addition, I can leave Visual Studio for Mac running (even hidden) and test an app on the iOS Simulator from Windows, then, leaving the iOS Simulator Running on the Mac, run an App on Visual Studio for Mac. If there really were a 'caching issue' with the Simulator it seems to me I should have problems running anything on the Mac after using the iOS Simulator from Windows, but it always works. For now, I'm working on a single Xamarin Project on the Mac (and I don't use the Mac for anything else), So I just let Visual Studio for Mac 'open at login' (Dock setting) and automatically 'load previous solution on startup' (Visual Studio for Mac setting), hide Visual Studio for Mac (Dock Setting) and if I need it, Visual Studio for Mac is already loaded and able to see iOS Devices to run Apps on with a quick click on the Dock Icon.
Addendum 2 (final?): I have now found that if I just close a solution that I have open that shows 'Generic Simulator' and re-open it without exiting Visual Studio for Mac (sometimes I have to do it multiple times ... I think I've counted up to 5 times before it finally worked), it will start showing the device list and I can run the iOS app in the Simulator. I don't even have to close the Simulator if it's already running, which saves a bunch of time.
It still feels like a bug to me, I don't see why I would have to close/open a solution multiple times to get the iOS devices listed and be able to run an iOS app. What really gets me is if I reboot the Mac, don't open the Simulator and start Visual Studio for Mac, then open a solution, I still have to go through the close/re-open solution steps... sometimes more than once. The simulator is not set to auto start or anything like that. But, at least, it's getting simpler, and takes less time, to get to a point where I can run an iOS app.

Menu bar not showing in Android Studio

I have a problem with my Android Studio app on macOS Sierra.
It seems like the app is not really open, because usually, when an app is open, there is a dot under its icon in the dock, but on my computer there is none...
The true problem is that the menu bar options like "File", "Build", ... don't show up, and I can't access them. Instead I have the options of the next open app. Once again, it looks as if Android Studio were not open. It's very annoying because I can't use all the tools.
Except these problems, I can edit my code, I can launch an app on a device using a USB wire, etc. It's very weird, and I haven't seen any similar issues on the Web. I tried restarting the app and restarting my computer, none of these worked...
Have you ever experienced the same problem with Android Studio (or with any other app)?
This was fixed by Apple. Upgrading macOS to 10.13.2 Beta 4 (17C79a) resolved the issue for me.
According to IDEA-175658 this is a known bug in High Sierra. But it seems to be a bug of Java and not Jetbrains products.
The workaround by the time being is installing Apple legacy Java 6 runtime. I can confirm it works over here.

Android Emulator not sync with VS 2015

I am having some issue when running a Xamarin.Forms application in the Android Emulator using Visual Studio 2015. At the beginning everything was working OK. Every time I did a change either in XAML or C#, when I rerun the emulator I can see the changes (without closing it).
Now, for some reason if I do the same, those changes are not applied in the Android Emulator. In order to see any change, I need to close the emulator and click the green play button again every time.
For example, if I want to change the FontColor of a label to be Blue instead of Black in XAML, before just clicking the restart button was enough to see the change. For any C# change, clicking the stop button and then the play button was enough as well.
Now, to see the same result I have to close the emulator and reload it again. Which take some time.
Has anyone have faced the same problem? Any help/ clue would be ver helpful?
Thanks!
#MikePR
I suggest to get rid of the Hyper-V based VS Android Emulator and use the Intel HAXM
native Emulator. I experienced much simular
issues with Hyper-V emulator, too.
Or much better get rid of any emulator and use
vysor.io and visualize your real device like an
emulator on your desktop. My personal favorit.
Hope it is helpful.
PS: Never in life use GenyMotion. That doesn't work in Remote Desktop Sessions and only runs
on windows machines with OpenGL 2.0 installed
and HAXM and Hyper-V disabled. I currently had that disappointing experience.
A really cool tool for XAML Preview is Gorilla Player!

Android Studio window rendering/refreshing by clicking on other window on MAC OS

I don't know what kind of keyboard combination I clicked with my MAC OS on Android Studio 1.5.1, but every time I click away to another window (e.g. safari), the complete android studio window is refreshing. The same if I am going back to click on android studio, the complete windows is refreshing as well. It is really annoying, and I don't know how to get rid off it.

MonoDroid Fails to load emulator

I downloaded the trail version of MonoDroid. I am going through the hello world tutorial and now at the part where I want to deploy my app to the emulator.
It comes up with a "Select Device" dialog with nothing in it. So I click on "Start emulator image", this pops up another dialog with available images. I have one emulator made and it is in this dialog box. I hit ok and I am not at dialog box with still nothing to choose.
So I am not sure what to do.
I am running Visual Studios pro 2010 on a window 7 64bit.
This seems to be a regression in Google's latest version of the Android SDK. Emulators will no longer run if there are spaces in SDK location path.
Uninstall the Android SDK and install it back to a new location without spaces and it should work.

Resources