Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

android.os.DeadObjectException #266

Closed
trebouillon opened this issue Feb 1, 2017 · 10 comments
Closed

android.os.DeadObjectException #266

trebouillon opened this issue Feb 1, 2017 · 10 comments

Comments

@trebouillon
Copy link

trebouillon commented Feb 1, 2017

This crash occurs while startup of the app and the SDK tries to get the app info. This happens on almost 99% on devices with Marshmallow and mostly Samsung as manufacturer.

I am using "com.adjust.sdk:adjust-android-criteo:4.7.0".

0 java.lang.RuntimeException: Package manager has died

1 at android.app.ApplicationPackageManager.getPackageInfo(ApplicationPackageManager.java:198)

2 at com.adjust.sdk.DeviceInfo.getAppVersion(DeviceInfo.java:107)

3 at com.adjust.sdk.DeviceInfo.(DeviceInfo.java:64)

4 at com.adjust.sdk.ActivityHandler.initInternal(ActivityHandler.java:477)

5 at com.adjust.sdk.ActivityHandler.access$000(ActivityHandler.java:31)

6 at com.adjust.sdk.ActivityHandler$1.run(ActivityHandler.java:126)

7 at android.os.Handler.handleCallback(Handler.java:739)

8 at android.os.Handler.dispatchMessage(Handler.java:95)

9 at android.os.Looper.loop(Looper.java:158)

10 at android.os.HandlerThread.run(HandlerThread.java:61)

11 Caused by: android.os.DeadObjectException

12 at android.os.BinderProxy.transactNative(Native Method)

13 at android.os.BinderProxy.transact(Binder.java:503)

14 at android.content.pm.IPackageManager$Stub$Proxy.getPackageInfo(IPackageManager.java:2721)

15 at android.app.ApplicationPackageManager.getPackageInfo(ApplicationPackageManager.java:193)

16 ... 9 more

17 android.os.DeadObjectException

18 at android.os.BinderProxy.transactNative(Native Method)

19 at android.os.BinderProxy.transact(Binder.java:503)

20 at android.content.pm.IPackageManager$Stub$Proxy.getPackageInfo(IPackageManager.java:2721)

21 at android.app.ApplicationPackageManager.getPackageInfo(ApplicationPackageManager.java:193)

22 at com.adjust.sdk.DeviceInfo.getAppVersion(DeviceInfo.java:107)

23 at com.adjust.sdk.DeviceInfo.(DeviceInfo.java:64)

24 at com.adjust.sdk.ActivityHandler.initInternal(ActivityHandler.java:477)

25 at com.adjust.sdk.ActivityHandler.access$000(ActivityHandler.java:31)

26 at com.adjust.sdk.ActivityHandler$1.run(ActivityHandler.java:126)

27 at android.os.Handler.handleCallback(Handler.java:739)

28 at android.os.Handler.dispatchMessage(Handler.java:95)

29 at android.os.Looper.loop(Looper.java:158)

30 at android.os.HandlerThread.run(HandlerThread.java:61)

@afjoseph
Copy link

afjoseph commented Feb 9, 2017

Hey @trebouillon
Can you try to update to the latest version of Criteo (v4.11.0)?
Here's the doc: https://github.com/adjust/android_sdk/blob/master/doc/english/criteo_plugin.md

Also, where do you store your app's version? Our SDK retrieves the app's version the versionName parameter inside your app's build.gradle. Please refer to this page for a code example: https://developer.android.com/studio/publish/versioning.html

@trebouillon
Copy link
Author

I didn't try the newest version so far. But I can check this with my next major release. And the version name is set in my build gradle.

@afjoseph
Copy link

afjoseph commented Feb 13, 2017

The exception is happening because the PackageManager couldn't retrieve the app version. My guess is that one of two things is the problem:

  • app version is not getting read properly for some reason
  • the context object that is getting supplied to our SDK (from AdjustConfig) is somehow not able to retrieve the package manager (thus creating the DeadObjectException that package manager has died since it can't find it).

Is it possible to provide us with:

  • Your android code block inside your app's build.gradle which includes the versionName attribute. It should look like this:
android {
    compileSdkVersion 25
    buildToolsVersion "25.0.2"

    defaultConfig {
        minSdkVersion 9
        targetSdkVersion 25
        versionCode 1
        versionName getVersionName()
    }
}
  • Also, the code snippet where you initialise our AdjustConfig object and call Adjust.onCreate(config). Please include the name of the function and class you're calling it from, as well.

Thanks for reporting this issue.

@trebouillon
Copy link
Author

Sorry for my late answer. This is how its look like in my app:

android {
    compileSdkVersion 25
    buildToolsVersion "25.0.2"

    defaultConfig {
        versionCode 123
        versionName '4.5.6'
        minSdkVersion 16
        targetSdkVersion 25
        …
    }
}

And the initialization of Adjust:

    final AdjustConfig adjustConfig = new AdjustConfig(context, „abcdef12345“, AdjustConfig.ENVIRONMENT_PRODUCTION);
    adjustConfig.setLogLevel(LogLevel.ASSERT);
    Adjust.onCreate(adjustConfig);

In my case the context is the application context. When the onCreate() method of the application class is called Adjust will be initialized.

@afjoseph
Copy link

Can you provide us with the version of adjust SDK are you using? you mentioned which criteo-adjust version, but not the SDK version.

@trebouillon
Copy link
Author

It is the same. I only include the Criteo Gradle dependency and this includes the same version of Adjust SDK, or am I wrong?

@afjoseph
Copy link

afjoseph commented Feb 22, 2017

I believe so. Is it possible to try the following...

  • Remove the criteo gradle dependency
  • Add this dependency:
compile 'com.adjust.sdk:adjust-android-criteo:4.11.0'

Let me know how it goes :)

@afjoseph
Copy link

Worst case scenario if that doesn't work, we are releasing a new version that has proper exception handling for retrieving app versions so you won't have this crash anymore. We're already working on it.

@trebouillon
Copy link
Author

I will give it a try with the next release. This might take a while :)

@uerceg
Copy link
Contributor

uerceg commented Feb 27, 2017

This should now be resolved with latest Android SDK v4.11.1 release (https://github.com/adjust/android_sdk/releases/tag/v4.11.1).

Feel free to reopen the issue if the problem still happens to occur with newest SDK version.

Cheers

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants