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.
Related
Does anyone have such problems as:
Cannot install debug-apk because cannot find Application file, which exists in Androidmanifest.xml or:
The APK file /home/skullper/AndroidStudioProjects/app_pay/app/build/outputs/apk/app-debug.apk does not exist on disk.
Error while Installing APK
Of course I can fix this with ./gradlew assembleDebug, but I should launch this each time before run, otherwise it will run only assembleDebug build
Issue with kotlin std in projects with Java only
When I was using 3.0 everything was ok and I haven't such issues. What should I do to run my project???
UPDATE
Everything works. Answer in comments under question.
Thank to all who was trying to help
Try rebuilding your project and reinstall if nothing helps, I had this bug on my old computer and rebuilded helped.
Though if you reinstall Android Studio, make sure you delete the AVR folder properly! Otherwise the bits remaining from the previous version will alter the new installation completely useless.
did you try to go to Android Studio's File menu and select Invalidate Caches / Restart... option, then restart Android Studio?
If so try this:
1- Remove the directory ~/.gradle/caches/. It's OK to do this while Android Studio is opened. (Refer pm installing wrong package name)
2- Press "Sync project with Gradle files" icon on Android Studio
3- Run the project and the remote path will be correct.
Try this:
1 - Go to "Run/Debug configurations"
2 - In "Before launch" click in the "+"
3 - Add "Gradle-Aware Make"
4 - Click OK
Image here
Hope it helps
I have a project files.i need to understand the flow of the project but When I try to run my app back in Android Studio an “Edit Configuration” tab appears and I have the options to update settings regarding the package, activity and target device however I am not sure what to select.
Has anyone else come across this problem? please help me
OK. I got you .
Please follow the steps below:
Click on File -> Project Structure ->(under Modules click on) app -> [Now you can select 'compile sdk version' and 'build tools version' accordingly from this window] -> click OK -> sync your project -> now clean and run the project.
NB: You have to choose the sdk version and build tools version - which is already downloaded in your android studio
It looks like you have not configured Android app, just click on the "Select Run/debug Configuration" which is on the left of RUN button and click on Edit Configurations. This will open a new screen where you can add a new configuration.
Another issue is, you might not have Sync the project.To sync the project, go to build.gradle file -> Sync Now. If it is not not working, then change accordingly and then press "Sync Now" or "Try again".
Also make sure that, if in case you have imported the modules, configure and import it correctly.And make sure that your build.gradle file is correct.
Re-opening the android studio worked for me once i got this issue.
In activity, select the Default Activity and in target device, Select whatever you are using(i.e Emulator or USB device).
Simply Solve the problem just in one click i.e
In Android Studio right side vertical "Gradel" option is there and click on "Refresh all Gradle Projects" (icon like refresh)
Updating the libraries worked for me.
Go to the event log on bottom right and it will show the libraries which are outdated or not working properly !
At office, I am behind a proxy. The internet access is restricted.
So I performed a gradle sync at home and copied the folder ".gradle" present at C:\Users\username.gradle from my home PC to the same location on my office PC.
Now on my office PC, I set gradle in Android Studio to "Work Offline" but still whenever I try to perform a gradle sync, I get an error stating
Error: Could not download google-services.jar (com.google.gms:google-services:3.0.0): No cached version available for offline mode
However on digging through the ".gradle" folder I was able to locate the google-service.jar file at
C:\Users\username\.gradle\caches\modules-2\files-2.1\com.google.gms\google-services\3.0.0\32b833222c886ecfb37d79b1a05ce1eddb702db1
I am not sure how to proceed. Please help.
I had to dig for this a long time in the 2019.2 version. This option has moved in the UI. It is now in the toolbar of the gradle tools:
see JetBrains documentation at https://www.jetbrains.com/help/idea/jetgradle-tool-window.html#offline
This Error occurs when in your Android Studio's Gradle Tools Offline Mode option is Enabled.
When Enabled it lookes like this.
To fix it, you can Disable mode by clicking on the option shown in below screenshot.
> Update: I heard Google Listened to the suggestion! and now in new android studio versions, when you start a new project, a popup will come with option to either build with gradle online or offline.. Great for you all..
You need to re-enable your gradle online mode
Google changed the location of doing this...
After the latest version as at this time i am typing this answer, which is version below
Android Studio 3.6.1
built on February 27, 2020
I have sent a message to the them so Google changes this in next update..Cos the new location confuses the Software engineers who are used to the old way of doing it...
But for now follow these clear 2 steps to find it and toggle it Online or Offline easily..
Just Go to the top-right hand corner of your SDK and click the vertical Gradle tab as circled in red in the my picture below...
Then you Click this icon (which looks like a symbol in an electrical schematic circuit) on the gradle table that comes out.. As Circled in Red in my picture below..
Maybe helps someone. Just remove --offline in "Command-line Options:"
click on gradle on the right
toggle offline mode
try again (sync with gradle files)
It seems that in newer versions of IntelliJ (I am on 2018.1) you may need to uncheck the Offline checkbox in Gradle preferences.
Just for reference 2019.1 Ultimate IntelliJ, go to Gradle -> Settings (a top-rightmost icon) -> Uncheck the Offline work in Global Gradle settings.
Gradle Tab not presented, go to View -> Tool Windows -> Gradle to show it first.
I'm using android studio in MacBook
step 1 - Go to preferences by clicking android studio on the left
uppermost corner.
step 2 - Go inside Build,Execution,Deployment.
step 3 - Finally select Gradle.
step 4 - then, uncheck offline work. Click apply then ok.
step 5- lastly try to sync once again.
Hope this will work because it works for me.
You can set startParameter.offline=false in your settings.gradle
Try running gradle with the --debug flag, in addition to the --offline flag. That will tell you exactly where it's looking for the files.
One possible reason for the error is that the path of the .gradle folder is different between your home and office PC, possibly because your username is different on each machine. The .gradle cache uses absolute paths (see .gradle/caches/modules-2/metadata-2.16/artifact-at-repository.bin for an example). This is a documented Gradle issue: https://discuss.gradle.org/t/copying-the-gradle-cache-to-another-machine/7546/13. If possible, use the same GRADLE_HOME at home and work to resolve the issue.
How to configure gradle to work "offline" (using cached dependencies)
Uncheck the 'Offline work' under the Global Gradle settings fixes my issue.
I have a problem with my Android studio 2. That's whenever I want to clean or rebuild my android project, I always get this message
Error:Execution failed for task ':app:clean'.
Unable to delete directory: C:\Users\MyPC\Desktop\SharePlace\app\build\intermediates
and can not fix it. what I only can do is go to File explorer and delete it.
then come back android studio and rebuild again. Sometime, that way also does not work.
I need some help to fix that Android studio. Please.
Thank inadvance!
Solution 1 :
you are using Android Studio 2.0 Beta, this issue might appear (more likely if you are working on NTFS filesystem) and it seems like the "Instant Run" is the culprit. Search for "Instant Run" in settings and uncheck the box.
I have filed an issue on the bug tracker.
Solution 2 :
You need to go to the source file directly. Close the studio and go to the path the issue is located at and delete the folder there.
I got a lot of faults like this.
Try to refresh all gradle projects: in Android Studio click on the "Gradle" tab on the right side of the window. When the gradle menu is shown, click on two blue mixed arrows icon. Then wait a moment until gradle completes refreshing and try cleaning or rebuilding again.
For me it was fixed by running Android Studio as administrator.
Manually deleted folder( build\generated and build\intermediates) after closing android studio works for me.
Found the solution. For windows, goto Task Manager and find your Android Studio. Expand it and end task for OpenJDK Platform Binary as depicted below
screenshot.
Then re-run your app in Android Studio again. It should work, and you don't have to restart your Android Studio all the time. More productivity~
After updating Gradle as suggested in this answer the following error appears while using Android Studio 0.2.0
How to get over this one?
go to Settings-Plugins-IDE Settings and just disable and enable again needed plugins - it helped me.
I think it was some bug on Studio
I have the same error, and I solve it as mentioned above:
go as flow file-->settings-->plugins
then uncheck the red options
apply settings You will get error message no problem
recheck the unchecked options
press ok
it will request to restart android studio press ok button and it will solve the error and work fine again
1.Go to settings -> uncheck all red check one's -> apply
2.It will restart your android studio -> OK
3.Go to settings -> Plugins -> check the unchecked one's->apply
4.Restart and update them all.
//done
//thankyou
I try to remove and reinstall Extras or disable and enable plugins but the problem is not solved.
I find a solution to correct that is to reset Android Studio You have to remove this directory and restart Android Studio to detect the SDK location:
~/Library/Preferences/AndroidStudio*
~/Library/Caches/AndroidStudio*
~/Library/Logs/AndroidStudio*
As you see, image uploaded by you, Configure, go to that menu. Now click on Settings. Try to find Plugins in IDE Settings. Here look out for Gradle and check whether it is installed or not.
If not, Click on Install JetBrains Plugin... or Browse Categories and find Gradle. Now on top, besides Refresh button there is a Download and Install button. Using that button install Gradle Plugin.
Andorid studio -> preferences > plugins, enable "support" plugin. And then if there are red plugin, disabled it and restart android studio
Go to File->Settings-> Plugins then uncheck then check all the red highlighted plugin then restart the android studio if require
I solved it this way..
Go to file then settings (Ctrl+alt+S) > then go to plugins > on the "show" dropdown button select disabled > unchecke the check-buttons then they'll disappear> again select disabled then check them and press OK. On request to restart android studio, restart it and it'll be working fine
For Mac, this worked
Menu > Preferences > Plugins
Uncheck all
Android studio will ask to restart, restart it
Check all again
Restart Again
And Voila!
Unchecking the gradle plugin and checking it again then restarting android studio and selecting the SDK location and downloading the missing dependencies worked for me
I solved this problem with reset android studio settings.
On Windows:
Go to your User Folder - on Windows 7/8 this would be:
[SYSDRIVE]:\Users[your username] (ex. C:\Users\JohnDoe)
In this folder there should be a folder called .AndroidStudioBeta or .AndroidStudio (notice the period at the start - so on some OSes it would be hidden).
Delete this folder (or better yet, move it to a backup location - so you can return it if something goes wrong).
This should reset your Android Studio settings to default.
https://stackoverflow.com/a/19397632/793880
2020/12/10 - Ubuntu 18.04 and Android Studio 4.2
I solved it this way:
Using strace I've found the user installed plugins directory on "/home//.local/share/Google/AndroidStudioPreview4.2" (not documented in any place i've read, nor official doc, nor IntelijIdea either)
Just deleted the directories of the failing plugins (that are not listed with installed plugins, so can't uncheck anything), and problem fixed.