Changing org.gradle.jvmargs Value - java

before a while, I was able to work on android studio project with the gradle property set to
org.gradle.jvmargs=-Xmx1536m.
suddenly now, for a reason I don't realize I Can't sync gradle files unless I set it to Xmx-1024m
so I cleaned all android files and uninstalled the jdk and android studio and gradle files then reinstalled all, the problem still exists.
what's the problem exactly? and what's happening when doing this change

Related

Why can I not resolve String and System symbols in java Android Studio

So I recently deleted the -studio64.exe.vmoptions file and the next time I launched it, it's unable to detect common libraries like 'String' and 'System'. I tried to download Jetbrains IDE also, and it throws the same error-
https://i.stack.imgur.com/EV3EV.png
What I have tried so far:
Change gradle build version
Reinstall Android studio
Uninstall Android studio completely- including jdk and sdk dependencies. Upon reinstallation (technically from scratch), the issue still persisted.
Any help will be appreciated. Thanks!

android studio can't find java sdk after invalidate caches... even after reinstall

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

Imported Module OpenCV's imports are no longer available causing every keyword used to become an error in Android Studio

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

Android Studio setup JDK error

In Android Studio I am facing bellow error
This popup shows when I press Alt+Enter for missing classes(symbols). When I click on setup SDK it shows two options
1.8(Java version "1.8.0_60")
Android API 23 Platform (Java version "1.8.0_60")
Nothing happens on selecting any of above options.
NOTE: My Java_Home path is correct and in android studio I have checked JDK path it's correct.
I am using Android Studio 1.5.0, Java 1.8 and windows 10
Simple Invalidate Cache and Restart doesn't work for me. So I have done following steps:
Check and verify Java path in Java_home variable
Start Android Studio and invalidate cache File--> Invalidate Cache and Restart
Start Android Studio and click File -> Invalidate Cache and Restart.
This has worked for me. Thanks
Well... In my case, setting up JDK in Project Structure didn't work. Invalidating and restart didn't work either. On further debugging, it led me to this:
Can-t-start-Intellij-after-update
Background of this problem:
I had installed Android Studio 3.6 and upgraded to Android Studio 4. Plugins like Mateial theme, Flutter, CSV viewer, JSON viewer etc weren't compatible with Android Studio 4. So I had disregarded those plugins after I upgraded to AS 4.
After some days, I got a notification that plugins which I had disregarded earlier were compatible with AS 4. So I installed those and restarted AS 4 and applied Material theme. I started to face problems like Set up JDK even though the path to JDK was proper.
So I closed AS 4, deleted caches from .gradle, .android, .AndroidStudio4.0\system\caches. Then I opened AS 4 and set up JDK error was gone.
Hope it helps...
P.S: If same problem persists, then I'm afraid that you've to unistall AS and download AS 4 directly and install it. I still can't figure out why it happened to me...
Close Android studio then again open it .
Go to File--> Invalidate Cache and Restart .
You are done.

Android Studio org.slf4j.spi.LocationAwareLogger.log

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.

Categories

Resources