How to show Android Gradle Plugin update dialog again - android-studio

I've updated Android Studio and the dialog for Gradle Plugin update appeared. I've accidentally clicked Don't show again for this project. How can I display the dialog again?

According to this answer you should look for a file .idea/workspace.xml in the project directory and remove property line below.
<component name="PropertiesComponent">
...
<property name="show.do.not.ask.upgrade.gradle.plugin.version" value="2.2.0" />
...
</component>
Also, it's related to a specific gradle version, so if you update it once, you'll see the dialog again the next time.

inside the project directory open the file .idea/workspace.xml
find the line (search for upgrade word)
<property name="sync.plugin.last.upgrade.timestamp" value="154032093109" />
if you change this to a smaller integer like 15403293109 (removing one number from middle) will make the last check date to a previous time and the upgrading dialog will be visible again.

In Android Studio Project, Go to
-> File -> Settings -> Version Control -> Confirmation
Here you will see "Display Options dialog when these commands are invoked".
Now enable the check box "Update". That's all.

With the build.gradle file open in Android Studio, hover your mouse over the yellow text and choose "More actions..." -> "Invoke Upgrade Assistant"

Related

how to include excluded folder in android studio [duplicate]

It's explained how to exclude a directory in Android Studio here. It also has a warning about not knowing how to include it back again. Now I need to do so.
Of-course I can create/import the project again. But I guess there's a better way of doing that. Is there? How?
As there is no "Mark directory as" menu in Android Studio, I found out that such settings like including and excluding directories are stored in a ".iml" file. Named like "project-name.iml".
A line like bellow is used to exclude a dir:
<excludeFolder url="file://$MODULE_DIR$/src/main/blah/blah/blah/" />
So, Re-including is done as easily as removing the line.
if you right click an excluded directory in the Project View, you can select from the context menu:
Mark directory as → Cancel exclusion
You must delete .iml file then try to sync and it will work fine

Change app icon of exe in JetBrains Rider

I searched the IDE and online but didn't find anything so I'm asking:
Is there any way to change the application icon of the executable file for the current project in JetBrains Rider?
For now, Rider doesn't have UI for that, but you can do it from code. Press F4 on a project or Select "Edit 'YourProjectFile'" from the right-click menu to edit the project file and add these lines into the Project element:
<PropertyGroup>
<ApplicationIcon>YourIcon.ico</ApplicationIcon>
</PropertyGroup>
YourIcon.ico is the project directory based path where your icon is located.

Missing project.gradle in Android View

In Android Studio, project.gradle file is not show when in Android View, but is when in Project view
Android View
Project View
How can I fix this ??
From the Gradle Tool Window in Android Studio (View > Tool Window > Gradle),
Right click on the the project's Gradle config with (root) next to its name.
Click on Ignore Gradle project,
and right click again then click on Unignore Gradle project.
The trigger to this 'buggy' phenomenon actually lies outside your project folder.
Assuming a project name of 'SilverBirch', try this:
(a) Close the project in Android Studio 3.0.1.
(b) Rename your project folder (inside the workspace folder) to 'SilverBitch'
(c) Re-open it via Android Studio (you obviously can't do so using 'recent projects')
(d) You should get a window titled Import Gradle Projects with text that reads: The modules below are not imported from Gradle anymore. Check those to be removed from the ide project too:
(e) Tick the (old) project name and click OK.
(f) At last your 'Android' view shows build.gradle(Project:SilverBitch)
(g) Repeat whole process, renaming back to original.
Alternatively, if you're insane, do this:
Locate the project.dat file AND folder for your project - it will have a path that looks something like this (assuming Windows)
C:\Users\<userid>\.AndroidStudio3.0\system\gradle\Projects\5be1ee38\project.dat
[The system-generated hex-string container name will vary, but the file is always project.dat]
The first line of this file references the 'missing' build.gradle and will clearly identify the owning project.
Delete the file AND its containing folder then re-open the project via Android Studio.
Because googling 'project.dat' yielded nothing, and because I made a rude assumption that this contained only system-generated data, and because I couldn't resist 'seeing what happens' I actually deleted
the entire Projects file [C:\Users\<userid>\.AndroidStudio3.0\system\gradle\Projects]
So far, so good - no serious side-effects yet! Maybe those plugins needed re-specifying anyway? etc.
Close Android Studio -> Remove project .idea folder -> Open Android Studio -> Open your project. This worked for me!
NOTE: when you remove .idea folder you will also lose project related preferences (such as XML code style for project)
Right Click on "Gradle Scripts"
Click Load/Unload modules
Load unloaded project module
Done
In my case, I found that my project.iml located in project/.idea
So I move it to project/
and change one line like following:
<module fileurl="file://$PROJECT_DIR$/My_Project.iml" filepath="$PROJECT_DIR$/My_Project.iml" />
the old one should look like this:
<module fileurl="file://$PROJECT_DIR$/.idea/My_Project.iml" filepath="$PROJECT_DIR$/.idea/My_Project.iml" />
After that, go back to android studio, every thing seems perfect!
This worked for me:
In your root project folder, open the *.iml file, and make sure that the value in module external.linked.project.id=, the *.iml filename, and the project directory name are all the same.
Now my build.gradle (Project: X) shows.
This worked for me.
Simply go to your AndroidStudioProjects Directory.
Search for your Project
Rename it with some other name
Strat your Android Studio, and then Import Project (Gradle, Eclipse ADT, etc.)
mode. let the Gradle Build Finish.
And that's it.

Android Studio project folders not showing

I am unable to see the folders that are physically existing, this is the case.
But in actual fact I have other folders as welll
So what can I do?
Above your the file directory view in Android Studio is a drop down which currently is most likely set to Android. Change it to Project and you should be able to see all your files.
I tried the all the approaches mentioned above but can't fix rather than fix it by a hardcore approach -
Step 1. Close your Android studio.
Step 2. Delete .gradle and .idea folder from your project directory.
Step 3. Open your project and you will see the files again.
go to View menu then click tool window then after click on project
view->toolwindow->project
it worked for me
for me doing the following works:
from menu go to: View--->tool windows ---> Project
then click the little gears icon (settings) you will see an option to change the empty middle packages. it looks like this:
disable "Hide Empty Middle Packages" under the Project View settings dropdown and then it should make everything show up.
If anyone ever does what I did maybe this will help:
Android Studio does not like it when module names begin with a number. I was learning from some tutorials and named the first module "1-name" and the next one "2-name". Setup was fine and it ran, but only the "Gradle" Scripts entry would show in the navigation window in "Android" mode.

Count lines of code in all java classes in Android Studio

Is there any way I can view the total lines of code in each java class in my project?
Looking for something like this for Android Studio.
Go to
https://plugins.jetbrains.com/idea/plugin/4509-statistic
and install the latest version
To install
Run Android Studio
From the menu bar, select File-->Settings
Under IDE Settings, click Plugins, and then click Install plugin from disk
Navigate to the folder where you downloaded the plugin and double-click it
Restart Android Studio
To count the lines
Check the statistics option that is visible after installing the
plugin
This option is near the run, debug, gradle console, bottom left corner of Android studio
21/05/2015
If you cannot see the Statistics options, do the following:
Select VIEW from the toolbar.
Select TOOLS Windows.
Choose STATISTICS.
You will see the statistics of your project and at the bottom, there is TOTAL section which displays the total lines under the Column of LINES.
You could try this plugin (It is for IntelliJ but should work with AS): http://plugins.jetbrains.com/plugin/?idea&id=4509
Goto the link https://plugins.jetbrains.com/plugin/4509-statistic and install it.
General Usage Instructions
Install plugin from official Jetbrains plugin site,
After installing, just click on the TAB "Statistic" at the bottom of the screen (left side),
Click "Refresh" button to run statistic for whole project,
Click "Refresh on selection" button to run statistic for selected directory,
Click "Settings" button to customize plugin behavior,
Adjust "Excluded file types" with all extensions which you want to remove from the statistic (e.g. class;jar;...),
Adjust "Seperate TABs file types" with all extensions which you want to have in separate tab (e.g. php;java;...),
Note:
Size - total size of the file,
Size Min - size of the smallest file of the given type,
Size Max - size of the biggest file of the given type,
Size Avg - average size of the file of the given type.
Jetbrain's statistics plugin is counting only .java files. It is not accurate for getting android app source line of code.
We can use locmatrics for this.
http://www.locmetrics.com/
This will return loc for all the entered extensions.
Please set a valid output directory while checking this. Otherwise garbage files will be generated inside source directory

Resources