Cap-go / capacitor-updater

Instant updates for Capacitor Ship updates, fixes, changes, and features within minutes
https://capgo.app
Mozilla Public License 2.0
504 stars 105 forks source link

bug: Error after updating to Android API level 34 #409

Closed gonnavis closed 3 weeks ago

gonnavis commented 1 month ago

Bug Report

Due to Google Play Console message:

Issue details
Summary
Status: You won't be able to release app updates (46 days away)
Date sent: Jul 4, 2024
Deadline: Aug 31, 2024
Violation: App must target Android 14 (API level 34) or higher
Details:
To provide users with a safe and secure experience, Google Play requires all apps to meet target API level requirements.
From Aug 31, 2024, if your target API level is not within 1 year of the latest Android release, you won't be able to update your app.

I have to update to SDK 34.

But after changing compileSdkVersion and targetSdkVersion to 34, I got the following error in Android Studio when building:

FATAL EXCEPTION: main
java.lang.RuntimeException: Unable to resume activity: java.lang.SecurityException: One of RECEIVER_EXPORTED or RECEIVER_NOT_EXPORTED should be specified when a receiver isn't being registered exclusively for system broadcasts

My own code is not using BroadcastReceiver and found only Cap-go/capacitor-updater of my dependencies using it. Could you fix it?

Capacitor Version

% npx cap doctor
πŸ’Š   Capacitor Doctor  πŸ’Š 

Latest Dependencies:

  @capacitor/cli: unknown
  @capacitor/core: unknown
  @capacitor/android: unknown
  @capacitor/ios: unknown

Installed Dependencies:

  @capacitor/ios: not installed
  @capacitor/cli: 5.7.6
  @capacitor/core: 5.7.6
  @capacitor/android: 5.7.6

[success] Android looking great! πŸ‘Œ

Plugin Version

●   πŸ’Š   Capgo Doctor  πŸ’Š
β”‚  
β”‚
●   OS: darwin Darwin Kernel Version 23.1.0: Mon Oct  9 21:32:11 PDT 2023; root:xnu-10002.41.9~7/RELEASE_ARM64_T6030
β”‚  
β”‚
●   Node: v20.11.0
β”‚  
β”‚
●   Installed Dependencies:
β”‚  
β”‚
●     @capgo/cli: 4.12.12
β”‚
●  
β”‚  
β”‚
β—‡  Latest Dependencies:
β”‚
●     @capgo/cli: 4.12.12
β”‚
β—†  βœ… All dependencies are up to date

context(s)

ManualModel: true
AutoMode: false
CapgoCloud: false
OnPremise: false

Platform(s)

Android

Current Behavior

Bug info pasted on top.

Expected Behavior

Successfully build in Android Stuido.

Code Reproduction

Other Technical Details

npm --version output: 10.2.4

node --version output: v20.11.0

pod --version output (iOS issues only):

Additional Context

keyurboss commented 1 month ago

It has simple Solution

keyurboss commented 1 month ago

Fixed on Master Branch here https://github.com/Cap-go/capacitor-updater/blob/3d2f7224c2859d3fc2aab251f9bc36e6447819be/android/src/main/java/ee/forgr/capacitor_updater/CapacitorUpdater.java#L250

gonnavis commented 1 month ago

@keyurboss Thanks! I found the fixing on the main branch. But looks like it's only on v6 releases. Don't know why I'm on v10. And tried that there's no this fixing on v5.9.5 release. I'm using Capacitor v5, can't install capgo v6. Could you help to release a new v5 version with this fixing?

image
riderx commented 3 weeks ago

Upgrade to capacitor v6. V5 is not made to have targetSDK 34. V6 is exactly made to switch to targetSDK 34: https://capacitorjs.com/docs/updating/6-0 The upgrade is otherwise unnoticeable.

riderx commented 3 weeks ago

Also, don't use updater v10 this was an issue with our CI/CD who created many fake major versions.

gonnavis commented 3 weeks ago

Got it, thanks!