mirror of https://github.com/TeamNewPipe/NewPipe
Fix empty stacktrace in bug report
ACRA has to be initialized after MultiDex https://github.com/ACRA/acra/issues/619 https://github.com/ACRA/acra/wiki/Troubleshooting-Guide#legacy-multidex
This commit is contained in:
parent
d6d8c7830c
commit
1b9f5989ef
|
@ -1,6 +1,5 @@
|
|||
package org.schabi.newpipe
|
||||
|
||||
import android.content.Context
|
||||
import androidx.multidex.MultiDex
|
||||
import androidx.preference.PreferenceManager
|
||||
import com.facebook.stetho.Stetho
|
||||
|
@ -11,11 +10,6 @@ import okhttp3.OkHttpClient
|
|||
import org.schabi.newpipe.extractor.downloader.Downloader
|
||||
|
||||
class DebugApp : App() {
|
||||
override fun attachBaseContext(base: Context) {
|
||||
super.attachBaseContext(base)
|
||||
MultiDex.install(this)
|
||||
}
|
||||
|
||||
override fun onCreate() {
|
||||
super.onCreate()
|
||||
initStetho()
|
||||
|
@ -34,6 +28,12 @@ class DebugApp : App() {
|
|||
return downloader
|
||||
}
|
||||
|
||||
override fun initACRA() {
|
||||
// install MultiDex before initializing ACRA
|
||||
MultiDex.install(this)
|
||||
super.initACRA()
|
||||
}
|
||||
|
||||
private fun initStetho() {
|
||||
// Create an InitializerBuilder
|
||||
val initializerBuilder = Stetho.newInitializerBuilder(this)
|
||||
|
|
|
@ -77,7 +77,6 @@ public class App extends Application {
|
|||
@Override
|
||||
protected void attachBaseContext(final Context base) {
|
||||
super.attachBaseContext(base);
|
||||
|
||||
initACRA();
|
||||
}
|
||||
|
||||
|
@ -200,7 +199,11 @@ public class App extends Application {
|
|||
.build();
|
||||
}
|
||||
|
||||
private void initACRA() {
|
||||
/**
|
||||
* Called in {@link #attachBaseContext(Context)} after calling the {@code super} method.
|
||||
* Should be overridden if MultiDex is enabled, since it has to be initialized before ACRA.
|
||||
*/
|
||||
protected void initACRA() {
|
||||
try {
|
||||
final CoreConfiguration acraConfig = new CoreConfigurationBuilder(this)
|
||||
.setReportSenderFactoryClasses(REPORT_SENDER_FACTORY_CLASSES)
|
||||
|
|
Loading…
Reference in New Issue