Skip to content
This repository has been archived by the owner on Apr 28, 2022. It is now read-only.

Crash on some devices #27

Closed
sistr22 opened this issue May 31, 2013 · 1 comment
Closed

Crash on some devices #27

sistr22 opened this issue May 31, 2013 · 1 comment

Comments

@sistr22
Copy link

sistr22 commented May 31, 2013

I just checkout your code and try to launch the sample (life game).
I had a crash with it while installing it through adb.
That was because my packageManager.getInstallerPackageName was called with a wrong package name inside the class “GooglePlay.java” in your library.
I looked into the code and found:

String packageName = mContext.getApplicationContext().getClass().getPackage().getName(); // This does not return the package name of the app in my case (with a nexus 7)
String installerPackageName = packageManager.getInstallerPackageName(packageName);

I think there is an error, stop me if I’m wrong:
String packageName = mContext.getApplicationContext().getPackageName();
Should be better.

getClass().getPackage().getName(); does not always return the package name of the app, it depend on many things, one of them is the constructor of your phone … (Welcome in Android world).

@bminaiev
Copy link
Contributor

bminaiev commented Jun 3, 2013

Thank you, we have already fixed this bug in library, but forgot to update code in sample. Now it should work.

@bminaiev bminaiev closed this as completed Jun 3, 2013
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

No branches or pull requests

2 participants