我试图在Android智能手表上运行DJI的importSDKDemo sample code,并且当DJISDKManager实例尝试注册应用程序时,在startSDKRegistration()中出现KeyStore异常。
DJI SDK:v4.9
Android SDK(compileSDKversion):28
Android设备:具有Wear OS v2.6的Mobvoi TicWatch Pro 0584
Mobvoi TicWatch已连接到我工作场所中的特定WiFi网络,并且调制解调器就在附近,以确保它与我以前使用的公共WiFi网络无关。
除了此问题报告,我找不到与该特定问题有关的任何信息,我尝试应用那里提出的解决方案,但仍然得到KeyStore exceptions
我不确定本文中要包含的代码,但是在DJISDKManager.getInstance.registerApp(...)之后,这是程序停止的部分,通常与importSDKDemo中的版本完全相同。
private void startSDKRegistration() {
if (isRegistrationInProgress.compareAndSet(false, true)) {
AsyncTask.execute(new Runnable() {
@Override
public void run() {
showToast("registering, pls wait...");
DJISDKManager.getInstance().registerApp(MainActivity.this.getApplicationContext(), new DJISDKManager.SDKManagerCallback() {
@Override
public void onRegister(DJIError djiError) {
if (djiError == DJISDKError.REGISTRATION_SUCCESS) {
showToast("Register Success");
DJISDKManager.getInstance().startConnectionToProduct();
} else {
showToast("Register sdk fails, please check the bundle id and network connection!");
}
Log.v(TAG, djiError.getDescription());
}
这是我多次获得的KeyStore异常的完整堆栈:
W/KeyStore: KeyStore exception
android.os.ServiceSpecificException: (code 7)
at android.os.Parcel.createException(Parcel.java:1964)
at android.os.Parcel.readException(Parcel.java:1918)
at android.os.Parcel.readException(Parcel.java:1868)
at android.security.IKeystoreService$Stub$Proxy.get(IKeystoreService.java:786)
at android.security.KeyStore.get(KeyStore.java:195)
at android.security.keystore.AndroidKeyStoreSpi.engineGetCertificate(AndroidKeyStoreSpi.java:144)
at java.security.KeyStore.getCertificate(KeyStore.java:1120)
at android.security.net.config.KeyStoreCertificateSource.ensureInitialized(KeyStoreCertificateSource.java:61)
at android.security.net.config.KeyStoreCertificateSource.findBySubjectAndPublicKey(KeyStoreCertificateSource.java:77)
at android.security.net.config.CertificatesEntryRef.findBySubjectAndPublicKey(CertificatesEntryRef.java:47)
at android.security.net.config.NetworkSecurityConfig.findTrustAnchorBySubjectAndPublicKey(NetworkSecurityConfig.java:123)
at android.security.net.config.TrustedCertificateStoreAdapter.getTrustAnchor(TrustedCertificateStoreAdapter.java:51)
at com.android.org.conscrypt.TrustManagerImpl.findTrustAnchorBySubjectAndPublicKey(TrustManagerImpl.java:945)
at com.android.org.conscrypt.TrustManagerImpl.checkTrusted(TrustManagerImpl.java:487)
at com.android.org.conscrypt.TrustManagerImpl.checkTrusted(TrustManagerImpl.java:418)
at com.android.org.conscrypt.TrustManagerImpl.getTrustedChainForServer(TrustManagerImpl.java:339)
at android.security.net.config.NetworkSecurityTrustManager.checkServerTrusted(NetworkSecurityTrustManager.java:94)
at android.security.net.config.RootTrustManager.checkServerTrusted(RootTrustManager.java:88)
at com.android.org.conscrypt.Platform.checkServerTrusted(Platform.java:208)
at com.android.org.conscrypt.ConscryptFileDescriptorSocket.verifyCertificateChain(ConscryptFileDescriptorSocket.java:404)
at com.android.org.conscrypt.NativeCrypto.SSL_do_handshake(Native Method)
at com.android.org.conscrypt.NativeSsl.doHandshake(NativeSsl.java:375)
at com.android.org.conscrypt.ConscryptFileDescriptorSocket.startHandshake(ConscryptFileDescriptorSocket.java:224)
at dji.thirdparty.okhttp3.internal.connection.RealConnection.connectTls(Unknown Source:65)
at dji.thirdparty.okhttp3.internal.connection.RealConnection.establishProtocol(Unknown Source:54)
at dji.thirdparty.okhttp3.internal.connection.RealConnection.connect(Unknown Source:202)
at dji.thirdparty.okhttp3.internal.connection.StreamAllocation.findConnection(Unknown Source:247)
at dji.thirdparty.okhttp3.internal.connection.StreamAllocation.findHealthyConnection(Unknown Source:0)
at dji.thirdparty.okhttp3.internal.connection.StreamAllocation.newStream(Unknown Source:22)
at dji.thirdparty.okhttp3.internal.connection.ConnectInterceptor.intercept(Unknown Source:26)
at dji.thirdparty.okhttp3.internal.http.RealInterceptorChain.proceed(Unknown Source:165)
at dji.thirdparty.okhttp3.internal.http.RealInterceptorChain.proceed(Unknown Source:6)
at dji.thirdparty.okhttp3.internal.cache.CacheInterceptor.intercept(Unknown Source:137)
at dji.thirdparty.okhttp3.internal.http.RealInterceptorChain.proceed(Unknown Source:165)
at dji.thirdparty.okhttp3.internal.http.RealInterceptorChain.proceed(Unknown Source:6)
at dji.thirdparty.okhttp3.internal.http.BridgeInterceptor.intercept(Unknown Source:160)
at dji.thirdparty.okhttp3.internal.http.RealInterceptorChain.proceed(Unknown Source:165)
at dji.thirdparty.okhttp3.internal.http.RetryAndFollowUpInterceptor.intercept(Unknown Source:60)
at dji.thirdparty.okhttp3.internal.http.RealInterceptorChain.proceed(Unknown Source:165)
at dji.thirdparty.okhttp3.internal.http.RealInterceptorChain.proceed(Unknown Source:6)
at dji.thirdparty.okhttp3.RealCall.getResponseWithInterceptorChain(Unknown Source:114)
at dji.thirdparty.okhttp3.RealCall$AsyncCall.execute(Unknown Source:4)
at dji.thirdparty.okhttp3.internal.NamedRunnable.run(Unknown Source:17)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
at java.lang.Thread.run(Thread.java:764)
我希望注册能够正常进行,我收到“ Hello Round World”屏幕和“ Registering pls wait ...” showToast消息,但是在几次KeyStore异常之后,我得到了“ Register sdk失败,请检查捆绑软件ID和网络连接!”来自OnRegister的消息(DJIError djiError) DJIError出现
djiError = {DJISDKError@14580} "The metadata received from server is invalid, please reconnect to the server and try."
如果注册正常完成,则用户应获得“注册成功” showToast消息。
有人知道什么会导致这些KeyStore异常吗?
谢谢您的时间!