I have a problem with Android Studio. It does not show any error(If has) on some classes or show error even if there is not an error but application compiles succesfuly. Also refactoring not working sometimes.
Things I tried:
Removed Android Studio cache.
Invalidate caches and restart.
Installing JDK, Android Studio, SDK again.
Installing operating system again.
None of them solved my problem. Weird thing is code inspection works on some classes but not working on some classes. I have to write without auto import etc. It works like a simple notepad. On the other hand, sometimes I can not copy or remove any text on the program. Are the any solution for this problem?
You won't believe me It happened to me while even using it with MAC and different project.
Android Studio not showing any error.
Refactoring not working
Android Studio logs
Full Log Here:
Full Log
The piece that interests me:
Part of log
Added kotlin support for Android studio, problem solved.
Related
I recently updated android studio and it's plugins, and all was working properly. But suddenly this happened and i can see how to solve. The app runs, but there are some unexpected behaviours. Tried to sync gradle, uninstall and reinstall the updates and nothing seems to work.
Activity.java for example
just remove your imports and make sure that they are importing from androidX
or enable auto-import from android studio setting and let it import it for you.
I had minor problems in a project I was working on and use invalidate caches and clean to see if that would help. However that did something not just to that one project but to android studio in general. it does not recognize java, the appearance of even the home screen has changed. I can't start any new projects in java and none of the old work. Strangely, even after I uninstalled both studio and java and then reinstalled the same problem persists.
incompatibility between the Android Studio cache and your current project layout. If you suspect this is the problem, then select File> Cache / Restart> Validate and Restart from the Android Studio toolbar.
To set JDK location: you can see this video: https://www.youtube.com/watch?v=jA97GYqRODE
Try to clear Android Studio cache, assuming you're using v3.3, delete the cache folder located at:
C:\Users\your_username\.AndroidStudio3.3\system\caches
VSCode as of version 1.30.1 with Flutter extension v2.22.1 doesn't set up the Java classpaths for the android folder so working with MainActivity is a pain, and I'm kind of afraid to touch things because as soon as I start I break Flutter's build systems and then things break there. Does anyone know how to set up VSCode to work as expected with both Flutter & Android code?
The Flutter extension for VS Code only supports editing Dart code for Flutter, it does not add any support for Java.
There's some discussion about this here:
https://github.com/flutter/flutter/issues/25369
It may be possible to get working, but since it's not an official supported setup I'm unsure how easy or how well it'd work.
FWIW, if you right-click on the android folder in VS Code, there should be an option to Open in Android Studio which might at least make it quicker to jump into modifying there :-)
I installed Android Studio the other day to develop an app and even though it's not the first time I've used it, it's the first time I've installed it on this PC and I'm fairly new to all of it.
Problem: After installing Android Studio, I can't even make a "Hello_World" app, even the templates AS offers have a compiling error:
Where it doesn't recognize symbols like "Override". The Alt+Enter solution that offers is to Setup JDK which does nothing for all options or create annotation 'Override' which doesn't really seem like a good option.
These are both build.gradle files:
Things I've tried to fix it:
Reinstall Android Studio Multiple Times
Download JDK manually and change references.
Check Enviromental Values on system (Add JAVA_HOME and heck Path to be correct). Pretty sure both java and JDK work since in cmd I can run java and javac.
Obviously Build->Clean and File->Invalidate Cache + Restart
android.enableAapt2=false on gradle.properties
Trying to delete all java from my PC and reinstall bare minimum THEN install everything separatedly.
Install all SDK plataforms until Android KitKat.
It's worth noticing that in the past I had a lot of problems getting java to run in only one place (mainly because I install software in an HDD and have OS on another SDD).
Also, while installing AS for the first time I got into a BSOD because of VT-x having shitty interaction with virtualization of anti-virus (that took me a while to figure out) so it stopped halfway. However I've reinstalled a bunch of times so I don't know how that could matter.
The problem is very similar to this one
I'm practically lost here. I've been trying to fix this for three days and I've looked into dozens of Stack-Overflow posts with similar problems, haven't found a solution.
Any idea will be appreciated.
Thanks.
I repeated your error:
I made it by deleting Android SDK(not java SDK) in Android Studio:
File-Settings-AndroidSDK
Try to pick at least one and install
It seems that your problem is related to Android SDK
Okay guys, I've finally figured it out, thanks to artmmslv.
Android Studio's installer detected automatically - two versions of Android SDK which were corrupted (probably caused by BSOD messing up the installation).
I had to make sure to delete everything. Java SDK, Android SDK. Java JRE. Every data from Appdata or documents from Android Studio. Once the computer is clean from any traces of already installed plugins, modules, and whatnot, it should be able to set up perfectly fine paths.
Also, make sure to set up manually and correctly the Environmental Values of java (path edit and JAVA_HOME).
Thanks for the help.
I got a solution that was a problem for me.
(in Build.Gradle file) - It's the
Compile SDK version 32
//which was not the latest one,
I changed it from older (31) in old projects to (32)
And clicked: sync now,
it worked!!
Hope it helps:) Happy coding
I'm trying to build a Flutter app that also runs custom Java code, so that I can execute code in the background, set alarms etc. As such, I'd like to access Firebase from Java.
I've created a new Flutter project in Android Studio and added Firebase as documented here (manually).
It compiles and runs fine on the device, but it seems that the dependency .jars from Gradle are not picked up in Android Studio, and as a result my Java source files show a lot of errors - source being "cannot resolve symbol 'google'" in the import statements.
Is there anything special that I need to do in order to have Android Studio pick up external Java dependencies from Gradle in Flutter application projects? I'm running Android Studio 3.0 Beta 7.
I have the same issue and would love to find the solution. I tried directly downloading the .aar file and using this guide but it did not work either.
https://github.com/yushulx/flutter-android-aar
Edit: I found an open issue on the topic which can be found here. Clearly you have found it, but in case anyone else is looking for more information about this.
Edit 2: Here is a workaround.