Android Studio used to have the option to debug existing APKs from the File->Profile or Debug APK. I have used it in Android Studio version 3.4. Now at version 3.4.1, I cannot find it.
Does anyone know if the option was removed from Android Studio or where can I find it?
I had this same issue and here's how I solved it.
I had disabled APK and NDK support in hopes that it would speed up my IDE. I forgot to turn them back on. So I went into Preferences > Plugins and if you don't have them installed, install Android NDK and Android APK support. If you already have them installed, tick Android APK Support and it will prompt you to enable Android NDK Support if you don't have it enabled already.
Since Android Studio menu can be customize, by some way the option has been removed from your toolbar. To add it again go in File -> Settings -> Appearance & Behavior -> Menus and Toolbar
From here open the Main menu -> File -> File Open Actions folders.
Select the Open line, then click on the plus sign on top of the window next to the search bar. Click Add Action... and search for Profile or Debug APK... options.
Apply and you're good to go !
Edit
After some exchanges in the comments we fixed the issue another way.
You have to go into Settings -> Plugins first. Check if you have the plugin Android APK Support activated/installed. If not then install/activate it.
And now you're really good to go !
That's weird because I am using android studio 3.4.1 and its there:
When I had problems after updating android studio all I did was to re-install it and my problems got fixed.
Also, you should know that downloading another version of Android studio is really user-friendly, check my question about it.
Yesterday, Google updated Android Studio to version 3.3 and there it was possible to use a static analyzer for libraries supporting C ++. So, how exactly to use it? I include in:
Preferences->Editor->Inspections->General->Clang-tidy
(Use IDE setting )
but nothing else. If you try through the terminal for the android studio - Then you need to write all the dependencies manually, which is not correct, apparently. And my question is - how in uses cland-tidy for Android studio version 3.3?
I would be grateful for any help and support.
From Android Studio main menu: Analyze -> Run Inspection By Name...
select 'Clang-Tidy', "Run 'Clang-Tidy'" dialog box will appear. Set up needed options and click 'OK'. In the end of the inspection results will be displayed in "Inspection Results" bottom tab.
I wanna create a new project in Android Studio and when it will finish and it shows me some error in bottom right dialog and when I click on error box.
Below is the error image
Why it shows me this error?
How can I fix it?
Yesterday I have faced this problem and I did like this it resolved.
First uncheck the Android Apk Support and click on OK
then, Go to File --> Settings --> check on Android Apk Support and Click on OK.
I know it's a kinda weird but it works ...
Click on Enable plugin for enable it. Then it will be fine.
I am working with a Flutter example project where it shows how to share a FlutterView inside an Android application (and iOS also).
While working with it I tried this:
I make changes to the android project like changing the theme color, if I do hot-reload/run for main.dart I don't see the changes reflected in the running app. I have to stop it from Android Studio and run the main.dart again to see the changes.
To solve the issue I was thinking to add a run/debug configuration for Android app module. So that I could run android app and not main.dart.
Is there a way how to achieve this in Android Studio?
One solution for me was to open the android(/flutter_view/android/app) project from a new window in Android studio. I could run the app this way.
(But here I encountered another issue in case anyone has the solution).
According to my understanding you face problems when you open your project and try to run.
Android studio asks you to configure your project to be able to run...
It's easy to solve near to run button you will find "add configuration" button just press then from left side select "flutter" and put in the field "entrypoint" your main Dart file path main.dart...
EX. E:/project/lib/main.dart....
Then from top right corner press "create configuration"...
That's it.
For Configure your Flutter app on Android you have to Upgrade Gradle file..
So Go to the Tool and at you will find AGP upgrade Assistant..
It Download new Gradle file then its Config automatic..
I can't click the run button. Does anyone know how to fix it?
Click Run on the menu and then Edit Configurations... then click on Android Application on the left and click the + button. Choose Android Application from the pop-up menu. Then pick the module (its normally app or something like that). Then click apply and ok.
If you have more errors after that, try to re-import the project in Android Studio.
When creating the Run Configuration, the dropdown for Module had only <no module> for me. Invoking menu File -> Sync Project with Gradle Files added app to the dropdown for Module. Then the Run button became enabled.
The above answer didn't work for me, instead closing the project and restaring the AS IDE worked for me.
Just click the dropdown button on left side of RUN button (in your image the dropdown which is in red box) select 'app' option from that and RUN button will be enabled.
Please refer below screenshot.
just to go File -> Sync Project with Gradle files then it solves problem.
for flutter project, if the run button is disabled then you have to
tools>> flutter>> flutter packages get >>enter your flutter sdk path >>finish
This should solve your problem...
Above answer didn't work for me, just do click File -> Invalidate/cache -> Invalidate and Restart.
open your existing application by selecting build.gradle file. it will automatically sync the project and run button will be clickable
Run 'app' button disable issue coming sometimes in Android Studio Dolphin
Sync your project with gradle files
It was quite silly for me, I just opened the Run > Run Configurations window
everything seemed to be fine there, I didn't change anything, when I closed the window the button was enabled.
If you have changed jdk version then go to File->Project Structure->Select SDK Location from left bar->update JDK Location in editbar in right bar.
If your IDE is in power save mode, then the run button etc. are also disabled.
You can verify this via the file -> power save mode, make sure it is disabled.
If you are on a Mac, try clicking on File, then click on "Sync project with Gradle files" .... Run button should turn green again in a few seconds.
if you're importing an eclipse project to android studio, you'll also encounter the same issue as above. Double Check if grade>app has
apply plugin: 'com.android.application' on the top as sometimes android studio imports it as a library.
You have to reconfigure the FlutterSDK path in Android Studio: Go to Setting -> Language & Frameworks -> Flutter and set the path to Flutter SDK
I just clicked on the debug icon and it started working.
Build->Clean Project
make the run button enable again in my case
For me increasing the version of compile SDK to latest solved my issue, Go to
build.gradle(app-level)
compileSdkVersion 30
Because My Emulator is Api-level 30
Select the project view in the android studio.
Remove all gradle folders.
Restart the android studio.
This will work.
The issue is happening since the gradle was configured for an android studio in another machine and the files pushed on the git and are using in your studio.
After removing these gradle files and restarting the studio, the studio will generate gradle files for your system. This will solve the issue.
I opened the wrong folder.... Verify is your root folder in Android studio has the build.gradle file.
If you are trying to run the Flutter Project in Android Studio, and the run button is disabled then here is the solution
Click on add configuration
and select Flutter and then select the main class in dataentrypoint
I'm using Linux where I had a symlink in my home folder pointing to a folder containing the Android Studio projects. Loading a project using the symlink failed, loading a project from the folder where the symlink is pointing to worked!
My solution was to go to that multiselect button, then "Edit Configurations" -> Go to "+" and select the module (in this case it would be an app if you do not have a multiproject -> then apply and OK
Happened to me twice, and then I figured out it happened after I upgraded my flutter version. When I opened (flutter SDK path) in (flutter) tab in (system preferences) I found it empty.
Solution was to point out to flutter directory on my disk from (flutter SDK path) in (flutter) tab in (Android studio preferences).
Run button is bounded with Configuration that is why you should check if your project is build, synced and indexed and after that you can select a Configuration
For me, more than 1 instance of adb was initialized and due to this run button was disabled. I had to open ActivityManager (on mac) and kill all the initialized adb instances.
go to Build-> Clean Project
Selecting a different build variant (in the Build Variants view), then reselecting the initial build variant, fixed this issue for me.