I implements a project in Intellij Idea with kotlin . this is working without Error . this is my Intellij project photo without Error
but when i implement this project in Android Studio , i got Error because the studio can not find this method in BigInteger class
longValueExact()
Android Studio project photo :
I have one JDK in my computer (v 1.8) . but in Itellij project this method worked and in android studio not worked.
i opened java.math.BigInteger class in android studio and saw longValueExact() method :
open class AuthKey(val key: ByteArray) {
constructor(key: ByteBuffer) : this(key.array())
init {
if (key.size != 256)
throw RuntimeException("AuthKey must be 256 Bytes found ${key.size} bytes")
}
// see https://core.telegram.org/mtproto/description#key-identifier
// SHA1 generates 20 bytes long hash, authKeyId is the lower 8 bytes
val keyId = CryptoUtils.substring(CryptoUtils.SHA1(key), 12, 8)
fun getKeyIdAsLong() = BigInteger(keyId).longValueExact()
}
class TempAuthKey(key: ByteArray, val expiresAt: Int) : AuthKey(key)
it mean we have this class in java 1.8 and we added this in android studio . and android studio loading this class with all methods in external library . but we cant use these methods in project classes!
any one can help me ?