yandexmobile / metrica-sample-android

Yandex AppMetrica SDK Sample for Android
50 stars 15 forks source link

android.database.sqlite.SQLiteException: table httpauth already exists (code 1) #59

Closed petrovichtim closed 4 years ago

petrovichtim commented 4 years ago

Bug in version 3.10.0

public class App extends MultiDexApplication {
  private final static BackgroundThreadPoster mBackgroundThreadPoster =
      new BackgroundThreadPoster();
  private final static UiThreadPoster mUiThreadPoster = new UiThreadPoster();

  public static BackgroundThreadPoster getBackgroundThreadPoster() {
    return mBackgroundThreadPoster;
  }

  public static UiThreadPoster getUiThreadPoster() {
    return mUiThreadPoster;
  }

  public void onCreate() {
    super.onCreate();
    // Создание расширенной конфигурации библиотеки.
    YandexMetricaConfig config =
        YandexMetricaConfig.newConfigBuilder("").build();
    // Инициализация AppMetrica SDK.
    YandexMetrica.activate(getApplicationContext(), config);

    SP.init(this);

    try {
      WebViewDatabase.getInstance(this);
    } catch (final Throwable throwable) {
    }

    //if (isMainProcess()) {
    FirebaseApp.initializeApp(this);
    MobileAds.initialize(this, getString(R.string.pub_id));
    Ads.init(this);

  }

  private static App sInstance;

  public App() {
    sInstance = this;
  }

  public static App get() {
    return sInstance;
  }

In attach my logcat logcat.txt

alexklints commented 4 years ago

Добрый день.

Одна из используемых Вами библиотек работает с системным Webview. Такие библиотеки следует инициализировать только в главном процессе. Ознакомьтесь, пожалуйста, с рекомендациями по инициализации AppMetrica SDK.