Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android Studio keeps importing import sun.jvm.hotspot.utilities.IntArray

Every time I copy a piece of code in Java and paste it in my android studio, and it converts this code to Kotlin code, it keeps automatically importing this:

import sun.jvm.hotspot.utilities.IntArray

And every time android studio makes this import, it gives an error Unresolved reference: sun.

Does anyone know how to fix this?...it is very annoying.

like image 739
codeKiller Avatar asked Nov 25 '19 09:11

codeKiller


1 Answers

The only way I found, and it works so far, is disabling automatic import for specifically sun.* and com.sun.* packages. Just disabling sun.jvm.hotspot.utilities.IntArray caused Android Studio to select some other sun/com.sun packages to imports. Still not sure why, but here is where you can find the setting:

enter image description here

like image 120
Michiel Dral Avatar answered Oct 16 '22 23:10

Michiel Dral