In Android Studio 3.1 Beta 1 (and 3.2 Canary 1) indexing is triggered every 2 seconds, which makes e.g. code completion tooltips go away. Excerpt from the log (this continues forever):
2018-02-04 12:39:19,749 [e-1024-b01] INFO - pl.ProjectRootManagerComponent - project roots have changed
2018-02-04 12:39:19,762 [ thread 11] INFO - .diagnostic.PerformanceWatcher - Pushing properties took 1ms; general responsiveness: ok; EDT responsiveness: ok
2018-02-04 12:39:19,772 [ thread 11] INFO - .diagnostic.PerformanceWatcher - Indexable file iteration took 10ms; general responsiveness: ok; EDT responsiveness: ok
2018-02-04 12:39:21,760 [e-1024-b01] INFO - pl.ProjectRootManagerComponent - project roots have changed
2018-02-04 12:39:21,772 [ thread 12] INFO - .diagnostic.PerformanceWatcher - Pushing properties took 0ms; general responsiveness: ok; EDT responsiveness: ok
2018-02-04 12:39:21,776 [ thread 12] INFO - .diagnostic.PerformanceWatcher - Indexable file iteration took 4ms; general responsiveness: ok; EDT responsiveness: ok
This also happens when there's no tab with Flutter/Dart code.
main.dart file[✓] Flutter (on Mac OS X 10.13.3 17D47, locale en-PL, channel dev)
• Flutter version 0.0.22 at /Users/wasyl/flutter
• Framework revision 3001b3307d (5 days ago), 2018-01-30 11:37:15 -0800
• Engine revision 8f2d72b183
• Tools Dart version 2.0.0-dev.16.0
• Engine Dart version 2.0.0-edge.7af4db0ea091dddca6b2da851e6dda8d7f9467e8
[✓] Android toolchain - develop for Android devices (Android SDK 27.0.3)
• Android SDK at /Users/wasyl/Library/Android/sdk
• Android NDK at /Users/wasyl/Library/Android/sdk/ndk-bundle
• Platform android-27, build-tools 27.0.3
• ANDROID_HOME = /Users/wasyl/Library/Android/sdk
• Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java
• Java version OpenJDK Runtime Environment (build 1.8.0_152-release-915-b08)
[-] iOS toolchain - develop for iOS devices
✗ Xcode installation is incomplete; a full installation is necessary for iOS development.
Download at: https://developer.apple.com/xcode/download/
Or install Xcode via the App Store.
Once installed, run:
sudo xcode-select --switch /Applications/Xcode.app/Contents/Developer
✗ libimobiledevice and ideviceinstaller are not installed. To install, run:
brew install --HEAD libimobiledevice
brew install ideviceinstaller
✗ ios-deploy not installed. To install:
brew install ios-deploy
✗ CocoaPods not installed.
CocoaPods is used to retrieve the iOS platform side's plugin code that responds to your plugin usage on the Dart side.
Without resolving iOS dependencies with CocoaPods, plugins will not work on iOS.
For more info, see https://flutter.io/platform-plugins
To install:
brew install cocoapods
pod setup
[✓] Android Studio
• Android Studio at /Applications/Android Studio 3.2 Preview.app/Contents
• Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1024-b01)
[✓] Android Studio
• Android Studio at /Applications/Android Studio 3.1 Preview.app/Contents
• Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1024-b01)
[✓] Android Studio (version 3.0)
• Android Studio at /Applications/Android Studio.app/Contents
• Java version OpenJDK Runtime Environment (build 1.8.0_152-release-915-b08)
[-] IntelliJ IDEA Community Edition (version 2017.3.3)
✗ Flutter plugin not installed; this adds Flutter specific functionality.
✗ Dart plugin not installed; this adds Dart specific functionality.
• For information about installing plugins, see
https://flutter.io/intellij-setup/#installing-the-plugins
[-] Connected devices
• None
This is in android studio 3.1 (not in the stable android studio)?
This looks suspicious:
INFO - pl.ProjectRootManagerComponent - project roots have changed
but I'm not sure what would be causing it. This:
This also happens when there's no tab with Flutter/Dart code.
Makes me think that this is an issue with Android Studio itself, and not necessarily the Dart or Flutter plugins. Perhaps re-file this issue here: https://developer.android.com/studio/report-bugs.html ?
I don't have much time, so will investigate later, but regular (big) Android project doesn't trigger indexing, and I've been working on 3.1 for a long time now, and never had this problem.
I've tinkered a bit with the project, removing things one by one, and at some point indexing stopped and seemed to work after I restored all the files. But as soon as I restarted Android Studio, indexing is resumed, and removing things from iml file doesn't seem to work.
Things I've tried that seem to help (sometimes) is removing and readding contents of configuration tag in .._android.iml project. This triggers autogeneration error and indexing stops, but I'm not sure whether everything works normally afterwards
I just updated to Android Studio 3.1 and have the same problem. How do I convert my existing project to get rid of this constant refreshing?
The workaround of @lwasyl worked until I restarted Android Studio, when the issue came back.
We're releasing a new version of the plugin shortly which will address this; thanks for your patience!
For those who are curious, you need to change your android facet (in the module definition *.iml file) to include this:
<option name="ALLOW_USER_CONFIGURATION" value="false" />
That is required by a change in the Android Studio code that was made in 3.1. You can dig through #1908 for the details.
@stevemessick where exactly do i put this in my .iml file(s)? I've tried in various spots and the indexing/insanity continues
@acidjazz I've added that line in the <myproject>_android.iml file at the root (not in <myproject>.iml). It looks like this currently:
<?xml version="1.0" encoding="UTF-8"?>
<module type="JAVA_MODULE" version="4">
<component name="FacetManager">
<facet type="android" name="Android">
<configuration>
<option name="ALLOW_USER_CONFIGURATION" value="false" />
<option name="GEN_FOLDER_RELATIVE_PATH_APT" value="/android/gen" />
<option name="GEN_FOLDER_RELATIVE_PATH_AIDL" value="/android/gen" />
<option name="MANIFEST_FILE_RELATIVE_PATH" value="/android/AndroidManifest.xml" />
<option name="RES_FOLDER_RELATIVE_PATH" value="/android/res" />
<option name="ASSETS_FOLDER_RELATIVE_PATH" value="/android/assets" />
<option name="LIBS_FOLDER_RELATIVE_PATH" value="/android/libs" />
<option name="PROGUARD_LOGS_FOLDER_RELATIVE_PATH" value="/android/proguard_logs" />
</configuration>
</facet>
</component>
<component name="NewModuleRootManager" inherit-compiler-output="true">
<exclude-output />
<content url="file://$MODULE_DIR$/android">
<sourceFolder url="file://$MODULE_DIR$/android/app/src/main/java" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/android/gen" isTestSource="false" generated="true" />
</content>
<orderEntry type="jdk" jdkName="Android API 27 Platform" jdkType="Android SDK" />
<orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="library" name="Flutter for Android" level="project" />
</component>
</module>
@acidjazz dude instead of waiting for someone else to fix - find a way. Download an older version of Android Studio, do some searching on StackOverflow, follow the instructions above. The longer you wait for someone else to solve your problems the more miserable you will become. Become your own hero.
To fix the refresh issue on projects already open in 3.1 you need to close them then re-open them. Use the Welcome screen item named Open an existing Android Studio project. See #2017 for more info.
@SeaRoth lol that's been the struggle.
@stevemessick closing and re-opening projects did not work.
I did finally find a way to stop the poltergeist was to kill my .idea folder completely and then re-activate the flutter and dart plugins, this was suggested by @tamcy here
Thanks all for the feedback, and sorry for the indexing issues.
It sounds like from above, that deleting the .idea/ folder will work to address the re-indexing issue.
We're also looking to release a patch to the current release, which will disable the android studio setting (<option name="ALLOW_USER_CONFIGURATION" value="false" />) for each project once, as we open it.
@devoncarew I'm sorry to be a bearer of bad news but that method didn't last long for me, see here
Deleting the .idea/ folder works well for Android-Studio 3.1.
Rollback Android studio to 2.3 also works :)
@stevemessick This is happening to me on a regular Android Java project - no Kotlin or Flutter involved.
Deleting the .idea folder didn't solve the problem, nor did closing/re-opening the project or restarting the ide and even the computer.
I'm using Android Studio 3.1.1, Gradle 4.4 and Android Gradle plugin 3.1.1.
My project is a multi-module project (not sure if it's related).
This causes the IDE to become unusable as it causes the UI to blink every second.
I've just noticed that this is a repo for flutter (arrived here from a Google search on AS indexing all the time) so this might not be the best place to post it.
Sorry about that, but I couldn't find anywhere else where this issue was being discussed.
I've submitted an Android Studio bug report - https://issuetracker.google.com/issues/78378464
Can you help investigate?
Any stable solution yet? It seems to be unusable now.
Update: File -> Invalidate Caches / Restart.. helped me. Now don't see this problem with Android Studio 3.1.2
Hi - as per #2017 - if your comments are about continuous indexing when using Android Studio without it being a Flutter project, please follow up on the above Android Studio bug; thanks!
File -> Invalidate Cache/ Restart... works for me
not in this project ,I met this probrem more then one time,
do it just clean project, and then is fine
Invalidating cache helped me too, thanks!
Invalidating cache helped me too, thanks! (On a Java/Kotlin based project)
File / Invalidate Cache / Invalidate and Restart helped me too thanks
File / Invalidate Cache / Restart worked . Thank you
File / Invalidate Cache / Invalidate and Restart helped me too thanks
File/invalidate cache/ after that restart and it will be fine
yeah just click File/invalidate cache/invalidate and restart, and the problem about indexing solved
I'm programming in Java so I'm not sure if this is relevant but I noticed that this issue started when I typed in R (to refer to a layout file) in a fragment class. Strangely, if I removed the R, the indexing stopped.
Invalidating the cache/restart did help stop the issue though.
File / Invalidate Cache / Restart worked not work for me T_T
flutter 0.7.3 linux
android studio 3.1.4
project : java/switf
At first it seems to work using File / Invalidate Cache / Invalidate and Restart,
but it still indexing, using 3.1.4 on MacOS 10.13.6
Edit: After installing a Plugin Suggestion pop up, it fix the problem.
<option name="ALLOW_USER_CONFIGURATION" value="false" />works for me.
android studio: 3.2.1
project: decompiled apk -> smali
deleting .idea folder is working. thanks for the person who provide this idea :)
I have also encountered this problem at version 3.1.3 when I renamed the project folder(added date and time like this:080119_0130am). I just renamed this back to a shorter name to fix the issue.
Most helpful comment
File -> Invalidate Cache/ Restart... works for me