Open iamllama opened 1 week ago
Hello! 👋 Thanks for logging this issue. Please remember we are all volunteers here, so some patience may be required before we can get to the issue. Also remember that the fastest way to get resolution on an issue is to propose a change directly, https://github.com/ankidroid/Anki-Android/wiki/Contributing
Checked for duplicates?
Does it also happen in the desktop version?
What are the steps to reproduce this bug?
Gradle dependency
andManifest changes required on Android SDK 30+
, while replacingcom.ichi2.anki
withcom.ichi2.anki.a
(or another parallel build)Expected behaviour
A non-null
Cursor
is expected. Instead, the following error message is logged:Failed to find provider info for com.ichi2.anki.flashcards
This is because AnkiDroid.A's manifest has set
CardContentProvider
's authority uri to${applicationId}.flashcards
, which in the parallel build expands tocom.ichi2.anki.a.flashcards
. https://github.com/ankidroid/Anki-Android/blob/17748efe929a60ac4b1308b9a27358ae20f8a6e6/AnkiDroid/src/main/AndroidManifest.xml#L659-L666If I try using that instead of
FlashCardsContract.Note.CONTENT_URI_V2
, i.e.the following exception is thrown:
The parallel build's content provider now responds, but since it still matches on the incorrect
FlashCardsContract.AUTHORITY
, the uri is deemed invalid https://github.com/ankidroid/Anki-Android/blob/e9fe00726a48f7d347081379de8cb2334fbd80a6/AnkiDroid/src/main/java/com/ichi2/anki/provider/CardContentProvider.kt#L397Debug info
AnkiDroid Version = 2.19beta6 (638d0e29cd91c49d6ca672ebc2494997751160ac)
Backend Version = 0.1.42-anki24.06.3 (24.06.3 d678e39350a2d243242a69f4e22f5192b04398f2)
Android Version = 12 (SDK 31)
(Optional) Anything else you want to share?
One way might be to have
CardContentProvider
construct its own copy ofFlashCardsContract.AUTHORITY
usingR.string.applicationId
BuildConfig.APPLICATION_ID
, before passing it to the matcher https://github.com/ankidroid/Anki-Android/blob/e9fe00726a48f7d347081379de8cb2334fbd80a6/AnkiDroid/src/main/java/com/ichi2/anki/provider/CardContentProvider.kt#L141Research