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

bug: App Update Android - API level 33 getPackageInfo(String, int) deprecated #131

Closed
3 of 21 tasks
co-dax opened this issue Jan 31, 2024 · 6 comments · Fixed by #135
Closed
3 of 21 tasks

bug: App Update Android - API level 33 getPackageInfo(String, int) deprecated #131

co-dax opened this issue Jan 31, 2024 · 6 comments · Fixed by #135
Labels
bug/fix Something isn't working package: app-update
Milestone

Comments

@co-dax
Copy link
Contributor

co-dax commented Jan 31, 2024

Plugin(s)

  • Android Foreground Service
  • Android Battery Optimization
  • App Update
  • Background Task
  • Badge
  • Cloudinary
  • Datetime Picker
  • File Compressor
  • File Opener
  • File Picker
  • Managed Configurations
  • NFC
  • Photo Editor
  • Printer
  • Screen Orientation

Version

5.0.1

Platform(s)

  • Android
  • iOS
  • Web

Current behavior

@robingenz - I noticed getPackageInfo(packageName, 0); form the this line of code return this.getContext().getPackageManager().getPackageInfo(packageName, 0); has to been updated to reflect deprecation note for API 33 as per this SO issue https://stackoverflow.com/questions/73388061/android-13-sdk-33-packagemanager-getpackageinfostring-int-deprecated-what.

Am I missing something?

Thanks.

Expected behavior

...

Reproduction

...

Steps to reproduce

...

Other information

...

Capacitor doctor

...

Before submitting

  • I have read and followed the bug report guidelines.
  • I have attached links to possibly related issues and discussions.
  • I understand that incomplete issues (e.g. without reproduction) are closed.
@co-dax co-dax added bug/fix Something isn't working needs: triage labels Jan 31, 2024
@robingenz robingenz added this to the v6.0.0 milestone Jan 31, 2024
@robingenz
Copy link
Member

Thank you for reporting this. PRs are welcome.

co-dax added a commit to co-dax/capacitor-plugins that referenced this issue Feb 1, 2024
@co-dax
Copy link
Contributor Author

co-dax commented Feb 1, 2024

I made the change but how can I can test Android plugin code within Android Studio like hitting a breakpoint. I don't have experience with Capacitor plugin development.

Thanks!

@robingenz
Copy link
Member

@co-dax
Copy link
Contributor Author

co-dax commented Feb 3, 2024

Thanks @robingenz.

I made the change, tested it on a physical Anroid API level < 33 and it works but I got the error failed to bind to the service when trying to test on API 33 on emulator which is a known issue. I don't have an API > 33 Android physical device. What would be your suggestion, how do we test it? Do you perhaps have an Android api level >= 33?

@robingenz
Copy link
Member

Feel free to create a PR. I will then take a look at it.

@co-dax
Copy link
Contributor Author

co-dax commented Feb 3, 2024

I have created a pull request. Let me know please.

co-dax added a commit to co-dax/capacitor-plugins that referenced this issue Feb 4, 2024
robingenz added a commit that referenced this issue Feb 5, 2024
* #33 PackageManager.getPackageInfo(packageName, 0) is deprecated as of API 33: Android 13.0 (Tiramisu).
#131

* #33 PackageManager.getPackageInfo(packageName, 0) is deprecated as of API 33: Android 13.0 (Tiramisu).
#131

* docs: add changeset

---------

Co-authored-by: Robin Genz <[email protected]>
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 2, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug/fix Something isn't working package: app-update
Projects
None yet
2 participants