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

deprecated PackageManager.getPackageInfo(String, int) causing crashes in android 13 devices. #77

Open
vrnDhmn opened this issue Apr 5, 2023 · 2 comments

Comments

@vrnDhmn
Copy link

vrnDhmn commented Apr 5, 2023

ERROR:

Attempt to read from field 'java.lang.String android.content.pm.PackageInfo.versionName' on a null object reference in method 'void net.mikehardy.rnupdateapk.RNUpdateAPK.getApkInfo(java.lang.String, com.facebook.react.bridge.Promise)'

Stacktrace

RNUpdateAPK.java:113 net.mikehardy.rnupdateapk.RNUpdateAPK.getApkInfo
Method.java:-2 java.lang.reflect.Method.invoke
JavaMethodWrapper.java:372 com.facebook.react.bridge.JavaMethodWrapper.invoke
JavaModuleWrapper.java:188 com.facebook.react.bridge.JavaModuleWrapper.invoke
NativeRunnable.java:-2 com.facebook.react.bridge.queue.NativeRunnable.run
Handler.java:942 android.os.Handler.handleCallback
Handler.java:99 android.os.Handler.dispatchMessage
MessageQueueThreadHandler.java:27 com.facebook.react.bridge.queue.MessageQueueThreadHandler.dispatchMessage
Looper.java:240 android.os.Looper.loopOnce
Looper.java:351 android.os.Looper.loop
MessageQueueThreadImpl.java:226 com.facebook.react.bridge.queue.MessageQueueThreadImpl$4.run
Thread.java:1012 java.lang.Thread.run
node_modules/react-native/Libraries/BatchedBridge/NativeModules.js:106:59 promiseMethodWrapper
node_modules/rn-update-apk/index.js:127:30 anonymous
/tmp/hermes/staging/hermes/cmake/intlRelease/arm64-v8a/lib/InternalBytecode/InternalBytecode.js:53:16 tryCallOne
/tmp/hermes/staging/hermes/cmake/intlRelease/arm64-v8a/lib/InternalBytecode/InternalBytecode.js:139:27 anonymous
(native) apply
node_modules/react-native/Libraries/Core/Timers/JSTimers.js:248:22 anonymous
node_modules/react-native/Libraries/Core/Timers/JSTimers.js:112:14 _callTimer
node_modules/react-native/Libraries/Core/Timers/JSTimers.js:166:14 _callReactNativeMicrotasksPass
node_modules/react-native/Libraries/Core/Timers/JSTimers.js:418:41 callReactNativeMicrotasks
node_modules/react-native/Libraries/BatchedBridge/MessageQueue.js:393:41 __callReactNativeMicrotasks
node_modules/react-native/Libraries/BatchedBridge/MessageQueue.js:135:38 anonymous
node_modules/react-native/Libraries/BatchedBridge/MessageQueue.js:370:10 __guard
node_modules/react-native/Libraries/BatchedBridge/MessageQueue.js:134:16 flushedQueue
node_modules/react-native/Libraries/BatchedBridge/MessageQueue.js:130:28 invokeCallbackAndReturnFlushedQueue

Devices

Coming to 200 of our users mostly on android 13
Screenshot 2023-04-05 at 4 01 38 PM
Screenshot 2023-04-05 at 4 03 24 PM

Links

https://stackoverflow.com/questions/73388061/android-13-sdk-33-packagemanager-getpackageinfostring-int-deprecated-what
Baseflow/flutter-permission-handler#851 (comment)

@mikehardy
Copy link
Owner

Happy to accept PRs and merge + release them, I haven't gotten around to building with API33 yet for the one app I have that uses this, so it is not a priority for me at the moment.

@mikehardy
Copy link
Owner

My main device, where I use this feature in my app, is still Android 11 so I haven't seen this

You can thumbs down my comment about needing PRs all you want but THIS IS OPEN SOURCE

It is not "Hey, the whole internet should create free software for me and I don't have to do anything"

You'll have to check your sense of expectation and entitlement and do some work sometimes if you need features

And you certainly should not be thumbs-downing and upset with maintainers who don't do all your work for you for free!

Amazing

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

2 participants