First of all I've been using Android studio for quite years but this has never happened before.
It seems like android studio's inner ArrayList class has vanished out of a sudden. I can't use ArrayList. It always says Can't find symbol ArrayList
I've cleaned rebuild and even invalidated caches and restarted several times but all in vain.
package dev.moutamid.testapp;
import java.util.ArrayList; //<--- this gives error
public class FragmentDashboard extends Fragment {
private ArrayList<refUser> refUsersList = new ArrayList<>(); //<--- and this line
}
My android studio is up to date. I then opened a new project and tried to use ArrayList but it was still not showing. Feels like there's nothing related to ArrayList in studio.
Yesterday I got BSOD (Blue screen of death of Windows) and today it's happening. I'm using git repository to backup my project.
What could be the solution? I think Git has deleted ArrayList class because it already had corrupted several files before. I got luck due to the backups.
Well this is really weird. Would suggest you to try the following:
I am guessing whether this is possible:
On macOS, enter java -version in the console to check the currently installed Java version. For example, I output the following:
➜ ~ java -version java version "1.8.0_212" Java(TM) SE Runtime Environment (build 1.8.0_212-b10) Java HotSpot(TM) 64-Bit Server VM (build 25.212-b10, mixed mode)
Check whether the JDK location in the SDK Location in Project Struture in Android Studio is correct. For example, my address is as follows:
/Applications/Android Studio.app/Contents/jre/jdk/Contents/Home
Or select app in Modules and set the Source/Target Compatibility of Properties to try?
I hope it helps you~
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.