Weird behavior of Android Studio - android

I upgraded the studio to 3.1.2 version lately. After that facing few issues, one of which is this :
Even though all imports are written correctly, the files are said not to be found and I get the class names in red saying "Cannot resolve symbol".
But when I try to run the project it runs perfectly. I tried to invalidate cache and restart, clean project, rebuild project, also tried restarting the PC but no solution.

You have to update your Kotlin library version and check some other version of library it might be not compatible with new android studio version and also check gradle version.

Related

Data binding with errror dataBindingArtifactOutputDir

I have a weird problem when building my app.
Cannot write to file
'myapp/app/build/intermediates/data-binding/dev/debug/bundle-bin'
specified for property 'dataBindingArtifactOutputDir' as it is a
directory.
It 's weird because when I clean project, I can build app. But when building app the second time, the above error happens. If I want to build app, must clean app.
I also set
dataBinding {
enabled true
}
Thanks for any support!
I really found the problems. I took me 1 day. I updated the gradle plugin and Android Studio to the newest version. And this is the reason why.
The newest gradle build tool is 3.4.1, it use the gradle version 5.1.1. When I downgrade the gradle build tool to 3.1.4 as my old project, and clean build app again error still happens. I think this way did not work but this is problem of Android Studio, it did not change the gradle version in gradle/wrapper/gradle-wrapper.properties. I manually update to old gradle version
distributionUrl=https://services.gradle.org/distributions/gradle-4.4-all.zip
It works now luckily. Everytime Android Studio updates, the weird problems happens again. Expect everything will work well in the future. :|

Cannot resolve R in Android Studio, but app compiles just fine

I am using Android Studio 3.2.1. This error, where the R class is highlighted in red, says Cannot Resolve R, but the app builds and runs just fine, there are no errors in compilation, it just shows R as unresolved reference in the IDE.
This problem only happens in one project that uses Kotlin, and all the other projects open and work without any problems.
I went through most solutions in stackoverflow and that didn't solve the problem.
I'm using ubuntu and it works on other windows pc. Could there be a problem in ubuntu.
These are the solutions that I have tried
clean project
rebuild project
make project
invalidate cache and restart
sync project with gradle files
updating sdk files
updating dependency
recloning the project
checked all my xml files
Kotlin plugin was updated
snapshot
xml snapshot
The issue still persists. Please let me know if any other details are required.
Thanks.
Just try reinstalling it
Hope it works :)
this problem with the android studio itself try to clear cache and restart from file --> invalidate the cache and restart if still not working reinstall the android studio and open the project from the beginning

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: nothing working getting different different errors

I'm trying to learn AS, but after struggling for 3 days no progress.
Using https://www.udacity.com for learning.
Trying the hello world app from there, got this error Gradle DSL method not found: 'android()'.
I've worked in eclipse, but migrating from eclipse to AS looks very tough decision for me. I'm using cordova cli so far, now thinking to use AS.
While runing the app am not able to open RUN TOOL it show but is grey color(which is not clickable).
Downloaded new Gradle version (2.10), and set the path to that directory.But still showing Gradle version 2.2.1 in Project Structure.
Checked in stackoverflow as well, but nothing worked. Worst experieence.
Any body have idea what is going on, would be helpfull.
Android Studio 1.2.2
Make sure you have the latest Gradle and Android Studio:
https://www.gradle.org/
http://tools.android.com/tech-docs/new-build-system/version-compatibility
Go for more
Android Studio Gradle DSL method not found: 'android()' -- Error(17,0)
Udacity's Android courses are using the newest dependencies and AS version.
Please remove existing 1.2 version and upgrade it to 1.5.1 to get the fresh experience and less building problems
Be sure that you're using Oracle JDK7 not Java 8 SDK. It may cause some problems with Gradle
I recommend you also try to follow the steps in this post: I just installed Android Studio and created a new project, it always came up with Error with gradle
Have a question? Please free to ask

Android Studio error: This folder does not belong to a gradle project (Jsoup.jar)

Since last android studio (1.1.0) update I have one issue with Jsoup(1.8.1) Gradle and it compilation.
When I import jsoup.jar in the projects I receive a message that said
To fix this problem. I have tried:
-I try click on "Add now..." but dont fix the issue.
-Clean project.
-Rebuild project.
-Close and open Android Studio.
Nothing have worked.
Any ideas?
Thanks.
Update 1: I have updated to android-studio Beta(1.2) and now works fine. But i want use android-studio Stable version.
I had the exact same problem. On Mac OS X 10.10.3, upgading to version 1.2.2 of Android Studio solved this problem for me. I used option-return key press while hovering over the class name I wanted to reference and that caused Android Studio to add the appropriate import. Auto-completion seems to work as well in the IDE.

Categories

Resources