Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cannot open Android studio 4.2 Canary 8 or 9 after having installed Canary 7

Context :
macOs Catalina 10.15.6
Java 1.8.0_161

After having updated Android Studio 4.2 Canary 7 to Canary 8 (and to Canary 9), it cannot be opened any more.

I've tried installing it from both Android Studio official website and from JetBrains' Toolbox app. In any case the same behavior occurs :
When trying to launch Android Studio nothing happens. It doesn't even show the "SplashScreen" thing.

When using command line to launch the app I have an error that may be useful :

> open [...]/Android\ Studio\ 4.2\ Preview.app

LSOpenURLsWithRole() failed with error -10810 for the file [...]/Android Studio 4.2 Preview.app.

I've seen on the internet that it may mean that the app haven't the appropriate permissions to be launched. With previous versions of Android Studio canary, i've never changed any permissions so why now ?

like image 402
Kélian Avatar asked Sep 03 '20 11:09

Kélian


People also ask

Why is my Android Studio not opening?

If Studio doesn't start after an upgrade, the problem may be due to an invalid Android Studio configuration imported from a previous version of Android Studio or an incompatible plugin.

What version of Android Studio do I have?

From the menu: File > Settings ... (Settings dialog appears) ... Appearance & Behaviour > System Settings > Updates. Here, both the current version and the build number are shown.

What is new in Android Studio arctic fox?

Android Studio Arctic Fox (2020.3. 1) updates Android Studio to version 2020.3 of the IntelliJ platform which adds a slew of new features including debugger interactive hints, VCS updates, and several new code editor enhancements to speed up your workflow.

How to download and install Android Studio Canary version?

The Stable version will not give developers such kind of annoying bugs while developing Android applications. Click on the link here to navigate to the Android Studio Canary version. Click on the download button which is displayed on the screen. Make sure to click on Canary build.

What is the difference between Android Studio Canary and stable?

The Canary version of Android Studio provides some new features quickly in comparison to the stable version of Android Studio. So if you are looking to build Android applications with the help of Jetpack Compose then you should have to install the Canary version of Android Studio.

Which version of Android Studio should I install?

But if we want to check out the latest features in Android studio and develop applications with some new technologies and plugins provided by the Google team then we should install Canary version of Android Studio. The Canary version of Android Studio provides some new features quickly in comparison to the stable version of Android Studio.

How to download and install Canary build?

Make sure to click on Canary build. After clicking on the Download button you will get to see below dialog screen. Tick the box I have read and agree with the terms and conditions and click on the Download button.


3 Answers

When launching directly [...]/Android Studio 4.2 Preview.app/Contents/MacOs/studio I have the following output :

2020-09-03 14:09:02.078 studio[4589:59392] allVms required 1.8*,1.8+
2020-09-03 14:09:02.078 studio[4589:59392] Can't find bundled java.The folder doesn't exist: /Applications/Android Studio 4.2 Preview.app/Contents/jbr
2020-09-03 14:09:02.078 studio[4589:59392] Can't find bundled java.The folder doesn't exist: /Applications/Android Studio 4.2 Preview.app/Contents/jdk
2020-09-03 14:09:02.082 studio[4589:59397] WorkingDirectory is absent in Info.plist. Current Directory: /Applications
2020-09-03 14:09:02.082 studio[4589:59397] fullFileName is: /Applications/Android Studio 4.2 Preview.app/Contents/bin/studio.vmoptions
2020-09-03 14:09:02.082 studio[4589:59397] fullFileName exists: /Applications/Android Studio 4.2 Preview.app/Contents/bin/studio.vmoptions
2020-09-03 14:09:02.083 studio[4589:59397] Value of STUDIO_VM_OPTIONS is (null)
2020-09-03 14:09:02.083 studio[4589:59397] Processing VMOptions file at /Applications/Android Studio 4.2 Preview.app/Contents/bin/studio.vmoptions
2020-09-03 14:09:02.083 studio[4589:59397] Done
2020-09-03 14:09:02.083 studio[4589:59397] Processing VMOptions file at /Users/myUser/Library/Application Support/Google/AndroidStudioPreview4.2/studio.vmoptions
2020-09-03 14:09:02.083 studio[4589:59397] Done
2020-09-03 14:09:02.083 studio[4589:59397] Processing VMOptions file at
2020-09-03 14:09:02.084 studio[4589:59397] No content found
OpenJDK 64-Bit Server VM warning: Option UseConcMarkSweepGC was deprecated in version 9.0 and will likely be removed in a future release.
Error occurred during initialization of VM
Multiple garbage collectors selected

The line i want to highlight here is

2020-09-03 14:09:02.083 studio[4589:59397] Processing VMOptions file at /Users/myUser/Library/Application Support/Google/AndroidStudioPreview4.2/studio.vmoptions

After having removed that file, the new version of canary can be opened !

I guess there is something wrong in this file that prevents the migration

like image 178
Kélian Avatar answered Oct 12 '22 02:10

Kélian


In my case, I've isolated a couple of studio.vmoptions values that, if left in, prevent any version >= Android Studio 4.2 canary 8 to launch.

-XX:+UseConcMarkSweepGC
-XX:CMSInitiatingOccupancyFraction=85
-XX:+UseCMSInitiatingOccupancyOnly
-Xloggc:gc.log

If I remove all of them, it opens as normal. If I leave any of them, it won't open.

like image 3
Nacho L. Avatar answered Oct 12 '22 03:10

Nacho L.


I had the same problem, and I hacked my way around it by providing the app a "jbr" folder.

It used to complain and one error/warning (as stated in the original question) was:

Can't find bundled java.The folder doesn't exist: /Applications/Android Studio Preview.app/Contents/jbr

So I got in /Applications/Android Studio Preview.app/Contents and copied the jre folder into a jbr one...

cd /Applications/Android\ Studio\ Preview.app/Contents
cp -r jre jbr

I don't understand why this preview version would be packaged without the tools it is supposed to need, but, well, it works.

like image 1
m0rgan Avatar answered Oct 12 '22 03:10

m0rgan