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

W/ApplicationPackageManager: setEnabledSetting:ComponentInfo{co.unity.mytest/com.evernote.android.job.gcm.PlatformGcmService} newState:1 #139

Closed
akramShokri opened this Issue Feb 8, 2017 · 12 comments

Comments

Projects
None yet
2 participants
@akramShokri

akramShokri commented Feb 8, 2017

Hi
I get this error when using evernote-job-library v1.1.5 with google-play-services v9.4.0 (in unity)

W/ApplicationPackageManager: setEnabledSetting:ComponentInfo{co.unity.mytest/com.evernote.android.job.gcm.PlatformGcmService} newState:1 java.lang.Exception: setComponentEnabledSetting at android.app.ApplicationPackageManager.setComponentEnabledSetting(ApplicationPackageManager.java:1527) at com.evernote.android.job.util.GcmAvailableHelper.setServiceEnabled(GcmAvailableHelper.java:119) at com.evernote.android.job.util.GcmAvailableHelper.isGcmApiSupported(GcmAvailableHelper.java:46) at com.evernote.android.job.util.JobApi.isSupported(JobApi.java:99) at com.evernote.android.job.JobProxy$Common.cleanUpOrphanedJob(JobProxy.java:237) at com.evernote.android.job.JobManager.schedule(JobManager.java:225) at com.evernote.android.job.JobRequest.schedule(JobRequest.java:349)

I wonder if there is any dependency to higher gcm library in new release of your app? I didn't have this error with version 1.1.3 of evernote-job-library.
Any suggestion is appreciated.
Thanks

@vRallev

This comment has been minimized.

Show comment
Hide comment
@vRallev

vRallev Feb 8, 2017

Contributor

No, version 1.1.3 used the same version 9.8.0. That code wasn't changed between those two versions. Your app shouldn't crash in this case, but I'm wondering what the real exception is. Because this line shouldn't throw any exception:

packageManager.setComponentEnabledSetting(component, PackageManager.COMPONENT_ENABLED_STATE_ENABLED, PackageManager.DONT_KILL_APP);
Contributor

vRallev commented Feb 8, 2017

No, version 1.1.3 used the same version 9.8.0. That code wasn't changed between those two versions. Your app shouldn't crash in this case, but I'm wondering what the real exception is. Because this line shouldn't throw any exception:

packageManager.setComponentEnabledSetting(component, PackageManager.COMPONENT_ENABLED_STATE_ENABLED, PackageManager.DONT_KILL_APP);
@akramShokri

This comment has been minimized.

Show comment
Hide comment
@akramShokri

akramShokri Feb 11, 2017

Seems that my problem was related to support-v4.jar library. I am using some version before 25.0.0 and it seems there are significant changes from 24 to 25.
I don't know whether the error log which I posted is related to support library or not (it does not cuse force stop of app) but in my case support library being lower than 25 is preventing library from working properly.

akramShokri commented Feb 11, 2017

Seems that my problem was related to support-v4.jar library. I am using some version before 25.0.0 and it seems there are significant changes from 24 to 25.
I don't know whether the error log which I posted is related to support library or not (it does not cuse force stop of app) but in my case support library being lower than 25 is preventing library from working properly.

@vRallev

This comment has been minimized.

Show comment
Hide comment
@vRallev

vRallev Feb 12, 2017

Contributor

It shouldn't be related to the support library, but what you can try is

    compile('com.evernote:android-job:1.1.5') {
        exclude group: 'com.android.support'
    }

Then it should work with the older support library. Note that always the highest version of an library is being used. Let's say this job library requires support library 25, but you include 24 in your build script, then version 25 is used in the end. gradle dependencies should help you to find out which dependencies are being used.

Contributor

vRallev commented Feb 12, 2017

It shouldn't be related to the support library, but what you can try is

    compile('com.evernote:android-job:1.1.5') {
        exclude group: 'com.android.support'
    }

Then it should work with the older support library. Note that always the highest version of an library is being used. Let's say this job library requires support library 25, but you include 24 in your build script, then version 25 is used in the end. gradle dependencies should help you to find out which dependencies are being used.

@akramShokri

This comment has been minimized.

Show comment
Hide comment
@akramShokri

akramShokri Mar 28, 2017

setEnabledSetting:ComponentInfo{<appPackageName>/com.evernote.android.job.gcm.PlatformGcmService} newState:1 java.lang.Exception: setComponentEnabledSetting at android.app.ApplicationPackageManager.setComponentEnabledSetting(ApplicationPackageManager.java:1527) at com.evernote.android.job.util.GcmAvailableHelper.setServiceEnabled(GcmAvailableHelper.java:119) at com.evernote.android.job.util.GcmAvailableHelper.isGcmApiSupported(GcmAvailableHelper.java:46) at com.evernote.android.job.util.JobApi.isSupported(JobApi.java:99) at com.evernote.android.job.JobProxy$Common.cleanUpOrphanedJob(JobProxy.java:237) at com.evernote.android.job.JobManager.schedule(JobManager.java:225) at com.evernote.android.job.JobRequest.schedule(JobRequest.java:349)

This error happened again in an android studio app, which uses the latest support library and build tools. This won't crash the app, but JobScheduler will not work and therfore my library stops working. I am using v1.1.5 of your library.
Do you have any suggestion?

akramShokri commented Mar 28, 2017

setEnabledSetting:ComponentInfo{<appPackageName>/com.evernote.android.job.gcm.PlatformGcmService} newState:1 java.lang.Exception: setComponentEnabledSetting at android.app.ApplicationPackageManager.setComponentEnabledSetting(ApplicationPackageManager.java:1527) at com.evernote.android.job.util.GcmAvailableHelper.setServiceEnabled(GcmAvailableHelper.java:119) at com.evernote.android.job.util.GcmAvailableHelper.isGcmApiSupported(GcmAvailableHelper.java:46) at com.evernote.android.job.util.JobApi.isSupported(JobApi.java:99) at com.evernote.android.job.JobProxy$Common.cleanUpOrphanedJob(JobProxy.java:237) at com.evernote.android.job.JobManager.schedule(JobManager.java:225) at com.evernote.android.job.JobRequest.schedule(JobRequest.java:349)

This error happened again in an android studio app, which uses the latest support library and build tools. This won't crash the app, but JobScheduler will not work and therfore my library stops working. I am using v1.1.5 of your library.
Do you have any suggestion?

@akramShokri akramShokri reopened this Mar 28, 2017

@vRallev

This comment has been minimized.

Show comment
Hide comment
@vRallev

vRallev Mar 28, 2017

Contributor

The library should still work, this is more of a warning. Are the Google Play Services installed on this device?

Contributor

vRallev commented Mar 28, 2017

The library should still work, this is more of a warning. Are the Google Play Services installed on this device?

@akramShokri

This comment has been minimized.

Show comment
Hide comment
@akramShokri

akramShokri Mar 28, 2017

Yes, google play service is installed and I have some other apps using my library which are working properly on this device.
Unfortunately this error message happens when my library tries to schedule a job and after this message, no job would run.

akramShokri commented Mar 28, 2017

Yes, google play service is installed and I have some other apps using my library which are working properly on this device.
Unfortunately this error message happens when my library tries to schedule a job and after this message, no job would run.

@vRallev

This comment has been minimized.

Show comment
Hide comment
@vRallev

vRallev Mar 28, 2017

Contributor

Are you sure that the job is not scheduled? Because that whole logic is in a big try-catch block. Can you attach a full log with the error message?

    public static boolean isGcmApiSupported(Context context) {
        try {
            if (!checkedServiceEnabled) {
                checkedServiceEnabled = true;
                setServiceEnabled(context, GCM_IN_CLASSPATH);
            }

            return GCM_IN_CLASSPATH
                    && GoogleApiAvailability.getInstance().isGooglePlayServicesAvailable(context) == ConnectionResult.SUCCESS
                    && isGcmServiceRegistered(context) == ConnectionResult.SUCCESS;
        } catch (Throwable t) {
            // seeing sometimes a DeadObjectException, return false, we can't do anything in this case
            // still sometimes seeing a NoClassDefFoundError here
            Cat.w(t);
            return false;
        }
    }
Contributor

vRallev commented Mar 28, 2017

Are you sure that the job is not scheduled? Because that whole logic is in a big try-catch block. Can you attach a full log with the error message?

    public static boolean isGcmApiSupported(Context context) {
        try {
            if (!checkedServiceEnabled) {
                checkedServiceEnabled = true;
                setServiceEnabled(context, GCM_IN_CLASSPATH);
            }

            return GCM_IN_CLASSPATH
                    && GoogleApiAvailability.getInstance().isGooglePlayServicesAvailable(context) == ConnectionResult.SUCCESS
                    && isGcmServiceRegistered(context) == ConnectionResult.SUCCESS;
        } catch (Throwable t) {
            // seeing sometimes a DeadObjectException, return false, we can't do anything in this case
            // still sometimes seeing a NoClassDefFoundError here
            Cat.w(t);
            return false;
        }
    }
@akramShokri

This comment has been minimized.

Show comment
Hide comment
@akramShokri

akramShokri Mar 28, 2017

It is misterious for me too, because the same lib works fine on many different apps but these few cases have this problem.
Here is the full stacktrace:
W/ApplicationPackageManager: setEnabledSetting:ComponentInfo{<APP-PACKAGE-NAME>/com.evernote.android.job.gcm.PlatformGcmService} newState:1 java.lang.Exception: setComponentEnabledSetting at android.app.ApplicationPackageManager.setComponentEnabledSetting(ApplicationPackageManager.java:1527) at com.evernote.android.job.util.GcmAvailableHelper.setServiceEnabled(GcmAvailableHelper.java:119) at com.evernote.android.job.util.GcmAvailableHelper.isGcmApiSupported(GcmAvailableHelper.java:46) at com.evernote.android.job.util.JobApi.isSupported(JobApi.java:99) at com.evernote.android.job.JobProxy$Common.cleanUpOrphanedJob(JobProxy.java:237) at com.evernote.android.job.JobManager.schedule(JobManager.java:225) at com.evernote.android.job.JobRequest.schedule(JobRequest.java:349) at <MY-LIB-PACKAGE>.task.scheduler.a.c.a(Unknown Source) at <MY-LIB-PACKAGE>.task.d.a(Unknown Source) at <MY-LIB-PACKAGE>.task.d.a(Unknown Source) at <MY-LIB-PACKAGE>.c.a.o.a(Unknown Source) at <MY-LIB-PACKAGE>.MYLIB.d(Unknown Source) at <MY-LIB-PACKAGE>.MYLIB.a(Unknown Source) at <MY-LIB-PACKAGE>.MYLIB.initialize(Unknown Source) at <APP-PACKAGE-NAME>.GoToLoginDesign.onCreate(GoToLoginDesign.java:47) at android.app.Activity.performCreate(Activity.java:6039) at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1106) at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2298) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2407) at android.app.ActivityThread.access$700(ActivityThread.java:155) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1317) at android.os.Handler.dispatchMessage(Handler.java:102) at android.os.Looper.loop(Looper.java:135) at android.app.ActivityThread.main(ActivityThread.java:5298) at java.lang.reflect.Method.invoke(Native Method) at java.lang.reflect.Method.invoke(Method.java:372) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:911) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:706)

akramShokri commented Mar 28, 2017

It is misterious for me too, because the same lib works fine on many different apps but these few cases have this problem.
Here is the full stacktrace:
W/ApplicationPackageManager: setEnabledSetting:ComponentInfo{<APP-PACKAGE-NAME>/com.evernote.android.job.gcm.PlatformGcmService} newState:1 java.lang.Exception: setComponentEnabledSetting at android.app.ApplicationPackageManager.setComponentEnabledSetting(ApplicationPackageManager.java:1527) at com.evernote.android.job.util.GcmAvailableHelper.setServiceEnabled(GcmAvailableHelper.java:119) at com.evernote.android.job.util.GcmAvailableHelper.isGcmApiSupported(GcmAvailableHelper.java:46) at com.evernote.android.job.util.JobApi.isSupported(JobApi.java:99) at com.evernote.android.job.JobProxy$Common.cleanUpOrphanedJob(JobProxy.java:237) at com.evernote.android.job.JobManager.schedule(JobManager.java:225) at com.evernote.android.job.JobRequest.schedule(JobRequest.java:349) at <MY-LIB-PACKAGE>.task.scheduler.a.c.a(Unknown Source) at <MY-LIB-PACKAGE>.task.d.a(Unknown Source) at <MY-LIB-PACKAGE>.task.d.a(Unknown Source) at <MY-LIB-PACKAGE>.c.a.o.a(Unknown Source) at <MY-LIB-PACKAGE>.MYLIB.d(Unknown Source) at <MY-LIB-PACKAGE>.MYLIB.a(Unknown Source) at <MY-LIB-PACKAGE>.MYLIB.initialize(Unknown Source) at <APP-PACKAGE-NAME>.GoToLoginDesign.onCreate(GoToLoginDesign.java:47) at android.app.Activity.performCreate(Activity.java:6039) at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1106) at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2298) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2407) at android.app.ActivityThread.access$700(ActivityThread.java:155) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1317) at android.os.Handler.dispatchMessage(Handler.java:102) at android.os.Looper.loop(Looper.java:135) at android.app.ActivityThread.main(ActivityThread.java:5298) at java.lang.reflect.Method.invoke(Native Method) at java.lang.reflect.Method.invoke(Method.java:372) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:911) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:706)

@vRallev

This comment has been minimized.

Show comment
Hide comment
@vRallev

vRallev Mar 28, 2017

Contributor

No, I didn't mean the stacktrace. I meant a longer log. I want to know if the library prints something after that in the log.

Contributor

vRallev commented Mar 28, 2017

No, I didn't mean the stacktrace. I meant a longer log. I want to know if the library prints something after that in the log.

@akramShokri

This comment has been minimized.

Show comment
Hide comment
@akramShokri

akramShokri Mar 28, 2017

No, I have disabled Cat logs in my lib so there is no other log except for this error message.

akramShokri commented Mar 28, 2017

No, I have disabled Cat logs in my lib so there is no other log except for this error message.

@vRallev

This comment has been minimized.

Show comment
Hide comment
@vRallev

vRallev Mar 28, 2017

Contributor

As far as I can tell jobs are scheduled nonetheless. The stacktrace begins with W/, what means this is a warning and not a crash. I'm also not able to reproduce what you're describing. I'm sorry, but I can't do anything.

Contributor

vRallev commented Mar 28, 2017

As far as I can tell jobs are scheduled nonetheless. The stacktrace begins with W/, what means this is a warning and not a crash. I'm also not able to reproduce what you're describing. I'm sorry, but I can't do anything.

@akramShokri

This comment has been minimized.

Show comment
Hide comment
@akramShokri

akramShokri Mar 28, 2017

Ok, it's fine.
Thank you.

akramShokri commented Mar 28, 2017

Ok, it's fine.
Thank you.

@vRallev vRallev closed this Apr 1, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment