24

I am using API 30 - Android 11.0 in my emulator. Whenever I am running my application, I am receiving more than 200 lines of the following message in the log:

    Accessing hidden method Landroid/database/sqlite/SQLiteDatabase;->yieldIfContendedHelper(ZJ)Z 
(greylist-max-o, linking, denied)

But, for my application, I am NOT even using database. Searching in google, I come to this which basically mentions all non-SDK interfaces that were added to the SDK in Android 11.

So, is it possible to know why I am getting so many logs of that message when my app is not even using any database?

  • A library that you are using might be using SQLite. You might peek at your app's internal storage via Android Studio's Device File Manager and see if you have any databases. – CommonsWare Nov 21 '20 at 22:54
  • You are right. Looks like I do have a database folder at my app's internal storage. Any way to know which library is using and possibly block the library? @CommonsWare – ProgrammingEnthusiast Nov 21 '20 at 22:58
  • What is the name of the database? We might be able to make some educated guesses from that. Bear in mind that you may not *want* to block the library -- there is a decent chance that there is a reason why your app is pulling in the library. – CommonsWare Nov 21 '20 at 23:01
  • I don't know the name of the database as I am not using any. But, if you meant folder name, it is `databases`. @CommonsWare – ProgrammingEnthusiast Nov 21 '20 at 23:06
  • Oh, sorry, I assumed that there was a file in `databases/`. `WebView` might store its own databases separately, though I do not know if it uses `SQLiteDatabase`. – CommonsWare Nov 21 '20 at 23:08
  • so, any ideas what should be done? @CommonsWare – ProgrammingEnthusiast Nov 21 '20 at 23:11
  • Live with the messages, most likely. There probably are ways to track down who is using `SQLiteDatabase`, but I cannot think of any simple approaches off the top of my head. – CommonsWare Nov 21 '20 at 23:15
  • no worries. enjoy your weekend. :) – ProgrammingEnthusiast Nov 21 '20 at 23:22
  • @CommonsWare does this seriously mean that SQLiteDatabases won't be supported in the future? I'm using Room and somehow thought that's a safe bet :/ – Tobi Nov 23 '20 at 22:09
  • @Tobi: "does this seriously mean that SQLiteDatabases won't be supported in the future?" -- no! But, as with a lot of the Android SDK, there are hidden methods that aren't supposed to get used and are being locked down. That is the case here, and neither I nor the OP are quite certain who is trying to use that hidden method. – CommonsWare Nov 23 '20 at 22:14
  • Don't think this is unique to Android 11. Happening to Android 10 in my emulator as well – ericn Apr 19 '21 at 15:36

3 Answers3

50

I have a similar problem with my bare-bones app, which definitely does not use SQLite. It looks like it is caused by Database Inspector in Android Studio.

The solution that worked for me is simple:

  1. Restart Android Studio.
  2. Do not click on Database Inspector tab unless you need it.

From these questions[1][2] it seems that Database Inspector can cause problems and no way has been found to disable it without restarting Android Studio.

user28667
  • 1,073
  • 10
  • 9
1

Having the same problem, and I've also never touched the Database Inspector. My Android 10 phone doesn't get this message, but my Android 11 device does. Raising the minSdkVersion to 29 seems to get rid of the log spam, FWIW

covercash2
  • 173
  • 1
  • 2
  • 11
-2

in my case, it was caused by the android studio emulator.

I have tried to run it on my real phone and it actually worked fine!

also, consider making a new emulator with a newer version of API.