Getting NullPointerException at onFilterTouchEventForSecurity - java

I have built app in which I integrate YouTube API and it is working fine without any crash but on Fabric I checked some crash whis is ipf.onFilterTouchEventForSecurity. Here is the full logs of the crash:
java.lang.NullPointerException:
at ipf.onFilterTouchEventForSecurity(ipf.java:115)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2351)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2844)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2461)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2844)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2461)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2844)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2461)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2876)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2461)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2844)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2519)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2844)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2519)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2844)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2519)
at com.android.internal.policy.PhoneWindow$DecorView.superDispatchTouchEvent(PhoneWindow.java:2840)
at com.android.internal.policy.PhoneWindow.superDispatchTouchEvent(PhoneWindow.java:1853)
at android.app.Activity.dispatchTouchEvent(Activity.java:3061)
at com.android.internal.policy.PhoneWindow$DecorView.dispatchTouchEvent(PhoneWindow.java:2801)
at android.view.View.dispatchPointerEvent(View.java:10246)
at android.view.ViewRootImpl$ViewPostImeInputStage.processPointerEvent(ViewRootImpl.java:5447)
at android.view.ViewRootImpl$ViewPostImeInputStage.onProcess(ViewRootImpl.java:5283)
at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:4721)
at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:4774)
at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:4740)
at android.view.ViewRootImpl$AsyncInputStage.forward(ViewRootImpl.java:4882)
at android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:4748)
at android.view.ViewRootImpl$AsyncInputStage.apply(ViewRootImpl.java:4939)
at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:4721)
at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:4774)
at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:4740)
at android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:4748)
at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:4721)
at android.view.ViewRootImpl.deliverInputEvent(ViewRootImpl.java:7429)
at android.view.ViewRootImpl.doProcessInputEvents(ViewRootImpl.java:7298)
at android.view.ViewRootImpl.enqueueInputEvent(ViewRootImpl.java:7259)
at android.view.ViewRootImpl$WindowInputEventReceiver.onInputEvent(ViewRootImpl.java:7539)
at android.view.InputEventReceiver.dispatchInputEvent(InputEventReceiver.java:185)
at android.os.MessageQueue.nativePollOnce(MessageQueue.java:0)
at android.os.MessageQueue.next(MessageQueue.java:323)
at android.os.Looper.loop(Looper.java:135)
at android.app.ActivityThread.main(ActivityThread.java:7325)
at java.lang.reflect.Method.invoke(Method.java:0)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1230)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1120)
I know that this issue is not because of code but I need to prevent crashing.
Here is list of devices on which I am facing issue:
Samsung Galaxy J7 (j7elte), 1536MB RAM, Android 6.0
Xiaomi Redmi Note 3 (kenzo), 2048MB RAM, Android 6.0
Lenovo TB3-710F (TB3-710F), 1024MB RAM, Android 5.0
Xiaomi Redmi 3S (land), 2048MB RAM, Android 6.0
LeTV Le 2 (le_s2_ww), 3072MB RAM, Android 6.0
LGE LG Stylus2 4G (ph2), 2048MB RAM, Android 6.0
Infocus M2_3G (G10), 10124MB RAM, Android 4.4

I am not able to reproduce it but there are several things you can try:
If possible try adding android:filterTouchesWhenObscured=false as pellucide suggested from the docs:
Specifies whether to filter touches when the view's window is obscured
by another visible window. When set to true, the view will not receive
touches whenever a toast, dialog or other window appears above the
view's window. Refer to the View security documentation for more
details.
May be a boolean value, such as "true" or "false".
Otherwise, you can try overriding the dispatch method of your root view and place a try catch there, you can use it as a custom Component if needed.
#Override
void dispatchTouchEvent(MotionEvent event){
try{
super.dispatchTouchEvent(event);
}
catch (Exception e){
e.printStackTrace();
}
}

Related

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

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)

Failed to allocate memory from loading jpg files - Android studio Erro

I have a function in my app that adds offline pictures that are stored inside the app's memory to a listview.
The code is extremely simple as you can see:
if(FirstTag != null) {
if (FirstTag.equals("care"))
imageView.setImageDrawable(context.getApplicationContext().getResources().getDrawable(R.drawable.care));
else if (FirstTag.equals("holidays"))
imageView.setImageDrawable(context.getApplicationContext().getResources().getDrawable(R.drawable.holidays));
else if (FirstTag.equals("Thing Different"))
imageView.setImageDrawable(context.getApplicationContext().getResources().getDrawable(R.drawable.thinkdifferent2));
else if (FirstTag.equals("Fun Activities"))
imageView.setImageDrawable(context.getApplicationContext().getResources().getDrawable(R.drawable.fun));
else if (FirstTag.equals("מערך חברות")) }
it simply checks a value in a json object and put a picture in the listview by this value, of course there are 20 values and not 5, but I didn't think I should Include all...
All the pictures are compressed, and when I don't load many of them the app doesn't crash.
But when I try to launch the app with a picture per each item in the listview, everything seems to work perfectly fine, and then when you scroll down the app lags and in a second it crashes with the following error:
9-30 18:35:18.299 7859-7859/com.example.negev.peulibraryv201 E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.example.negev.peulibraryv201, PID: 7859
java.lang.OutOfMemoryError: Failed to allocate a 681099532 byte allocation with 16777216 free bytes and 261MB until OOM
at dalvik.system.VMRuntime.newNonMovableArray(Native Method)
at android.graphics.BitmapFactory.nativeDecodeAsset(Native Method)
at android.graphics.BitmapFactory.decodeStream(BitmapFactory.java:700)
at android.graphics.BitmapFactory.decodeResourceStream(BitmapFactory.java:535)
at android.graphics.drawable.Drawable.createFromResourceStream(Drawable.java:1179)
at android.content.res.ResourcesImpl.loadDrawableForCookie(ResourcesImpl.java:770)
at android.content.res.ResourcesImpl.loadDrawable(ResourcesImpl.java:621)
at android.content.res.Resources.getDrawable(Resources.java:1640)
at android.content.res.Resources.getDrawable(Resources.java:1611)
at com.example.negev.peulibraryv201.GamesLibraryAdapter.getView(GamesLibraryAdapter.java:70)
at android.widget.AbsListView.obtainView(AbsListView.java:3238)
at android.widget.ListView.makeAndAddView(ListView.java:2147)
at android.widget.ListView.fillDown(ListView.java:767)
at android.widget.ListView.fillGap(ListView.java:731)
at android.widget.AbsListView.trackMotionScroll(AbsListView.java:8292)
at android.widget.ListView.trackMotionScroll(ListView.java:2065)
at android.widget.AbsListView$FlingRunnable.run(AbsListView.java:7719)
at android.view.Choreographer$CallbackRecord.run(Choreographer.java:927)
at android.view.Choreographer.doCallbacks(Choreographer.java:702)
at android.view.Choreographer.doFrame(Choreographer.java:635)
at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:913)
at android.os.Handler.handleCallback(Handler.java:751)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:154)
at android.app.ActivityThread.main(ActivityThread.java:6682)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1520)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1410)
I already added those line to my manifest:
android:hardwareAccelerated="false"
android:largeHeap="true"
and it didn't work, wht do you think I can do?
Thank you!
What you should do is load the data dynamically as it becomes visible on the screen.
Since this is hard work Google already did it for you.
You need to use an ArrayAdapter with the list view and let Andriod ask you for more data when it is needed.
Its too much code to explain in detail but have a look at this Goolge I/O video.
There are many tutorials on the web that explains how to do that in detail.
Have a look here.

Android media.AudioTrack.finalize Throwing IllegalStateException: Binder has been finalized

I am using a custom camera to record Videos on android.
The device experiencing the issue is a Nexus 5 with Android 6.0.1 on it.
When the camera finishes recording for only for the 2nd time, i get the following exception in the under-the-hood android media AudioTrack class. This is something that is called implicitly by android, by the FinalizerDaemon, and not as a result of any code I execute directly. So the FinalizerDaemon calls finalize on AudioTrack, and gets an IllegalStateException.
12-02 09:20:23.155 23705-23714/social.ivideo.greetings E/System: Uncaught exception thrown by finalizer
12-02 09:20:23.160 23705-23714/social.ivideo.greetings E/System: java.lang.IllegalStateException: Binder has been finalized!
at android.os.BinderProxy.transactNative(Native Method)
at android.os.BinderProxy.transact(Binder.java:615)
at com.android.internal.app.IAppOpsService$Stub$Proxy.stopWatchingMode(IAppOpsService.java:435)
at android.media.PlayerBase.baseRelease(PlayerBase.java:136)
at android.media.AudioTrack.finalize(AudioTrack.java:979)
at java.lang.Daemons$FinalizerDaemon.doFinalize(Daemons.java:222)
at java.lang.Daemons$FinalizerDaemon.run(Daemons.java:209)
at java.lang.Thread.run(Thread.java:761)
Perhaps I need to do some sort of clean up when the camera finishes recording? Here's the current code I'm using when the recording stops:
#Override
public void stopRecording(boolean wasCancelled, float duration) {
if (mMediaRecorder != null) {
mMediaRecorder.stop();
mMediaRecorder.reset();
if (flashState) {
toggleFlash();
}
if (!wasCancelled) {
callbacks.onFinishedRecording(null, mediaPath, duration, wasCancelled);
}
}
}
mMediaRecorder is an instance of MediaRecorder class.
Any suggestions?
So I think this might be an Android bug. Looks suspiciously like this issue, which is marked as fixed in a "future version": https://issuetracker.google.com/issues/37138597
Same Issue Reported in Android 7.1.2
fixed in Android 8.0 https://android.googlesource.com/platform/frameworks/base/+log/aee6ee94675d56e71a42d52b16b8d8e5fa6ea3ff/media/java/android/media/PlayerBase.java

Android app crashing java.lang.NoSuchMethodError

I am getting crash on this activity when I run the app. This is not due to appcompat as you can see in the stack trace. This is native android ListView class whose method is not found while running the app.
The same app is running properly on other devices. The minSdkVersion = 13 target =23 max =23 and current device of crashing is API 17.
FATAL EXCEPTION: main
java.lang.NoSuchMethodError: android.widget.ListView.setElevation
at com.example.saloni.laughgurumarketingapp.ContentDetails.getValues(ContentDetails.java: 392)
at com.example.saloni.laughgurumarketingapp.ContentDetails.onCreate(ContentDetails.java: 298)
at android.app.Activity.performCreate(Activity.java: 5122)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java: 1081)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java: 2270)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java: 2358)
at android.app.ActivityThread.access$600(ActivityThread.java: 156)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java: 1340)
at android.os.Handler.dispatchMessage(Handler.java: 99)
at android.os.Looper.loop(Looper.java: 153)
at android.app.ActivityThread.main(ActivityThread.java: 5297)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java: 511)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java: 833)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java: 600)
at dalvik.system.NativeStart.main(Native Method)
In the code it's just a set elevation method on which it is crashing as you can see in the trace. Similarly it crashed last time on using one of the TextView class method. Why is this happening?
There is no setElevation() method in api 17. You need to only call this on api 21 and higher.
https://developer.android.com/reference/android/view/View.html#setElevation(float)
If you want to call this method on api 21 devices do this:
int currentapiVersion = android.os.Build.VERSION.SDK_INT;
if (currentapiVersion >= android.os.Build.VERSION_CODES.LOLLIPOP){
// Do something for lollipop and above versions
} else{
// do something for phones running an SDK before lollipop
}
You can use ViewCompat.setElevation and your app won't crash on pre-21 systems; however it won't have any effect on those older devices either.

Opengl es 2.0 live wallpaper on Nexus 7 (2012)

I'm developing a live wallpaper in android with opengl es 2.0. Started code is enter link description here. I want to reload textures on onSurfaceChanged method of renderer linked to wallpaper (and GLSurfaceView). On my Nexus 7 (2012) with tegra 3, when i try to do this, sometimes i obtain the following error:
08-11 03:54:41.128: D/NvOsDebugPrintf(26131): NvRmChannelSubmit: NvError_IoctlFailed with error code 1
08-11 03:54:41.130: D/NvOsDebugPrintf(26131): NvRmChannelSubmit failed (err = 1, SyncPointValue = 19952985, returning = 0)
08-11 03:54:41.130: D/NvOsDebugPrintf(26131): NvRmChannelSubmit failed (err = 196623, SyncPointValue = 0)
Is anybody got the same problem?

Categories

Resources