I launched an application in Google Play a few days ago, and then decided to make an update and push that out too. I had the original version loaded on my device (with a launch icon on the home screen as well), when the update was available I used that as well and I started seeing a message when using the launch icon:

enter image description here

I attached my phone to the computer and grabbed a logcat of what was going on when I saw this message:

I/InputDispatcher(  379): Delivering touch to current input target: action: 0x1
I/ActivityManager(  379): START {intent.toShortString} from pid 711
D/PowerManagerService(  379): acquireDVFSLockLocked : type : DVFS_MIN_LIMIT  fre
quency : 1026000  uid : 1000  pid : 379  tag : ActivityManager
W/ActivityManager(  379): mDVFSLock.acquire()
W/ActivityManager(  379): Permission denied: checkComponentPermission() owningUi
d=10153
W/ActivityManager(  379): Permission Denial: starting Intent { act=android.inten
t.action.MAIN cat=[ xxx ] flg=0x10000000 pkg=com.gmail.apps.works.ren.tictactoe
cmp=xxxx bnds=[0,338][120,488] } from ProcessRecord{41cba100 711:com.sec.android
.app.twlauncher/10001} (pid=711, uid=10001) not exported from uid 10153
E/Launcher(  711): Launcher does not have the permission to launch Intent { act=
android.intent.action.MAIN cat=[ xxx ] flg=0x10000000 pkg=com.gmail.apps.works.r
en.tictactoe cmp=xxxx bnds=[0,338][120,488] }. Make sure to create a MAIN intent
-filter for the corresponding activity or use the exported attribute for this ac
tivity.

Permission denial? After some research I found this link explaining that I needed export permissions either under the receiver or directly under the activity, but based on the various answers it wasn't clear to me which would solve my problem.

Now if I directly run/debug from my computer, there's no problem seen, home screen launcher and menu launcher both work as expected. Also, if I uninstall the application and download a fresh copy there is no issue seen.
The only time I see this problem is when I downloaded the update from Google Play after having the previous version (and home screen launcher icon) installed.

So how can I reproduce this scenario so that I can test the different fix options without pushing more (potentially) broken content to the Google Play store?

有帮助吗?

解决方案

That was the problem I was having, normal debugging/testing with Eclipse don't work here because it uninstalls the previous (differently signed) version, and AFAIK you can't download different older versions of the same application from Google Play even if I wanted to try that route.. so here's how I managed to solve it:

Backups, backups, backups!
I always save a copy of my .apk along with a snapshot of the development environment right before I push, so I had some of the previous copies laying around.

I found if I manually uninstalled the application I could now install one of my old versions via:

$ mv <myapp>.apk.v1 <myapp>.apk
$ adb install <myapp>.apk

Once it was installed I made a home screen launcher of the old version. Next I found that I can use the -r option from adb install to perform the "update" via installing a new version of the same apk:

$ mv <myapp>.apk.v2 <myapp>.apk
$ adb install -r <myapp>.apk

That did a reinstall of the existing application while keeping the old data (including the old home screen launcher icon).

Now I was able to reproduce my issue. The final step was to apply the various fixes to my project (in Eclipse) build them and export (to create a signed .apk just like what I was launching to Google Play) then install the "update" with adb install -r

and, BTW, adding:

android:exported="true"

To my application's activity did the trick for me. Hopefully this helps someone else!

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top