Anki-android: Opening .apkg directly does not work

Created on 13 Jul 2019  路  21Comments  路  Source: ankidroid/Anki-Android

Importing .apkg from the web and opening them directly with ankidroid does not work, ankidroid just opens an already imported set. Tested with the latest beta release. Importing them via the filepicker in Ankidroid does work however

Bug Reproduced

All 21 comments

Please give exact steps to reproduce the bug including example apkg file

  1. On version 2.9alpha80
  2. Select download public set
  3. In-app browser comes up, search for a set and download the .apkg
  4. I use Fennec F-Droid as my browser, so when the download is complete it says "open file". Click on that
  5. Select option to Open with AnkiDroid

    What happens:

    AnkiDroid opens the last opened set

What should happen:

AnkiDroid imports the downloaded set

PS: Opening .apkg files via the filesystem browser also fails in the same way.
Using a Galaxy S7 with Android 8.0.0

Set downloaded is: https://ankiweb.net/shared/info/1394656023
But it fails with every set I have tried

I cannot reproduce it. Can you please change the path of your AnkiDroid database location in advanced preferences from [xyz]/AnkiDroid to [xyz]/AnkiDroid2? This will create a new empty collection in that folder. After you try that please check whether or not you can reproduce. When you finish testing you can change the path back to the old value to go back to your main collection.

Also, what do you mean by "AnkiDroid opens the last opened set"? AnkiDroid has no such concept as a "set" in English, I am assuming it's a mistranslation of the word "deck". But after importing the apkg it should just take you to the deck list, it will not open a specific deck. If you are still able to reproduce the issue with an empty collection, then please post a video or some screenshots so that we can better understand what is happening.

I am assuming it's a mistranslation of the word "deck"

That is correct yes
And I am still able to reproduce this bug with an empty collection, only now after opening the .apkg, the app takes me to the empty deck list again.

After further debugging, the issue is only there when opening the file via the black 'openen' popup (open in Dutch) via the in-app browser, powered by in my case Fennec F-Droid. The issue is not there when opening the .apkg via the download notification in the app bar.

I have the same issue, thanks for the hint that it will work via the app bar notification, but thats only possible with a single downloaded deck, wont work with multiple downloads

by the way, importing also does not work even when saved all apkg files to storage/emulated/0

Hello 馃憢, this issue has been opened for more than 2 months with no activity on it. If the issue is still here, please keep in mind that we need community support and help to fix it! Just comment something like _still searching for solutions_ and if you found one, please open a pull request! You have 7 days until this gets closed automatically

I can confirm that this issue is still present on 2.9.3

@TomJansen Thanks!

Is it possible for you to upgrade to 2.10.4 and check?

Could you provide your ACRA ID: Settings - Advanced - About AnkiDroid - Copy Debug Information

Could you then enable crash reporting Settings - AnkiDroid - Crash Reporting and try to perform the import again.

Updated to 2.10.4. Issue is still present.
`
AnkiDroid Version = 2.10.4

Android Version = 8.0.0

ACRA UUID = 8c4073e7-1aa7-4f9c-97cb-969961061bac
`

Thanks! No crash reports submitted, could you screenshot the error that you get?

Could you then enable crash reporting Settings - AnkiDroid - Crash Reporting and try to perform the import again.

How can I obtain the log and paste it here?

The report is sent via a crash dialog.

We still need to implement saving a log to a file for our debug builds: #6264, sorry.

You can get a stream of events via logcat if you're technical: https://developer.android.com/studio/command-line/logcat We're com.ichi2.anki

There's also an easy to use logcat Window in Android Studio (works when you plug in your phone).

Wow! Thanks. Feel free to delete the post. Reproduced

Should I post a logcat with the verbose setting?

@TomJansen no need, I can reproduce the problem, so I can fix it. Could you remove the above logcat post just in case there's any sensitive data in it.

Okay, this is confusing... we get an intent to directly start the reviewer
We're getting the wrong intent from Gecko-based browsers, both Firefox and Fennec

Intent { act=android.intent.action.VIEW flg=0x3000000 hwFlg=0x400 cmp=com.ichi2.anki/.Reviewer (has extras) }

Sent in a report to Mozilla, will get a workaround in place today: https://support.mozilla.org/en-US/questions/1289475

In the meantime: Open from the notification that you get from your browser, rather than the "Open" dialog.

The bug does not appear to happen in Firefox Preview

Was this page helpful?
0 / 5 - 0 ratings

Related issues

infinyte7 picture infinyte7  路  4Comments

littlefoodt picture littlefoodt  路  4Comments

snowtimeglass picture snowtimeglass  路  5Comments

mikehardy picture mikehardy  路  4Comments

hanpingchinese picture hanpingchinese  路  5Comments