Why location doesn't work in app with android 10? - java

I have an app which streams video and it ensure making photos from another device. It is saving location of device in photo information. It works correctly on older android versions for example 6.0 Unfortunately it doesn't work on android 10 even after updating an app to SDK 29. Do you have any ideas?
When I switch off gps in android 10 phone everything goes well.
Below errors from android studio:
E/i.aoiAgent11EN: Unknown bits set in runtime_flags: 0x8000
I/Perf: Connecting to perf service.
I/FeatureParser: can't find cepheus.xml in assets/device_features/,it may be in /system/etc/device_features
E/libc: Access denied finding property "ro.vendor.df.effect.conflict"
E/Perf: Fail to get file list pl.biz.aoi.aoiAgent11ENG
getFolderSize() : Exception_1 = java.lang.NullPointerException: Attempt to get length of null array
Fail to get file list pl.biz.aoi.aoiAgent11ENG
getFolderSize() : Exception_1 = java.lang.NullPointerException: Attempt to get length of null array
E/AudioPlayer: CPP is working
java.lang.IllegalStateException: Unable to retrieve AudioTrack pointer for getPosition()
at android.media.AudioTrack.native_get_position(Native Method)
at android.media.AudioTrack.getPlaybackHeadPosition(AudioTrack.java:1699)
at pl.biz.aoi.aoiAgent11ENG.media.in.audio.player.SpeakerOutputStream.getPlayed(SpeakerOutputStream.java:46)
at pl.biz.aoi.aoiAgent11ENG.media.in.audio.player.G711AudioPlayer.writeSilenceBufferIfNeeded(G711AudioPlayer.java:136)
at pl.biz.aoi.aoiAgent11ENG.media.in.audio.player.G711AudioPlayer.run(G711AudioPlayer.java:111)
at java.lang.Thread.run(Thread.java:919)
I/chatty: uid=10262(pl.biz.aoi.aoiAgent11ENG) identical 18 lines
E/AudioPlayer: CPP is working
java.lang.IllegalStateException: Unable to retrieve AudioTrack pointer for getPosition()
at android.media.AudioTrack.native_get_position(Native Method)
at android.media.AudioTrack.getPlaybackHeadPosition(AudioTrack.java:1699)
at pl.biz.aoi.aoiAgent11ENG.media.in.audio.player.SpeakerOutputStream.getPlayed(SpeakerOutputStream.java:46)
at pl.biz.aoi.aoiAgent11ENG.media.in.audio.player.G711AudioPlayer.writeSilenceBufferIfNeeded(G711AudioPlayer.java:136)
at pl.biz.aoi.aoiAgent11ENG.media.in.audio.player.G711AudioPlayer.run(G711AudioPlayer.java:111)
at java.lang.Thread.run(Thread.java:919)

Related

Android aab from playstore black screen . Unable to destroy activity {com./com..MainActivity}: java.lang.NullPointerException:

I Uploaded aab to playstore and when downloaded to devices i get ANR and black screens ..
logs from crashlytics
Unable to destroy activity {com./com..MainActivity}: java.lang.NullPointerException: Attempt to invoke virtual method 'void androidx.lifecycle.d.c(androidx.lifecycle.f)' on a null object reference
Fatal Exception: java.lang.RuntimeException: Unable to destroy
activity
{com.../com....MainActivity}:
java.lang.NullPointerException: Attempt to invoke virtual method 'void
androidx.lifecycle.d.c(androidx.lifecycle.f)' on a null object
reference
at android.app.ActivityThread.performDestroyActivity(ActivityThread.java:5567)
at android.app.ActivityThread.handleDestroyActivity(ActivityThread.java:5597)
at android.app.servertransaction.DestroyActivityItem.execute(DestroyActivityItem.java:44)
at android.app.servertransaction.TransactionExecutor.executeLifecycleState(TransactionExecutor.java:190)
at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:105)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2386)
at android.os.Handler.dispatchMessage(Handler.java:107)
at android.os.Looper.loop(Looper.java:213)
at android.app.ActivityThread.main(ActivityThread.java:8178)
at java.lang.reflect.Method.invoke(Method.java)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:513)
//
Caused by java.lang.NullPointerException
Attempt to invoke virtual method 'void androidx.lifecycle.d.c(androidx.lifecycle.f)' on a null object reference
Caused by java.lang.NullPointerException: Attempt to invoke virtual method 'void androidx.lifecycle.d.c(androidx.lifecycle.f)' on a null object reference
at com.mr.flutter.plugin.filepicker.FilePickerPlugin.tearDown(FilePickerPlugin.java:21)
at com.mr.flutter.plugin.filepicker.FilePickerPlugin.onDetachedFromActivity(FilePickerPlugin.java)
at io.flutter.embedding.engine.FlutterEnginePluginRegistry.detachFromActivity(FlutterEnginePluginRegistry.java:52)
at io.flutter.embedding.android.FlutterActivityAndFragmentDelegate.onDetach(FlutterActivityAndFragmentDelegate.java:58)
at io.flutter.embedding.android.FlutterActivity.onDestroy(FlutterActivity.java:10)
firebase
com.google.firebase.crashlytics.startup1
at sun.misc.Unsafe.park(Unsafe.java)
at java.util.concurrent.locks.LockSupport.park(LockSupport.java:190)
at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:2067)
at java.util.concurrent.LinkedBlockingQueue.take(LinkedBlockingQueue.java:442)
at java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1092)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1152)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
at com.google.firebase.crashlytics.internal.common.ExecutorUtils$1$1.onRun(ExecutorUtils.java:2)
at com.google.firebase.crashlytics.internal.common.BackgroundPriorityRunnable.run(BackgroundPriorityRunnable.java:5)
at java.lang.Thread.run(Thread.java:929)
pubscpec.yaml
firebase_core: ^0.7.0
# Newly reworked plugins covered by this migration guide:
firebase_auth: ^0.20.0+1
firebase_crashlytics: ^0.4.0+1
cloud_firestore: ^0.16.0
cloud_functions: ^0.9.0
firebase_storage: ^7.0.0
firebase_messaging: ^8.0.0-dev.14
firebase_remote_config: ^0.6.0
# Updated to work with new core only plugins (no new changes):
firebase_analytics: "^7.0.1"
firebase_database: "^6.0.0"
firebase_in_app_messaging: "^0.3.0+1"
firebase_performance: "^0.5.0+1"
file_picker: ^2.1.6
on running flutter build apk / flutter build app-bundle it builds
on runnign flutter build apk --split-per-abi
- Required org.gradle.usage 'java-api' and found compatible value 'java-runtime'.
- Required org.jetbrains.kotlin.platform.type 'androidJvm' but no value provided.
- Variant 'profileApiElements' capability io.flutter.plugins.firebase.crashlytics:firebase_crashlytics:1.0-SNAPSHOT:
- Incompatible attribute:
- Required com.android.build.api.attributes.BuildTypeAttr 'buildTypes' and found incompatible value 'profile'.
- Other attributes:
- Found com.android.build.api.attributes.VariantAttr 'profile' but wasn't required.
- Required com.android.build.gradle.internal.dependency.AndroidTypeAttr 'Aar' and found compatible value 'Aar'.
cant reproduce the error but there was something in the logs about not libapp.so error.
Fixed it by installing NDK(side by side) from android studio sdk manager

openVPN not working on Android 10 in androidstudio

hi i use this project in my app :
https://github.com/schwabe/ics-openvpn
and write a vpn application
its work fine on all android version because on android 10 i give this error on logcat :
2020-04-01 01:47:56.914 2540-2839/com.vpnfree.approid I/OpenVPN: Starting openvpn
2020-04-01 01:47:56.920 2540-2839/com.vpnfree.approid E/OpenVPN: OpenVPNThread Got java.lang.NullPointerException: Attempt to invoke virtual method 'void java.lang.Process.destroy()' on a null object reference
2020-04-01 01:47:56.920 2540-2839/com.packagename.approid E/level: LEVEL_NOTCONNECTED
2020-04-01 01:47:56.959 2540-2839/com.packagename.approid I/OpenVPN: Exiting
It's not working because when you call destroy(), you are calling it on a null object. This is throwing an NPE can preventing you from connecting.
This null pointer exception can be the result of process builder starting a new process by loading a binary from assets which is not supported by android.
You can confirm this case by using e.printStackTrace(); in catch clause near line 187 - line 188 of method private void startOpenVPNThreadArgs(String[] argv) which can be found in OpenVPNThread.java.
If you get error 13 in your log cat like this:
java.io.IOException: Cannot run program "...": error=13, Permission denied
Then you might be using older version of ics-openvpn. In this case please refer to this:
My answer to: "Creating VPN by using OpenVPN"
My comment on the "What change in API 29" issue in the schwabe /
ics-openvpn GitHub repository
I hope that this will resolve your issue.
android:extractNativeLibs="true"
tools:replace="android:extractNativeLibs"
Add This Two Lines In Your Manifest Application

Nativescript angular app breaking with "java.lang.IllegalStateException: Too many receivers, total of 1000, registered for pid"

I've creating a nativescript application which uses the nativescript-barcodescanner plugin to scan and decode qr codes. This application is intended to be used to scan a lot of qr codes, but not in consecutive order. However, after a 1000 scans, the application is breaking with the following exception.
java.lang.RuntimeException: Unable to resume activity {org.nativescript.test/com.google.zxing.client.android.CaptureActivity}: java.lang.IllegalStateException: Too many receivers, total of 1000, registered for pid: 15623, callerPackage: org.nativescript.test
at android.app.ActivityThread.performResumeActivity(ActivityThread.java:4021)
at android.app.ActivityThread.handleResumeActivity(ActivityThread.java:4053)
at android.app.servertransaction.ResumeActivityItem.execute(ResumeActivityItem.java:51)
at android.app.servertransaction.TransactionExecutor.executeLifecycleState(TransactionExecutor.java:145)
at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:70)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1955)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loop(Looper.java:214)
at android.app.ActivityThread.main(ActivityThread.java:7078)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:494)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:975)
Caused by: java.lang.IllegalStateException: Too many receivers, total of 1000, registered for pid: 15623, callerPackage: org.nativescript.test
at android.os.Parcel.createException(Parcel.java:1974)
at android.os.Parcel.readException(Parcel.java:19
// Allocate time for this cycle to end before issueing a validate request. Attempting to fix Fragment issue on some
// mobile devices34)
at android.os.Parcel.readException(Parcel.java:1884)
at android.app.IActivityManager$Stub$Proxy.registerReceiver(IActivityManager.java:3684)
at android.app.ContextImpl.registerReceiverInternal(ContextImpl.java:1567)
at android.app.ContextImpl.registerReceiver(ContextImpl.java:1528)
at android.app.ContextImpl.registerReceiver(ContextImpl.java:1516)
at android.content.ContextWrapper.registerReceiver(ContextWrapper.java:636)
at com.google.zxing.client.android.InactivityTimer.onResume(InactivityTimer.java:69)
at com.google.zxing.client.android.CaptureActivity.onResume(CaptureActivity.java:222)
at android.app.Instrumentation.callActivityOnResume(Instrumentation.java:1416)
at android.app.Activity.performResume(Activity.java:7609)
at android.app.ActivityThread.performResumeActivity(ActivityThread.java:4013)
... 11 more
Caused by: android.os.RemoteException: Remote stack trace:
at com.android.server.am.ActivityManagerService.registerReceiver(ActivityManagerService.java:25447)
at android.app.IActivityManager$Stub.onTransact$registerReceiver$(IActivityManager.java:10896)
at android.app.IActivityManager$Stub.onTransact(IActivityManager.java:126)
at com.android.server.am.ActivityManagerService.onTransact(ActivityManagerService.java:4162)
at android.os.Binder.execTransact(Binder.java:739)
After attempting to debug the issue, from what i've found, it seems that when calling the BarcodeScanner.scan function offered by the nativescript-barcodescanner plugin, an Activity is started for result as per this code, which in turn, a receiver is registered by the google zxing library (used by this plugin). What seems to be the issue is that upon a successful scan, when the Activity returns the result, the google zxing library is not doing the necessary clean ups, resulting with dangling receivers registered. Note that when the scanner is closed by pressing the back button, the clean ups are carried out as expected.
Any help about going around this issue would be appreciated.
Edit: Added link to github repo for reproduction
https://github.com/jeanpaulattard/nativescript-barcodescanner-demo

App crash while frequent requesting mediafile with exoplayer instances

I am getting this error why frequently try to tap exoplayer instances.
normally instances releases and nulls itself on everytime.
But after some tries app freezes and crashes. I am trying to find where is the problem related
2019-04-04 11:40:36.002 540-1196/? E/BufferQueueProducer: [com..app.musicplayer/com..app.musicplayer.dashboard.DashboardMusicActivity#0] dequeueBuffer: attempting to exceed the max dequeued buffer count (2)
2019-04-04 11:40:36.110 13761-15052/com..app.musicplayer E/NativeCrypto: AppData::create pipe(2) failed: Too many open files
2019-04-04 11:40:36.121 13761-15052/com..app.musicplayer E/AndroidRuntime: FATAL EXCEPTION: OkHttp Dispatcher
Process: com..app.musicplayer, PID: 13761
java.lang.RuntimeException: javax.net.ssl.SSLException: Unable to create application data
at com.android.org.conscrypt.ConscryptFileDescriptorSocket.newSsl(ConscryptFileDescriptorSocket.java:161)
at com.android.org.conscrypt.ConscryptFileDescriptorSocket.<init>(ConscryptFileDescriptorSocket.java:152)
at com.android.org.conscrypt.OpenSSLSocketFactoryImpl.createSocket(OpenSSLSocketFactoryImpl.java:149)
at okhttp3.internal.connection.RealConnection.connectTls(RealConnection.java:288

sinch video call camera permission problem with Android pei (9)

update
I am developing a small app which requires camera permission. I can handle the run time permission but the real problem is that when I relay to Sinchpayload and go to incomming call activity. This activity should request permissions (camera and other 2 permissions). But instead of showing the permission dialogue, it crash my app because of security exception. this thing happen only if I request camera permission - not happen to other permissions and only on Android 9 with camera "2" Api - Android 8.1 and lower works fine . THIS PROBLEM STILL HAPPEN WITH THE SINCH SAMPLE PUSH. The permission dialogue will show if start activity with intent as usual. This is the error :
-------- beginning of crash
2019-02-10 22:11:55.390 2113-2681/com.example.myapp.app E/AndroidRuntime: FATAL EXCEPTION: VideoCapturerThread
Process: com.example.myapp.app, PID: 2113
java.lang.SecurityException: validateClientPermissionsLocked:1054: Caller "com.example.myapp.app" (PID 10319, UID 2113) cannot open camera "1" without camera permission
at android.hardware.camera2.CameraManager.throwAsPublicException(CameraManager.java:747)
at android.hardware.camera2.CameraManager.openCameraDeviceUserAsync(CameraManager.java:405)
at android.hardware.camera2.CameraManager.openCameraForUid(CameraManager.java:567)
at android.hardware.camera2.CameraManager.openCamera(CameraManager.java:495)
at org.webrtc.Camera2Session.openCamera(Unknown Source:44)
at org.webrtc.Camera2Session.start(Unknown Source:60)
at org.webrtc.Camera2Session.<init>(Unknown Source:73)
at org.webrtc.Camera2Session.create(Unknown Source:17)
at org.webrtc.Camera2Capturer.createCameraSession(Unknown Source:17)
at org.webrtc.CameraCapturer$5.run(Unknown Source:52)
at android.os.Handler.handleCallback(Handler.java:891)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:207)
at android.os.HandlerThread.run(HandlerThread.java:65)
Caused by: android.os.ServiceSpecificException: validateClientPermissionsLocked:1054: Caller "com.example.myapp.app" (PID 10319, UID 2113) cannot open camera "1" without camera permission (code 1)
at android.os.Parcel.createException(Parcel.java:1967)
at android.os.Parcel.readException(Parcel.java:1921)
at android.os.Parcel.readException(Parcel.java:1871)
at android.hardware.ICameraService$Stub$Proxy.connectDevice(ICameraService.java:343)
at android.hardware.camera2.CameraManager.openCameraDeviceUserAsync(CameraManager.java:369)
at android.hardware.camera2.CameraManager.openCameraForUid(CameraManager.java:567) 
at android.hardware.camera2.CameraManager.openCamera(CameraManager.java:495) 
at org.webrtc.Camera2Session.openCamera(Unknown Source:44) 
at org.webrtc.Camera2Session.start(Unknown Source:60) 
at org.webrtc.Camera2Session.<init>(Unknown Source:73) 
at org.webrtc.Camera2Session.create(Unknown Source:17) 
at org.webrtc.Camera2Capturer.createCameraSession(Unknown Source:17) 
at org.webrtc.CameraCapturer$5.run(Unknown Source:52) 
at android.os.Handler.handleCallback(Handler.java:891) 
at android.os.Handler.dispatchMessage(Handler.java:102) 
at android.os.Looper.loop(Looper.java:207) 
at android.os.HandlerThread.run(HandlerThread.java:65)`
and this is my code to request permissions :
if (Build.VERSION.SDK_INT>=23)
{
if (GlobalConstants.isAllPermissionsGrantedBefore_Video_Call(this)==false)
ActivityCompat.requestPermissions(
Video_incomming_call.this,
GlobalConstants.mPermissions_Video_Chat,
GlobalConstants.VIDEO_RECIEVE_CODE);
else {
Start_Calling();
}
} else Start_Calling();
The app permission dialog only shows in foreground.

Categories

Resources