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

Pixel 6 & Android 13 => notification not created #58

Open
Koxx3 opened this issue Jan 8, 2023 · 1 comment
Open

Pixel 6 & Android 13 => notification not created #58

Koxx3 opened this issue Jan 8, 2023 · 1 comment

Comments

@Koxx3
Copy link

Koxx3 commented Jan 8, 2023

Hello,

It can't create the notification on this device.

I can see this in the logcat :

2023-01-08 14:35:23.881 24558-24558/com.smartdisplay W/Bundle: Key priority expected Integer but value was a java.lang.Double.  The default value 0 was returned.
2023-01-08 14:35:23.881 24558-24558/com.smartdisplay W/Bundle: Attempt to cast generated internal exception:
    java.lang.ClassCastException: java.lang.Double cannot be cast to java.lang.Integer
        at android.os.BaseBundle.getInt(BaseBundle.java:1255)
        at android.os.BaseBundle.getInt(BaseBundle.java:1237)
        at com.voximplant.foregroundservice.NotificationHelper.buildNotification(NotificationHelper.java:101)
        at com.voximplant.foregroundservice.VIForegroundService.onStartCommand(VIForegroundService.java:31)
        at android.app.ActivityThread.handleServiceArgs(ActivityThread.java:4655)
        at android.app.ActivityThread.-$$Nest$mhandleServiceArgs(Unknown Source:0)
        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2180)
        at android.os.Handler.dispatchMessage(Handler.java:106)
        at android.os.Looper.loopOnce(Looper.java:201)
        at android.os.Looper.loop(Looper.java:288)
        at android.app.ActivityThread.main(ActivityThread.java:7872)
        at java.lang.reflect.Method.invoke(Native Method)
        at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:548)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:936)
2023-01-08 14:35:23.884 1648-1752/? V/ActivityManager: Attempted to start a foreground service (com.smartdisplay/com.voximplant.foregroundservice.VIForegroundService) with a broken notification (no icon: Notification(channel=ForegroundServiceChannel shortcut=null contentView=null vibrate=null sound=null defaults=0x0 flags=0x40 color=0x00000000 actions=1 vis=PRIVATE))

I've tested on a Xiaomi 8, it works.

I really need it to be compatible with Android 13 👍

Service is declared like this in the manifest :

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
  package="com.smartdisplay">


  <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
  <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
  <uses-permission android:name="android.permission.ACCESS_BACKGROUND_LOCATION" />
  <uses-permission android:name="android.permission.FOREGROUND_SERVICE" />

  <application
...
    <activity
      android:name=".MainActivity"
      android:label="@string/app_name"
      android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|screenSize|smallestScreenSize|uiMode"
      android:launchMode="singleTask"
      android:windowSoftInputMode="adjustResize"
      android:exported="true"
      android:saveEnabled="false">
      <intent-filter>
        <action android:name="android.intent.action.MAIN" />
        <category android:name="android.intent.category.LAUNCHER" />
      </intent-filter>
    </activity>
...
    <service android:name="com.voximplant.foregroundservice.VIForegroundService"
      android:foregroundServiceType="location"
      android:exported="false">
    </service>
...

  </application>
</manifest>

... and I've integrate the test app inside my app as component.

@Koxx3
Copy link
Author

Koxx3 commented Jan 8, 2023

ok, after java analysis :

  • the exception comes from the priority. I removed the priority. no more exception.
  • the icon warning come from a wrong icon name. fixed.

but this no notification of background execution.

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

1 participant