Compilation time in Android Studio is more than one hour - android

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.

Related

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

Android Studio Unresolved Reference: List, arrayListOf, setOf

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).

Android Studio is not able to process res files after update

I have an issue with android studio not being able to process the .xml files properly. I have restarted, cleared cache, created new project but still no answers. Here are some images to show case
com.android.tools.build:gradle:3.6.0-alpha05
org.jetbrains.kotlin:kotlin-gradle-plugin:1.3.41
Help where you can guys, thanks.
This is a known issue. Downgrade to AS 3.6 canary 3 if you are using canary 5 and the downgrade the gradle plugin to "classpath 'com.android.tools.build:gradle:3.6.0-alpha03"
Check the issue : https://issuetracker.google.com/issues/136103084
If that did not work you can add this res manually and clean and rebuild.
please try file —> invalidate caches and restart
maybe it works, if not ,you can try to clean -> sync project
This is an ongoing issue. For a quick resume of your works you have to add the resources to the attrs resources manually or downgrade the AS 3.6 Canary 3 to start off. For your reference, I am adding issue link.
Google issue tracker.
File - Invalidate Caches and Restart then sync gradle and build project. And Use Stable Android Studio Version if you use Canary or any unstable version.

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

9 patch drawable appears bad after cleaning and rebuilding project in a new android studio

I have a 9 patch image file which am using in my android project. am using android studio 2.2 preview 3(the latest as per this question).
in layout design view, everything is ok. and when i installed on my device for first time, everything was ok. But i later on clean and rebuilt my project and the 9 patch appeared very very bad on my device while it appears well in layout design.
In device(after clean and rebuilding my project)
How it appears in my layout design
Note: it used to appear good like the second image in my device before clean and rebuilding.
I have even tried to invalidate and restart android studio but with no success. what could be the cause and how can i solve this problem?
EDIT
my file is in drawable folder and it's name is left_2.9.png
Make sure that your file is saved as <filename>.9.png and not <filename>.png.
If you find this is an issue try building from the command line:
./gradlew clean installDebug
The issue was caused by the unstable gradle version 2.2.0-alpha3 which is found in android studio 2.2 preview 3. i changed my version to the stable version which is 2.1.0 and everything was ok.
to do this, i went to my project's build.gradle (not module's build.gradle) and changed
classpath com.android.tools.build:gradle:2.2.0-alpha3
to
classpath com.android.tools.build:gradle:2.1.0

Categories

Resources