Create an account

Very important

  • To access the important data of the forums, you must be active in each forum and especially in the leaks and database leaks section, send data and after sending the data and activity, data and important content will be opened and visible for you.
  • You will only see chat messages from people who are at or below your level.
  • More than 500,000 database leaks and millions of account leaks are waiting for you, so access and view with more activity.
  • Many important data are inactive and inaccessible for you, so open them with activity. (This will be done automatically)


Thread Rating:
  • 501 Vote(s) - 3.53 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Android Studio keeps importing import sun.jvm.hotspot.utilities.IntArray

#1
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.

Reply

#2
Try adding tools.jar from the jdk to your dependencies.

compile files("${System.properties['java.home']}/../lib/tools.jar")
Reply

#3
To Disable Auto Imports:

> File --> Settings ---> Editor --> General --> Auto Import --> Optimize imports on
> the fly.

If **Optimize imports on the fly** is checked then uncheck it.
Reply

#4
Check your prefrences to copy past smart key.


Preferences -> Editor -> General -> Smart Keys -> Scroll to the end -> Convert posted Java code to Kotlin

turn that off.
Reply

#5
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][1]][1]


[1]:
Reply



Forum Jump:


Users browsing this thread:
1 Guest(s)

©0Day  2016 - 2023 | All Rights Reserved.  Made with    for the community. Connected through