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 14 Issue with DFU Update #54

Open
ISSPRO-Eng opened this issue May 29, 2024 · 7 comments
Open

Android 14 Issue with DFU Update #54

ISSPRO-Eng opened this issue May 29, 2024 · 7 comments

Comments

@ISSPRO-Eng
Copy link

I am running into an issue with running a DFU Update on an Android 14 device. This is the log of the error.

[DfuBaseService] Starting DFU service in foreground
[CompatibilityChangeReporter] Compat change id reported: 160794467; UID 10371; state: ENABLED
[gralloc4] @set_metadata: update dataspace from GM (0x00000000 -> 0x08010000)
[gralloc4] @set_metadata: update dataspace from GM (0x00000000 -> 0x08010000)
[AndroidRuntime] FATAL EXCEPTION: IntentService[DfuBaseService]
[AndroidRuntime] Process: com.isspro.ev3_attribute_programmer, PID: 12111

[AndroidRuntime] android.app.MissingForegroundServiceTypeException: Starting FGS without a type callerApp=ProcessRecord{d6035e4 12111:com.isspro.ev3_attribute_programmer/u0a371} targetSDK=34

[AndroidRuntime] at android.app.MissingForegroundServiceTypeException$1.createFromParcel(MissingForegroundServiceTypeException.java:53)
[AndroidRuntime] at android.app.MissingForegroundServiceTypeException$1.createFromParcel(MissingForegroundServiceTypeException.java:49)
[AndroidRuntime] at android.os.Parcel.readParcelableInternal(Parcel.java:4882)
[AndroidRuntime] at android.os.Parcel.readParcelable(Parcel.java:4864)
[AndroidRuntime] at android.os.Parcel.createExceptionOrNull(Parcel.java:3064)
[AndroidRuntime] at android.os.Parcel.createException(Parcel.java:3053)
[AndroidRuntime] at android.os.Parcel.readException(Parcel.java:3036)
[AndroidRuntime] at android.os.Parcel.readException(Parcel.java:2978)
[AndroidRuntime] at android.app.IActivityManager$Stub$Proxy.setServiceForeground(IActivityManager.java:7214)
[AndroidRuntime] at android.app.Service.startForeground(Service.java:775)
[AndroidRuntime] at no.nordicsemi.android.dfu.DfuBaseService.startForeground(DfuBaseService.java:1926)
[AndroidRuntime] at no.nordicsemi.android.dfu.DfuBaseService.onHandleIntent(DfuBaseService.java:1153)
[AndroidRuntime] at android.app.IntentService$ServiceHandler.handleMessage(IntentService.java:77)
[AndroidRuntime] at android.os.Handler.dispatchMessage(Handler.java:106)
[AndroidRuntime] at android.os.Looper.loopOnce(Looper.java:230)
[AndroidRuntime] at android.os.Looper.loop(Looper.java:319)
[AndroidRuntime] at android.os.HandlerThread.run(HandlerThread.java:67)

It says I am starting a Foreground Service without a type. Is this something I need to declare in the Manifest? I already have the ForeGround Service added in my Manifest, but it seems there has a been a change with Android 14 to need a type as well. Just wondering if anyone knows the exact type to add to fix this issue?

@ISSPRO-Eng
Copy link
Author

Anyone have updates?

@WanftMoon
Copy link

Anyone have updates?

if you don't need the foreground service, you can just disable it.

_dfuInstall.Start(new DfuConfiguration() { DisableNotification = true, Foreground = false });

@ISSPRO-Eng
Copy link
Author

ISSPRO-Eng commented Jul 29, 2024

Anyone have updates?

if you don't need the foreground service, you can just disable it.

_dfuInstall.Start(new DfuConfiguration() { DisableNotification = true, Foreground = false });

@WanftMoon
DfuConfiguration does not exist in the updated Nuget 1.27.82

@WanftMoon
Copy link

Anyone have updates?

if you don't need the foreground service, you can just disable it.

_dfuInstall.Start(new DfuConfiguration() { DisableNotification = true, Foreground = false });

@WanftMoon DfuConfiguration does not exist in the updated Nuget 1.27.82

yeah, you are correct, seems like they changed the lib's surface API. But looking at DFUInstallation, seems like the property is still available. So probably part of it.

have you tried setting it like?

DFUInstallation dfuInstall = new () { DisableNotification = true, Foreground = false } 

Screenshot 2024-07-29 at 17 25 35

@ISSPRO-Eng
Copy link
Author

Anyone have updates?

if you don't need the foreground service, you can just disable it.

_dfuInstall.Start(new DfuConfiguration() { DisableNotification = true, Foreground = false });

@WanftMoon DfuConfiguration does not exist in the updated Nuget 1.27.82

yeah, you are correct, seems like they changed the lib's surface API. But looking at DFUInstallation, seems like the property is still available. So probably part of it.

have you tried setting it like?

DFUInstallation dfuInstall = new () { DisableNotification = true, Foreground = false } 

Screenshot 2024-07-29 at 17 25 35

Yeah I have. I saw that it was still in there but can't find a way to access it currently. iOS all works fine with the updated nuget though which is a plus but now this issue has come up

@christian-strydom
Copy link

You can pack your own NuGet after making the same change as the PR that I put up a month ago, which would allow you to get around the issue until a new version of the nuget is released.

@ISSPRO-Eng
Copy link
Author

You can pack your own NuGet after making the same change as the PR that I put up a month ago, which would allow you to get around the issue until a new version of the nuget is released.

Didn't even see that, thanks!

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