java.lang.RuntimeException:android.database.sqlite.SQLiteException:没有这样的 table:media_store_extension(代码 1):,

java.lang.RuntimeException: android.database.sqlite.SQLiteException: no such table: media_store_extension (code 1): ,

我在 2021 年 10 月之后在 Play 商店发布我的应用程序时遇到问题,错误提示 table media_store_extension 不存在。问题是:我没有在项目中使用 SQLITE,所以我不知道是什么导致了这个异常。

目标sdk是30,de minimun是26

完整错误:

FATAL EXCEPTION: latency_sensitive_executor-thread-1
Process: com.google.android.apps.photos, PID: 29478
java.lang.RuntimeException: android.database.sqlite.SQLiteException: no such table: media_store_extension (code 1): , while compiling: SELECT id FROM media_store_extension ORDER BY id DESC LIMIT 100 OFFSET 0
    at nqo.a(PG:3)
    at aleu.run(PG:6)
    at krv.a(PG:17)
    at krw.run(Unknown Source:6)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1162)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:636)
    at java.lang.Thread.run(Thread.java:764)
    at ksa.run(PG:5)
Caused by: android.database.sqlite.SQLiteException: no such table: media_store_extension (code 1): , while compiling: SELECT id FROM media_store_extension ORDER BY id DESC LIMIT 100 OFFSET 0
    at android.database.sqlite.SQLiteConnection.nativePrepareStatement(Native Method)
    at android.database.sqlite.SQLiteConnection.acquirePreparedStatement(SQLiteConnection.java:890)
    at android.database.sqlite.SQLiteConnection.prepare(SQLiteConnection.java:501)
    at android.database.sqlite.SQLiteSession.prepare(SQLiteSession.java:588)
    at android.database.sqlite.SQLiteProgram.<init>(SQLiteProgram.java:58)
    at android.database.sqlite.SQLiteQuery.<init>(SQLiteQuery.java:37)
    at android.database.sqlite.SQLiteDirectCursorDriver.query(SQLiteDirectCursorDriver.java:46)
    at android.database.sqlite.SQLiteDatabase.rawQueryWithFactory(SQLiteDatabase.java:1392)
    at android.database.sqlite.SQLiteDatabase.queryWithFactory(SQLiteDatabase.java:1239)
    at android.database.sqlite.SQLiteDatabase.query(SQLiteDatabase.java:1110)
    at agcm.a(PG:8)
    at nnw.run(PG:17)
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:457)
    at java.util.concurrent.FutureTask.run(FutureTask.java:266)
    ... 4 more

此错误不仅来自 Flutter 开发人员,也来自 Unity (https://forum.unity.com/threads/getting-an-odd-error-in-internal-android-build-after-updating-iap.1104352/ and https://forum.unity.com/threads/error-when-submitting-app-to-google-play.1098139/),在我的例子中 - 对于原生 android 应用程序。

我们在 6 个月前第一次遇到这个错误并应用了 unity 人员建议的修复:

aaptOptions {
    noCompress 'db'
    ...
}

但是,昨天我们再次收到同样的错误,所以“修复”没有对我们有用。

出现错误:

  1. (到目前为止)仅在内部测试期间
  2. 仅限小米红米6A
  3. 不定期(不是每次都转载)
  4. 一直在进行中com.google.android.apps.photos

我目前看到的most reasonable explanation是测试机器人尝试截图时出现异常

这解释了为什么这个过程是 Google Photos',为什么每次都没有重现错误,以及为什么只需重新提交一个新版本就可以“修复”它。

这也意味着忽略错误应该没问题。

我怀疑这是 Google 用于发布前报告的特定小米红米 6A 的配置/安装问题。有太多来自各种不同应用程序的报告(例如,另请参阅 https://github.com/airsdk/Adobe-Runtime-Support/issues/1376,这是 Android 上的另一个技术堆栈,就像 Unity 或 Flutter 一样)。我没有任何具体证据,但这是我看到一切的直觉。

因此我不会做任何 Gradle aapt 配置 voodoo 或 ADT 修补或类似的事情。