wlky / AnkiDroid-Wear

Anki for Android Wear devices
GNU General Public License v2.0
48 stars 11 forks source link

No card displayed anymore #15

Closed nbossard closed 7 years ago

nbossard commented 7 years ago

Ankiwear used to run fine, but now that I switched to my new nexus 7 it displays on the watch the smiling face with a spinner for ever.

Phone is running OS version : 7.1.2 Watch is : sony smartwatch 1.5.0 Ankidroid app version is : 2.8.2

wlky commented 7 years ago

hmm I just updated my phone to 7.1.1 and on my LG g watch everything is still working as it did before... could you check the permission of the Ankiwear app on the phone, just to be sure? Could you get some Logcat logs while you try to open the app on the watch?

nbossard commented 7 years ago

May be the problem does not come from my android version but from the fact I am in the beta version in the play store. I made a dev pull request #14, please have a look.

nbossard commented 7 years ago

This is the crash I had :

on line

        Cursor reviewInfoCursor =
                getContentResolver().query(DUE_CARD_REVIEW_INFO_URI, null, deckSelector, deckArguments, null);

Crash was : (dont use line numbers)

04-10 23:19:42.187 24116-24491/com.yannik.wear.anki E/AndroidRuntime: FATAL EXCEPTION: WearableListenerService Process: com.yannik.wear.anki, PID: 24116 java.lang.SecurityException: Permission not granted for: CardContentProvider.query /schedule (com.yannik.wear.anki) at android.os.Parcel.readException(Parcel.java:1684) at android.database.DatabaseUtils.readExceptionFromParcel(DatabaseUtils.java:183) at android.database.DatabaseUtils.readExceptionFromParcel(DatabaseUtils.java:135) at android.content.ContentProviderProxy.query(ContentProviderNative.java:421) at android.content.ContentResolver.query(ContentResolver.java:532) at android.content.ContentResolver.query(ContentResolver.java:474) at com.yannik.anki.WearMessageListenerService.queryForCurrentCard(WearMessageListenerService.java:361) at com.yannik.anki.WearMessageListenerService.onMessageReceived(WearMessageListenerService.java:131) at com.google.android.gms.wearable.WearableListenerService$zzc$2.run(Unknown Source) at android.os.Handler.handleCallback(Handler.java:751) at android.os.Handler.dispatchMessage(Handler.java:95) at com.google.android.gms.wearable.WearableListenerService$zzb.dispatchMessage(Unknown Source) at android.os.Looper.loop(Looper.java:154) at android.os.HandlerThread.run(HandlerThread.java:61)

nbossard commented 7 years ago

I failed compiling the version previous to my changes, mobile part, I get :

Error:Execution failed for task ':mobile:transformClassesWithDexForDebug'. com.android.build.api.transform.TransformException: com.android.ide.common.process.ProcessException: java.util.concurrent.ExecutionException: com.android.dex.DexIndexOverflowException: method ID not in [0, 0xffff]: 65536

wlky commented 7 years ago

I think this is a multiDex issue... At some point I should try to get proguard and minify working again so this becomes unnecessary. Building does still work, but only if you generate a signed apk. I just published a alpha version to the play store that should request the permission and also request Read external storage permission (for sound and image files). If you joined the alpha testers you should have received an update.

nbossard commented 7 years ago

I have received alpha. I noticed a strange behaviour : it asks for anki permissions... and not storage permission... Then on next launch it will ask for storage permission. Should be grouped I think, we can't expect user to launch twice settings if he does not find them useful.

wlky commented 7 years ago

this should be fixed in the new version. Also your pull request is now merged

nbossard commented 7 years ago

Thanks, I tried the new version, it works fine. Great job !