Apps-android-commons: App shortcuts not working

Created on 27 Dec 2020  路  10Comments  路  Source: commons-app/apps-android-commons

Summary:
The app shortcuts don't seem to be working now.

Steps to reproduce:

  1. Long press Commons app icon
  2. Click on one of the app shortcuts
  3. Observe that the corresponding action is _not_ triggered but an "App not found" toast is shown.

Device and Android version:
Nokia 2.3; Android 10

Commons app version:
2.13.2~757c7b008

bug good first issue

Most helpful comment

@Pratham2305 Sure. Feel free to work on this in case you're interested. :)

Hi @akshaykrad 馃憢. Welcome to the project. There's already interest in this ticket. Feel free to find other beginner friendly issue by looking at issues tagged with good-first-issue. Also, take a look at our Volunteers-welcome! wiki doc, in case you haven't already done so. 馃檪

All 10 comments

@sivaraam
It seems that its working on my phone (Realme 3 pro, android 10)
Please could you upload a video or screenshot of the issue to confirm if I an following the right steps

@sivaraam
When I debug the app using my Android device, the only shortcut visible is the 'Setting' shortcut which is working fine. However, when I download the Wikimedia Commons app from the Play Store I can see three shortcuts ('Settings', 'Bookmarks' and 'Explore') none of which are working and they give the toast 'Permission Denied'. Am I to assume that the difference between the two is because of updates that have not yet been released? If it is, does that mean this issue is now resolved? (Sorry if this is a silly question, I am new to open source contribution. Thanks

It seems that its working on my phone (Realme 3 pro, android 10)

@Saral-code Which version of the app do you use?

When I debug the app using my Android device, the only shortcut visible is the 'Setting' shortcut which is working fine. However, when I download the Wikimedia Commons app from the Play Store I can see three shortcuts ('Settings', 'Bookmarks' and 'Explore') none of which are working and they give the toast 'Permission Denied'. Am I to assume that the difference between the two is because of updates that have not yet been released?

@mdaabis Interesting. What version do you see in the 'About' screen in the built version of the app? What version do you see in the 'About' screen in the play store version?

! Please could you upload a video or screenshot of the issue to confirm if I an following the right steps

Here's the recording of the issue I observe:

https://user-images.githubusercontent.com/12448084/103236499-135b2200-496b-11eb-9794-551eb1254c51.mp4

@sivaraam Yes, I am facing this issue when I have installed the app from play store (app version 2.13.2-757c7b008) as also mentioned by @mdaabis , but Since that shortcut.xml file contains only the settings shortcut now, hence only setting shortcut is appearing When I am running the current master branch(app version 2.13.2-debug-master-1ccb357e). and it is working fine in betaDebug.

@sivaraam Yes, I am facing this issue when I have installed the app from play store (app version 2.13.2-757c7b008) as also mentioned by @mdaabis , but Since that shortcut.xml file contains only the settings shortcut now, hence only setting shortcut is appearing When I am running the current master branch(app version 2.13.2-debug-master-1ccb357e). and it is working fine in betaDebug.

I agree with @Pratham2305 , I am facing the same scenario.

i just tried building prodDebug from master pointing at 86c571ceee843d8a50226d6a6a71d5682d1344a6 and I still face the issue. When debugging, the exception I see when tapping on the shortcut is the following:

2021-01-01 23:10:56.990 1049-1145/? E/LauncherAppsService: Couldn't start activity, code=-92
2021-01-01 23:10:57.015 29380-29380/? E/BaseDraggingActivity: Unable to launch. tag=WorkspaceItemInfo(id=-1 type=DEEPSHORTCUT container=-1 screen=-1 cell(-1,-1) span(1,1) minSpan(1,1) rank=0 user=UserHandle{0} title=Settings) intent=Intent { act=android.intent.action.MAIN cat=[com.android.launcher3.DEEP_SHORTCUT] flg=0x10200000 pkg=fr.free.nrw.commons cmp=fr.free.nrw.commons/.auth.LoginActivity bnds=[35,770][420,868] (has extras) }
    android.content.ActivityNotFoundException: Shortcut could not be started
        at android.content.pm.LauncherApps.startShortcut(LauncherApps.java:1144)
        at android.content.pm.LauncherApps.startShortcut(LauncherApps.java:1109)
        at com.android.launcher3.shortcuts.DeepShortcutManager.startShortcut(DeepShortcutManager.java:139)
        at com.android.launcher3.BaseDraggingActivity.startShortcutIntentSafely(BaseDraggingActivity.java:202)
        at com.android.launcher3.BaseDraggingActivity.startActivitySafely(BaseDraggingActivity.java:162)
        at com.android.launcher3.Launcher.startActivitySafely(Launcher.java:1826)
        at com.android.launcher3.touch.ItemClickHandler.startAppShortcutOrInfoActivity(ItemClickHandler.java:267)
        at com.android.launcher3.touch.ItemClickHandler.onClickAppShortcut(ItemClickHandler.java:232)
        at com.android.launcher3.touch.ItemClickHandler.onClick(ItemClickHandler.java:96)
        at com.android.launcher3.touch.ItemClickHandler.lambda$getInstance$0(ItemClickHandler.java:67)
        at com.android.launcher3.touch.-$$Lambda$ItemClickHandler$_rHy-J5yxnvGlFKWSh6CdrSf-lA.onClick(Unknown Source:2)
        at android.view.View.performClick(View.java:7146)
        at com.android.launcher3.shortcuts.DeepShortcutTextView.performClick(DeepShortcutTextView.java:123)
        at android.view.View.performClickInternal(View.java:7119)
        at android.view.View.access$3500(View.java:803)
        at android.view.View$PerformClick.run(View.java:27533)
        at android.os.Handler.handleCallback(Handler.java:883)
        at android.os.Handler.dispatchMessage(Handler.java:100)
        at android.os.Looper.loop(Looper.java:214)
        at android.app.ActivityThread.main(ActivityThread.java:7386)
        at java.lang.reflect.Method.invoke(Native Method)
        at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:514)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:980)

Okay I think the problem is that in shortcut.xml it is only targeting the beta package variant that's why it is working fine on betaDebug. @sivaraam Can I make a PR to resolve this one ?

@sivaraam I am a beginner and would like to workout this issue , kindly assign me to this issue.

@Pratham2305 Sure. Feel free to work on this in case you're interested. :)

Hi @akshaykrad 馃憢. Welcome to the project. There's already interest in this ticket. Feel free to find other beginner friendly issue by looking at issues tagged with good-first-issue. Also, take a look at our Volunteers-welcome! wiki doc, in case you haven't already done so. 馃檪

Was this page helpful?
0 / 5 - 0 ratings