Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Android上运行崩溃 #154

Closed
Freedom0925 opened this issue Mar 22, 2020 · 3 comments
Closed

Android上运行崩溃 #154

Freedom0925 opened this issue Mar 22, 2020 · 3 comments
Labels
t:bug 类型: bug

Comments

@Freedom0925
Copy link
Contributor

E/AndroidRuntime: FATAL EXCEPTION: DefaultDispatcher-worker-8
Process: com.yiyun6.bot, PID: 29947
java.lang.ExceptionInInitializerError
at net.mamoe.mirai.utils.cryptor.ECDHAndroidKt.ECDH(ECDHAndroid.kt:34)
at net.mamoe.mirai.qqandroid.network.QQAndroidClient.(QQAndroidClient.kt:51)
at net.mamoe.mirai.qqandroid.QQAndroidBotBase.(QQAndroidBot.kt:58)
at net.mamoe.mirai.qqandroid.QQAndroidBot.(QQAndroidBot.kt:33)
at net.mamoe.mirai.qqandroid.QQAndroid.newBot(QQAndroid.kt:27)

    at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
    at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:56)
    at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:571)
    at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:738)
    at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:678)
    at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:665)
 Caused by: java.lang.IllegalStateException: cannot init BouncyCastle
    at net.mamoe.mirai.utils.cryptor.ECDH.<clinit>(ECDHAndroid.kt:60)
    at net.mamoe.mirai.utils.cryptor.ECDHAndroidKt.ECDH(ECDHAndroid.kt:34) 
    at net.mamoe.mirai.qqandroid.network.QQAndroidClient.<init>(QQAndroidClient.kt:51) 
    at net.mamoe.mirai.qqandroid.QQAndroidBotBase.<init>(QQAndroidBot.kt:58) 
    at net.mamoe.mirai.qqandroid.QQAndroidBot.<init>(QQAndroidBot.kt:33) 
    at net.mamoe.mirai.qqandroid.QQAndroid.newBot(QQAndroid.kt:27) 

 
at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33) 
at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:56) 
at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:571) 
at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:738) 
at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:678) 
at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:665) 
Caused by: java.lang.NoSuchFieldException: No field PROVIDER_NAME in class Lcom/android/org/bouncycastle/jce/provider/BouncyCastleProvider; (declaration of 'com.android.org.bouncycastle.jce.provider.BouncyCastleProvider' appears in /apex/com.android.runtime/javalib/bouncycastle.jar)
at java.lang.Class.getDeclaredField(Native Method)
at net.mamoe.mirai.utils.cryptor.ECDH.(ECDHAndroid.kt:51)
at net.mamoe.mirai.utils.cryptor.ECDHAndroidKt.ECDH(ECDHAndroid.kt:34) 
at net.mamoe.mirai.qqandroid.network.QQAndroidClient.(QQAndroidClient.kt:51) 
at net.mamoe.mirai.qqandroid.QQAndroidBotBase.(QQAndroidBot.kt:58) 
at net.mamoe.mirai.qqandroid.QQAndroidBot.(QQAndroidBot.kt:33) 
at net.mamoe.mirai.qqandroid.QQAndroid.newBot(QQAndroid.kt:27) 

@Freedom0925 Freedom0925 added the t:bug 类型: bug label Mar 22, 2020
@Him188
Copy link
Member

Him188 commented Mar 22, 2020

Android版本是多少?尝试换更新的版本试试?

@Freedom0925
Copy link
Contributor Author

compileSdkVersion 29,targetSdkVersion 29.
从日志上看和Android版本没啥关系

@Freedom0925
Copy link
Contributor Author

image
反射调用时抛出异常

@Him188 Him188 closed this as completed in 1f60474 Mar 22, 2020
Him188 added a commit that referenced this issue Mar 27, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
t:bug 类型: bug
Projects
None yet
Development

No branches or pull requests

2 participants