Android Studio Unresolved Reference: List, arrayListOf, setOf - android

Android Studio Arctic Fox | 2020.3.1 | Patch 2
Kotlin Plugin 1.5.31
Try to:
Sync Gradle
Invalidate cache and restart multiple times
Remove .idea and ./gradle folders
Re-install Android Studio
Re-import Project
No result. Anyway "Unresolved Reference: List, arrayListOf, setOf"
Does anyone know what can I do (reinstall os, buy new PC...or I don't know) to finally just start to work on project?

Your Intellij IDEA plugin and the Kotlin runtime/compiler that you use in the project need to match. For example if IDE plugin is Beta 1, but your Gradle/Maven project using M12, you'll have issues exactly as you described. So check that everything lines up.
If you still have issues, with some older plugins you need to clear the caches in Intellij IDEA (file menu, Clear Caches and Restart, select option to restart).

Related

Compilation time in Android Studio is more than one hour

Faced with such a problem that the application compiles for a very long time. I tried to clean the cache - with no result
Changed the settings in build.gradle - no result
Moreover, I have a similar project in terms of code volume and it compiles on the same configuration files for no more than a couple of minutes.
Android Studio Fox 2020.3.1 Patch 3 -
AGP 7.0.4 -
Gradle 7.0.2 -
Kotlin 1.6.21
Fixed by deleting kotlin-android-extensions and rewrite all code where was it by used
Try invalidate cache and restart. if it doesn't work delete .gradle folder under user folder. If it doesnt work too. You can try stable Android Studio version. Because you use canary version it may be real source of problem. You know it is very buggy usually.

Android databinding generated files disappears when coding

I am facing a strange problem when Fragment*Binding files are deleted while I am writing code (all references become unresolved, generated files absent in files system) that can be fixed by clean project-> make the project but it is time-consuming.
Such behavior occurs 3-4 times per hour.
Originally I thought I might be deleted by antivirus software, but I checked that all paths related to development are in Av exceptions.
Android studio bumblebee latest updates (happened few updates before too)
I had the same problem and it was because of gradle, for a while i changed the gradle version (lower or higher should be tested) (requires invalidate cache and restart), then worked with that gradle for a while then changed it back and it was fixes
First make sure that the dependencies you are using are updated to their latest version also your Gradle and Gradle Plugin are latest and compatible with each other.
Also check if you are using the latest Android Studio Bumblebee version which is
2021.1.1 Patch 2 Built on 17 Feb
Shortcut for clean or rebuild project :
Press Shift Key twice and then search 'clean' or 'rebuild' and press Enter

Go To Declaration and Usage feature not working in Android Studio

I'm using Android Studio 2020.3.1 ( Patch 3 ) on Windows 10.
I have tried the following steps to solve this issue:
Clean Project and Rebuild Project
Invalidate caches and Restart
IDE Settings -> Reset to defaults
Sync project with Gradle files.
Any kind of help is appreciated.

Android studio IDE shows unresolved references / ignores imports, while builds are fine

Since couple of days I have problems with my android studio IDE, quite desperate at the moment. Various library imports are not recognized any more (some are, some not, junit e.g. isn´t), showing me unresolved reference error and autocompletion isn´t working as a consequence. But it´s only the IDE, gradle builds are fine.
Gradle files should be fine, the pic is from a new project where everything is set up properly. Same problem with old and new projects. I tried like everything already:
Deleting .idea folder + .iml files and reimporting the project
Invalidate Caches / Restart...
Deleting .android/cache
Deleting HOME/.gradle/caches
Downloaded and installed new Android Studio (v3.2.1), opened old, started new projects
Switched kotlin plugin versions, compilesdk versions, android gradle plugin versions, kotlin versions, gradle versions
I did couple of updates at the same time, Android Studio to 3.2.1, Kotlin plugin to 1.3.0, android gradle plugin to 3.2.1, installed newest sdk 28, switched from gradle 4.6 to 4.10.2. Shortly before, I had another weird behavior, where opened files didn´t show the real content but instead cryptic, binary symbols for nearly all the gradle or source files. Only deleting whole project folder and recloning it from git solved that one. I blame a hard reset while studio was running for that. As if anything android studio related on my machine is messed up. But even new installation of studio does not help
Ok, finally solved the problem by completely removing all android studio installations (using the included uninstall.exe), deleting HOME/.android and all HOME/.AndroidStudiox.x folders, then reinstalling android studio (not finding anything from previous installations anymore). Could then even reimport my settings, exported previously

Android Studio Stuck at opening Project?

I recently updated from Android Studio 2.0 to 2.1.2 and now I have a project which doesn't open. Android Studio is stuck at the following screen for more than 10-15min.
I tried solutions from these answers.[ans1] [ans2]
but none of them work.
I can create new projects and also import projects built on eclipse. But cannot open my own project.
Please help.
Delete the gradle folder in the project folder. It will work.
For many problems such as stuck with opening or downloading something while starting
I use this sequence as an ultimate guide and on one of the steps always works out.
Recently I used it after updating to 3.2
Try File -> Invalidate caches / Restart
Shutdown Android Studio
Remove .gradle folder in the user home directory
Start Android Studio (Studio will download gradle data)
After Gradle build is done, rebuild project
According to Android Studio's Known Issues https://developer.android.com/studio/known-issues under "Configuration on demand with Gradle 4.6 and above:", if you are using Android Gradle Plugin 3.0.x or 3.1.x with Gradle 4.6 and above you should add the following line to gradle.properties:
org.gradle.configureondemand = false
This seemed to solve my issue with Android Studio getting stuck at "Project setup: reading from cache".

Categories

Resources