seniorjoinu / reliable-udp

Multiplexed, coroutine-powered reliable UDP for Kotlin using fountain codes
MIT License
30 stars 0 forks source link

Problem with import sun.nio.ch.DirectBuffer #4

Open bigtang5 opened 2 years ago

bigtang5 commented 2 years ago

I make a new project in the newest Android Studio, copy the udp class and wirehair class into it, everything is OK except this line: import sun.nio.ch.DirectBuffer

problems show: Unresolved reference: sun Unresolved reference: DirectBuffer

here is my build gradle:

plugins { id 'com.android.application' id 'org.jetbrains.kotlin.android' }

android { compileSdk 32 packagingOptions { exclude 'META-INF/LICENSE' exclude 'META-INF/DEPENDENCIES' }

defaultConfig {
    applicationId "com.example.testftp1"
    minSdk 26
    targetSdk 32
    versionCode 1
    versionName "1.0"

    testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}

buildTypes {
    release {
        minifyEnabled false
        proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
    }
}
compileOptions {
    sourceCompatibility JavaVersion.VERSION_1_8
    targetCompatibility JavaVersion.VERSION_1_8
}
kotlinOptions {
    jvmTarget = '1.8'
}

}

dependencies {

implementation 'androidx.core:core-ktx:1.7.0'
implementation 'androidx.appcompat:appcompat:1.3.0'
implementation 'com.google.android.material:material:1.4.0'
implementation 'androidx.constraintlayout:constraintlayout:2.0.4'
implementation files('libs/ftplet-api-1.2.0.jar')
implementation files('libs/ftpserver-core-1.2.0.jar')
implementation files('libs/log4j-api-2.17.2.jar')
implementation files('libs/log4j-core-2.17.2.jar')
implementation files('libs/mina-core-2.1.6.jar')
implementation files('libs/slf4j-api-1.7.36.jar')
testImplementation 'junit:junit:4.13.2'
androidTestImplementation 'androidx.test.ext:junit:1.1.3'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'

implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-android:1.6.4'
implementation 'net.java.dev.jna:jna:5.2.0'
implementation 'net.java.dev.jna:jna-platform:5.2.0'
implementation 'io.github.microutils:kotlin-logging:1.6.24'

testImplementation "org.jetbrains.kotlin:kotlin-reflect:1.3.21"
testImplementation 'org.junit.jupiter:junit-jupiter-api:5.3.1'
testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.3.1'
testImplementation group: 'org.slf4j', name: 'slf4j-simple', version: '1.7.26'
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8"

}

how to fix it? thanks.