Plugin error: kotlin-idea.jar contains invalid plugin descriptor - android

One day I oppened android studio and this poped out as "plugin error":
Plugin error: File '~\AppData\Roaming\Google\AndroidStudio2021.2\plugins\Kotlin\lib\kotlin-idea.jar' contains invalid plugin descriptor
How to fix this?

I went to Menu Tools > Kotlin > Configure Kotlin Plugin Updates in Android Studio. The dialog shows message A new Version 212-1.7.10-release-333-AS5457.46 is availible and an Update Button below the message. After Update and Restart the error was gone.

Download the newest version of Kotlin from here
then replace the Kotlin file in this directory with the one you downloaded "C:\Users\YOURUSERNAME\AppData\Roaming\Google\AndroidStudio2021.2\plugins"

I downloaded the newest plugin "Kotlin" from jetbrains site and error disappeared
https://plugins.jetbrains.com/plugin/6954-kotlin/versions/stable

I just deleted the file in that path. It seems everything worked normally afterward. (You may need to tick the "show hidden files, folder, or drives" from File Explorer Options if you can't find it directly)

Related

.kt files not recognized in Android Studio

I opened my Studio today and Android Studio didn't recognize Kotlin files. .kt files started showing up as just an ordinary file. I checked my Plugins and I still have the Kotlin plugin. I tried uninstalling and installing it again. But no use.
I tried building my building my project from Terminal and it works fine. But Android studio doesn't understand Kotlin files.
Configuration:
Android Studio 3.1
Kotlin 1.2.41
OS: MacOS Sierra
Go to Library/Preferences and delete the AndroidStudio3.1 folder. This is the config directory for my Android Studio.
Once deleted, I started Studio again, and the config was created fresh. Now everything worked perfectly.
Update Kotlin plugin:
Go to
menu
preferences
plugins
find Kotlin plugin
update
I got this problem too, after upgrading my Android Studio from 3.1.4 to 3.2.1
And I have followed #Evgenii Vorobei step, found no "Update" button available just install and uninstall.
So I go to the root project build.gradle file update the kotlin_version from 1.3.11 to 1.3.21, sync project then restart Android studio
This is work for me
Update:
You also can update the plugin with Tools > Kotlin > Configure kotlin plugin update
I already had kotlin configured and could see the files in the "Project" view but could not see them in the "Android" view. When in "Android" mode, if you can see the File->new->Kotlin File/Class in the File Menu, create a new Kotlin file. When I did this, the new file appeared in the menu along with the other file I had copied in place.
I also had the similar issue, but in my case it was due to misc.xml file.
Android studio had added below line in misc.xml file
<component name="ProjectPlainTextFileTypeManager">
<file url="paht_to_file_not_being_recognized" />
</component>
after removing this line, everything worked perfectly. If you refactor -> rename file but then also the issue persist, this can be a possible reason.
I got the same problem when accidentally .kt file type association was moved to Text file from Kotlin.
To fix this remove *.kt from Text and add under Kotlin (if not present)
More info on it from jetbrains issue tracker
Lets say, I'm creating new file named HomeFragment, and AndroidStudio didn't recognize it as kotlin file. Fix Steps:
AndroidStudio -> Preferences -> Editor -> File Types
Click on File type auto-detected by file content, make sure this sections doesn't have prefill File name patterns - HomeFragment, if it does, delete it.
Click on Kotlin, make sure it has "*.kt"
Click on Text, make sure it doesnt have "*.kt"
once done, click Apply and OK

Gradle connection timed out after update Android studio to 2.3

After I update android studio to 2.3, my old project is not opened in android studio shows me gradle error. And when I open a new project, that project is not build
After the new update of android studio (2.3) this is a common bug.But heres the best solution to this.Once you get a message as gradle sync failed,then its as because your gradle file got bug.
the solution is go to C:\Users\Admin.gradle\wrapper\dists\gradle-3.3-all\55gk2rcmfc6p2dg9u9ohc3hw9
here you can find a zip file : gradle-3.3-all.zip
delete all contents in that and download file from https://downloads.gradle.org/distributions/gradle-3.3-all.zip
paste this in 55gk2rcmfc6p2dg9u9ohc3hw9 folder. Then restart studio.It will be working perfectly.
If you have any other version of gradle you can find the corresponding file in https://services.gradle.org/distributions
I found it my self now, its very easy
Just need Edit "build.gradle.project" dependencies to 2.3.0 and edit file "gradle.wrapper.properties" , distributionUrl to "/gradle3.3-all.zip" and sync project

Android studio alway show "Gradle project sync in progress"

After update android studio Build number AI-141.1809159 version=1.2 in Canary update, i can't sync gradle project and always show "Gradle project sync in progress"
Following are the steps that I use (Kind a workaround),
Edit the root build.gradle file (adding a new line to file will also
do).
Save the file.
Restart the IDE (File->Invalid Cache/Restart->Just Restart).
Gradle Sync in progress notification should go away.
I found this was due to this plugin being used in AS:
'Android Studio Unit Test'
To disable this in AS 1.2 do the following:
File > Settings > Plugins > Android Studio Unit Test disable
Problem is solved, just update android sdk, it's work for me.
This happened to me twice and had to do with one of the gradle files having a date in the future (a glitch in Android Studio it seems). That is why just adding a space to the file and saving can fix the problem, as described above. Or go through your project with the operating system file explorer to find the file.
wait for some time, if you are using somebody else repo. It depends on the projects buildings. You might see new changes like file path, project-level dir appearing, etc.
Disable VPN if you have it active.

Unable to start Android Studio after installation

I am trying to start Android Studio for the first time but getting error mentioned below
Could someone please let me know how to solve this error?
You need to set your JAVA_HOME path, which will allow Android Studio to run. Have you done that?
Here is how to do that:
Right click your Computer icon, and click Properties
Windows 8 Users: Then click Advanced System settings to your left.
Now, go to the advanced tab, click Environment variables, under
system variables, click New, and add a JAVA_HOME variable, it should
look like this (relative to your jdk version, if its the latest
it should be identical).
If you already have that covered I found a solution here that can help you:
Go to your AndroidStudio directory where you installed your studio Like D:\User\AndroidStudio
In AndroidStudio go to \AndroidStudio\plugins\gradle\lib and copy gradle.jar
Paste this gradle.jar file to \AndroidStudio\lib directory.
Download gradle directly from Gradle
Copy the contents of gradle-1.7-bin.zip - After extracting zip file - (bin, media, init.d, lib folders) to \AndroidStudio\plugins\gradle
Restart AndroidStudio
http://developer.android.com/sdk/installing/studio.html#Troubleshooting
Scroll to the bottom.
Troubleshooting
Figure 1. Error dialog when opening an existing project.
Error: Gradle project refresh failed
Android Studio 0.2.0 has updated the Gradle plug-in to 0.5.0, which is not backwards compatible. When opening a project that uses an older version of the plug-in, Studio will display the error shown in figure 1 in the upper right corner of the IDE. To resolve the error, you must change the version of the Android Gradle plug-in to 0.5.0.
Click the link in the error dialog Search in build.gradle files. If the dialog is no longer visible, click Event Log in the bottom-right corner of the IDE, then click Search in build.gradle files.
Double-click the line under the build.gradle usage. For example: classpath 'com.android.tools.build:gradle:0.4. This opens the project build.gradle file.
Edit the classpath to change the gradle version to 0.5.+. For example:
dependencies {
classpath 'com.android.tools.build:gradle:0.5.+'
}
For me, I searched for task manager, opened it, went to more options, ended all background android studio tasks, and it worked.\
This happens because sometimes android studio does not fully close properly

Failed to create new project in android studio 0.2.3

After I updated form 0.2.2 to 0.2.3, I create new project failed.
Error message is below:
下午 08:51:58 Gradle 'NotifyViaGoogleMapsProject' project refresh failed:
The SDK directory 'C:\Program Files (x86)\Android\android-studio\bin\Program Files (x86)Androidandroid-studiosdk' does not exist.
Build file 'F:\AndroidStudioDevelop\NotifyViaGoogleMapsProject\NotifyViaGoogleMaps\build.gradle' line: 9
NotifyViaGoogleMapsProject is my project name,and my android studio is install in default path(C:\Program Files (x86)\Android\android-studio), there has no same error in 0.2.2.
I've figured out the problem.
Open 'local.properties' in your project using a text editor.
sdk.dir=..\\sdk
Save and Close
Now Import your project into Android Studio.
Make sure that the SDK folder you mention exists - I'm not sure if it is a typo or not but the path you specified is a bit weird - it should be
C:\Program Files (x86)\Android\android-studio\sdk
On the menu go to File -> Project Structure, then choose SDKs under Platform Settings. Check that the path for the Android Platform you use is correct, and if not, change it to the correct path. Also make sure that the Project is set to use the correct Android Platform.
I have the same problem.
http://i.stack.imgur.com/pPOOi.png
The SDK is correct in Platform Settings, I have no idea what's causing this problem.
http://puu.sh/3TAFi.png

Categories

Resources