Android Studio adds closing curly brace although a closing brace is already present
Since today I experience a really annoying behaviour in Android Studio. It happened after a restart to clear the cache.
I have the following situation:
} else {}
The cursor is between the curly braces at the end. After pressing enter the following happens:
} else {
} }
Instead of just adding a new line Android Studio adds two new lines and a closing curly brace. This happens for all scenarios where the pointer is in between an opening and closing curly brace. They don't have to be on the same line. Does anyone experience this issue as well?
I'm on Android Studio Chipmunk | 2021.2.1 Patch 1
Build #AI-212.5712.43.2112.8609683, built on May 18, 2022
Is there a possible connection to the Kotlin plugin? Non-Bundled Plugins: org.jetbrains.kotlin (212-1.7.10-release-333-AS5457.46)
I just installed an update of it today.
Please sign in to leave a comment.
Please share the IDE logs and settings for the investigation. The files can be uploaded at https://uploads.jetbrains.com (do not forget to specify the UploadID)
The UploadID for the settings is 2022_07_11_hPGx5At6YztNt67WHVcoFK.
Uploading the log results in an error. I will try again and post the UploadID.
I zipped it. Here is the log file.
Upload id: 2022_07_11_25Ppngzf6YoTgTC2qRtUKW (file: idea.log.zip)
Please try to temporarily disable the following plugins:
I've disabled the mentioned plugins and restarted the IDE.
The problems still exists.
Here is the log and settings export with the disabled plugins:
Upload id: 2022_07_12_e1GN5VP533fPcyzDrwJvhW (file: Archive.zip)
Unfortunately, the problem is not reproduced for my work environment. Could you prepare and provide a small project sample?
Thanks for pointing me into the right direction.
🤦🤦🤦 Found the error.
I missed a closing brace at the end of the class.
I'm really sorry to have wasted your time with this.