I have tried all the solutions given on stackoverflow.com but the problem remains as it was.
I have tried the following:
created JAVA_HOME and JAVA_PATH and linked it to the correct directory.
uninstalling and reinstalling JDK and Android Studio several times.
deleted studio64.exe.vmoptions file from the bin directory of the Android Studio folder
tried other versions of JDK also
The most strange thing is that Android Studio used to run properly earlier, this problem came up recently and I am unable to carry forward my projects.
I would be thankful if anyone from this community gives me the apt and step by step method to solve this problem.
EDIT
Related
I'm not exactly sure what caused this or when it occurred but all of imports in MainActivtiy.java were being used successfully without any errors. The app compiled and has been working great. I went back and added some images in my #drawable folder and them added them in my .xml file. Some time after that, every OpenCV class and keyword imported is now an error with "Cannot Resolve Symbol [symbol]." I have tried every suggestion I found with no luck. My app still works, but I can not edit or anything OpenCV keywords.
I was using Android 3.2.0 with OpenCV 3.20, I updated Android Studio to 3.2.1.
Things I have tried, all with no success:
*Everything from this question including
-Delete .idea folder and .iml folder and re-imported project
-Invalidate cache/restart
-Set source and target compatibility to 1.8 for the app and opencv module
-Clean/Rebuild
*Everything from this question that was not repeated
*Update Android Studio
*Remove and re-install opencv
*Close and re-open Android Studio
*Restart computer
What is strange is that everything was fine and then this suddenly happened without much warning. Also, when I click on the OpenCV resources and click on the .java files, they all say "File was loaded in the wrong encoding: UTF-8" and I can't see anything. I followed the steps here when loading OpenCV and whenever I have looked up declarations or anything else in these java files there was no issue. How can I resolve this?
I tried a few more things including:
-Making a new project and coping the code from the old one over, same issues
-Re-installing Android Studio and importing old project, same result.
The only thing that solved my problem was uninstalling Android Studio, then re-installing it and making a new project. I copied the code over and imported the OpenCV module and all the errors went away. I went from version 3.2.0 to 3.2.1 as well
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
Recently I upgraded my Android Studio to 3.1 and also my gradle to 4.4.
Since then android studio doesn't let me open anything. (Any project , any file location, etc). I am able to create a new project but if try opening an existing one it just freezes. And then I have to kill it through Task Manager.
I am also able to open the settings page through welcome wizard. There also I tried to change the gradle version manually, again while browsing to the location it just gets hanged. Same way as above
I tried upgrading the Java version, installing/uninstalling android studio and everything else I can but its the same.
Any help or suggestions will be appreciated
I encountered similar issue. Please check the system Environment Variable, the JAVA_HOME path should be set correctly according to Java installed in your PC; something like this in my PC "C:\Program Files\Java\jdk1.8.0_172"
This resolved the issue for me.
Cheers!
Herbs
I am trying to get Android Studio installed on Cent OS 6.5. I have downloaded and unzipped the package to /usr/share/applications/Android-studio/.
I have installed jdk 8 in /usr/share/applications/ (as I understand you just unpack it there, no need to compile or execute anything...?)
I have appended /etc/profile with "JAVA_HOME=/usr/share/applications/jdk1.8.0_1118"
When I execute the studio.sh file the app begins to run (I see some Java messages in the shell) then I get the error:
"JDK Required: 'tools.jar' seems to be not in Studio classpath.
Please ensure JAVA_HOME points to JDK rather than JRE".
I think this means something is wrong with my JDK files but I don't know what. I have followed multiple tutorials online about how to fix this error including the guides on Android studio and Oracle's websites and as far as I can tell I've done everything correctly, but I am still getting this error. What am I missing?
Thank you for your help.
After looking through some answers to similar questions (that didn't receive any votes so I had overlooked them previously) I solved the issue. I had to copy the 'tools.jar' file from /usr/share/applications/jdk1.8.0_1118/lib to /usr/share/applications/android-studio/lib. That did it. It is up and running. Apparently this file is missing from the package downloaded from the android studio website. I hope they fix that soon and save future users hassle.
When I installed Android Studio on my mac (OSX Mavericks) and created a project, I got this error:
Failed to sync Gradle project 'project name'
unable to find method 'org.slf4j.spi.LocationAwareLogger.log(Lorg/slf4j/Marker;Ljava/lang/String;ILjava/lang/String;[Ljava/lang/Object;Ljava/lang/Throwable;)V'
When I first had this problem I had gradle-1.12 installed. I then installed gradle-2.1 and still the same problem. I then installed gradle 1.1 and still the same problem.
I've been trying to fix this problem for the past week to no avail.
Look in ~/Library/Java/Extensions. I had an alias in there for slf4j-api.jar, amongst other old things. Removed that (actually I deleted the whole ~/Library/Java directory :-) and it works fine now.