未知错误:运行时关闭期间启动线程

时间:2018-12-29 08:28:58

标签: android firebase okhttp3 exoplayer okhttp

我不知道用户的行为。 日志不会将错误定位到我项目中的某个位置。 我通过Firebase收集了以下信息: loglog 我在项目中使用了这些依赖项:

implementation 'com.squareup.okhttp3:okhttp:3.10.0'
implementation 'com.squareup.okio:okio:1.14.0'
implementation 'com.devbrackets.android:exomedia:4.1.0'
implementation 'com.google.android.exoplayer:extension-okhttp:2.7.3'
implementation 'com.google.firebase:firebase-invites:16.0.5'
implementation 'com.google.firebase:firebase-core:16.0.5'
implementation 'com.google.firebase:firebase-messaging:17.3.4'

使用这些依赖项的代码:

1:

ExoMedia.setDataSourceFactoryProvider(new ExoMedia.DataSourceFactoryProvider() {
            @NonNull
            @Override
            public DataSource.Factory provide(@NonNull String userAgent, @Nullable TransferListener<? super DataSource> listener) {
                // Updates the network data source to use the OKHttp implementation
                OkHttpClient mOkHttpClient = new OkHttpClient().newBuilder()
                        .connectTimeout(IntConstants.defauilHttpTimeOut, TimeUnit.SECONDS)
                        .readTimeout(IntConstants.defauilHttpTimeOut, TimeUnit.SECONDS)
                        .writeTimeout(IntConstants.defauilHttpTimeOut, TimeUnit.SECONDS)
                        .sslSocketFactory(SSLSocketClient.getSSLSocketFactory(), Objects.requireNonNull(SSLSocketClient.getX509TrushManager()))//config our ssl
                        .hostnameVerifier(SSLSocketClient.getHostnameVerifier())//config
                        .build();
                DataSource.Factory upstreamFactory = new OkHttpDataSourceFactory(mOkHttpClient, userAgent, listener);

                // Adds a cache around the upstreamFactory
                Cache cache = new SimpleCache(getCacheDir(), new LeastRecentlyUsedCacheEvictor(50 * 1024 * 1024));
                return new CacheDataSourceFactory(cache, upstreamFactory, CacheDataSource.FLAG_IGNORE_CACHE_ON_ERROR);
            }
        });

        Uri uri = Uri.parse(currentItem.getMediaUrl());
        DebugUtils.getInstance().e(StrLogEtcMessage.reviewItemDetailsUrl,currentItem.getMediaUrl());
        vvViewedDetail.setOnPreparedListener(new OnPreparedListener() {
            @Override
            public void onPrepared() {
                //Starts the video playback as soon as it is ready
                vvViewedDetail.start();
            }
        });
        vvViewedDetail.setOnErrorListener(new OnErrorListener() {
            @Override
            public boolean onError(Exception e) {
                DebugUtils.getInstance().e(StrLogEtcMessage.reviewMediaLoadError,e.getMessage());
                return false;
            }
        });
        vvViewedDetail.setVideoURI(uri);

2:

Crashlytics crashlyticsKit = new Crashlytics.Builder()
            .core(new CrashlyticsCore.Builder().disabled(BuildConfig.DEBUG).build())
            .build();

    Fabric.with(this, crashlyticsKit);

3:public class FCMMessagingService extends FirebaseMessagingService {...}

请帮助或尝试提供一些实现方法。

我将非常感谢!

0 个答案:

没有答案