Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"Open in Android Studio" option doesn't work #1521

Closed
audkar opened this issue Mar 9, 2019 · 5 comments
Closed

"Open in Android Studio" option doesn't work #1521

audkar opened this issue Mar 9, 2019 · 5 comments
Labels
in editor Relates to code editing or language features is bug on linux
Milestone

Comments

@audkar
Copy link

audkar commented Mar 9, 2019

Clicking this option does nothing. Can't find any errors printed or anything.

  • Opening Android project inside AS with flutter plugin works.
  • AS installed via Jetbrains Toolbox
  • Never tried this feature. Don't know if this is regression or it was never working.

Flutter doctor:

[✓] Flutter (Channel stable, v1.2.1, on Linux, locale en_US.UTF-8)
    • Flutter version 1.2.1 at /home/audrius/Documents/flutter
    • Framework revision 8661d8aecd (3 weeks ago), 2019-02-14 19:19:53 -0800
    • Engine revision 3757390fa4
    • Dart version 2.1.2 (build 2.1.2-dev.0.0 0a7dcf17eb)

[✓] Android toolchain - develop for Android devices (Android SDK version 28.0.3)
    • Android SDK at /home/audrius/Documents/android-sdk-canary
    • Android NDK location not configured (optional; useful for native profiling support)
    • Platform android-28, build-tools 28.0.3
    • ANDROID_HOME = /home/audrius/Documents/android-sdk-canary
    • Java binary at:
      /home/audrius/.local/share/JetBrains/Toolbox/apps/AndroidStudio/ch-0/183.5320907/jre/bin/java
    • Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1248-b01)
    • All Android licenses accepted.

[✓] Android Studio (version 3.3)
    • Android Studio at /home/audrius/.local/share/JetBrains/Toolbox/apps/AndroidStudio/ch-1/182.5314842
    • Flutter plugin version 33.3.1
    • Dart plugin version 182.5215
    • Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1248-b01)

[!] Android Studio (version 3.5)
    • Android Studio at /home/audrius/.local/share/JetBrains/Toolbox/apps/AndroidStudio/ch-0/183.5320907
    ✗ Flutter plugin not installed; this adds Flutter specific functionality.
    ✗ Dart plugin not installed; this adds Dart specific functionality.
    • Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1248-b01)
@DanTup
Copy link
Member

DanTup commented Mar 9, 2019

Is there anything listed in the developer console (click Help -> Show Developer Tools in VS Code) when you click? I can't see an obvious path in the code that would cause it to fail silently. If we can't find the folder we show an error message, and otherwise we just try to execute it.

Also, could you run flutter config --machine and paste the output here.

Thanks!

@DanTup DanTup added this to the v2.25.0 milestone Mar 9, 2019
@DanTup DanTup added is bug in editor Relates to code editing or language features awaiting info Requires more information from the customer to progress labels Mar 9, 2019
@audkar
Copy link
Author

audkar commented Mar 9, 2019

Is there anything listed in the developer console (click Help -> Show Developer Tools in VS Code) when you click?

No. Nothing printed after click.

flutter config --machine and paste the output here.

{
  "android-studio-dir":
  "/home/audrius/.local/share/JetBrains/Toolbox/apps/AndroidStudio/ch-0/183.5320907",
  "android-sdk": "/home/audrius/Documents/android-sdk-canary"
}

Hmmm. Maybe problem is that android-studio-dir is set to AS versions which doesn't have Flutter plugin?

@DanTup
Copy link
Member

DanTup commented Mar 9, 2019

Maybe problem is that android-studio-dir is set to AS versions which doesn't have Flutter plugin?

That shouldn't stop it from launching though.. All we're doing here is grabbing android-studio-dir then appending bin/studio and executing it. If you run /home/audrius/.local/share/JetBrains/Toolbox/apps/AndroidStudio/ch-0/183.5320907/bin/studio from a terminal, does that work? If so, maybe it's failing somewhere else.

I could try and add some more logging and give you a build (unfortunately I don't have a Linux box, and it works fine on my MacBooks), or if you want to try and debug it, it might be quite simple:

  • Clone this repo
  • Open in VS Code
  • Navigate to this code and add a breakpoint
  • Press F5, which will launch another copy of VS Code ("the dev extension host") running the from-source version of the extension
  • Open a Flutter project in that version, right-click on the Android folder and choose Open in Android Studio

This should hit the breakpoint back in the main VS Code window, and you could step through to see if you can understand what's happening (or post more info that might help me understand).

Otherwise, I should probably try and get a VM or something set up and see if I can repro there (in which case I'd be interested in knowing which distro you're using, and any instructions you think might be important to try and set things up similar to yours).

@audkar
Copy link
Author

audkar commented Mar 9, 2019

All we're doing here is grabbing android-studio-dir then appending bin/studio and executing it.

Oh. My AS instalation in bin directory contains studio.sh instead of studio. So calling /home/audrius/.local/share/JetBrains/Toolbox/apps/AndroidStudio/ch-0/183.5320907/bin/studio returns no such file or directory

@DanTup
Copy link
Member

DanTup commented Mar 9, 2019

Aha, I'll do some digging and find out if it should always be that way then. Windows and macOS are handled separately, so I think adding .sh should be easy if it's always that way on Linux. Thanks!

@DanTup DanTup added on linux and removed awaiting info Requires more information from the customer to progress labels Mar 9, 2019
@DanTup DanTup closed this as completed in a446e4c Mar 11, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in editor Relates to code editing or language features is bug on linux
Projects
None yet
Development

No branches or pull requests

2 participants