can someone help me to fix these errors. I added my app to the firebase and did test run. and I got these errors. I am new to android app development. I have no clear idea where should I start to fix these errors.
Fatal exception
android.os.FileUriExposedException: file:///storage/emulated/0/QR%20and%20Barcode/text.png exposed beyond app through ClipData.Item.getUri()
FATAL EXCEPTION: ControllerMessenger
Process: one.teqtoapps.barqr, PID: 9659
android.os.FileUriExposedException: file:///storage/emulated/0/QR%20and%20Barcode/text.png exposed beyond app through ClipData.Item.getUri()
at android.os.StrictMode.onFileUriExposed(StrictMode.java:1958)
at android.net.Uri.checkFileUriExposed(Uri.java:2348)
at android.content.ClipData.prepareToLeaveProcess(ClipData.java:941)
at android.content.Intent.prepareToLeaveProcess(Intent.java:9735)
at android.content.Intent.prepareToLeaveProcess(Intent.java:9741)
at android.content.Intent.prepareToLeaveProcess(Intent.java:9720)
at android.app.Instrumentation.execStartActivity(Instrumentation.java:1609)
at androidx.test.runner.MonitoringInstrumentation.execStartActivity(MonitoringInstrumentation.java:152)
at android.app.Activity.startActivityForResult(Activity.java:4472)
at android.support.v4.app.BaseFragmentActivityApi16.startActivityForResult(BaseFragmentActivityApi16.java:54)
at android.support.v4.app.FragmentActivity.startActivityForResult(FragmentActivity.java:68)
at android.app.Activity.startActivityForResult(Activity.java:4430)
at android.support.v4.app.FragmentActivity.startActivityForResult(FragmentActivity.java:751)
at android.app.Activity.startActivity(Activity.java:4791)
at android.app.Activity.startActivity(Activity.java:4759)
at one.teqtoapps.barqr.utility.AppUtils.share(AppUtils.java:83)
at one.teqtoapps.barqr.fragment.GenerateFragment$6.onSaved(GenerateFragment.java:183)
at one.teqtoapps.barqr.utility.SaveImage.onPostExecute(SaveImage.java:41)
at one.teqtoapps.barqr.utility.SaveImage.onPostExecute(SaveImage.java:16)
at android.os.AsyncTask.finish(AsyncTask.java:695)
at android.os.AsyncTask.-wrap1(Unknown Source:0)
at android.os.AsyncTask$InternalHandler.handleMessage(AsyncTask.java:712)
at android.os.Handler.dispatchMessage(Handler.java:105)
at androidx.test.espresso.base.Interrogator.a(Interrogator.java:19)
at androidx.test.espresso.base.UiControllerImpl.a(UiControllerImpl.java:142)
at androidx.test.espresso.base.UiControllerImpl.a(UiControllerImpl.java:96)
at androidx.test.espresso.base.UiControllerImpl.a(UiControllerImpl.java:37)
at androidx.test.espresso.action.MotionEvents.a(MotionEvents.java:74)
at androidx.test.espresso.action.MotionEvents.a(MotionEvents.java:52)
at androidx.test.espresso.action.Tap.c(Tap.java:9)
at androidx.test.espresso.action.Tap.a(Tap.java:19)
at androidx.test.espresso.action.Tap$1.b(Tap.java:2)
at androidx.test.espresso.action.GeneralClickAction.perform(GeneralClickAction.java:22)
at androidx.test.espresso.ViewInteraction$SingleExecutionViewAction.perform(ViewInteraction.java:9)
at androidx.test.espresso.ViewInteraction.a(ViewInteraction.java:78)
at androidx.test.espresso.ViewInteraction.a(ViewInteraction.java:94)
at androidx.test.espresso.ViewInteraction$1.call(ViewInteraction.java:3)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at android.os.Handler.handleCallback(Handler.java:789)
at android.os.Handler.dispatchMessage(Handler.java:98)
at android.os.Looper.loop(Looper.java:164)
at android.app.ActivityThread.main(ActivityThread.java:6541)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:240)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:767)
I got the same Crashes on some devices during Google Play test
I thought this will help you :
https://issuetracker.google.com/issues/113164874
In my case, it show in log
Failed to take screenshot: takeScreenshot returned null
copied 4 bytes
01-29 06:27:43.544: I/Robo(11035): --------- beginning of crash
01-29 06:27:43.545: E/AndroidRuntime(11035): FATAL EXCEPTION: ControllerMessenger
01-29 06:27:43.545: E/AndroidRuntime(11035): Process: PID: 11035
01-29 06:27:43.545: E/AndroidRuntime(11035): java.lang.NullPointerException: Attempt to invoke virtual method 'void android.graphics.Bitmap.recycle()' on a null object reference
because my screen has secure flag to take screen-shot and testing framework trying to take screen-shot that will return null and throwing NullPointerException on recycle.
For more help you can reply me here.
Related
when I create the app I receive the following error in the Logcat:
2020-01-27 16:45:34.247 20798-20798/com.example.mtcloseby E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.example.mtcloseby, PID: 20798
java.lang.NullPointerException: Attempt to invoke virtual method 'void com.google.android.gms.maps.GoogleMap.clear()' on a null object reference
at com.example.mtcloseby.MapsActivity.nearByPlace(MapsActivity.java:111)
at com.example.mtcloseby.MapsActivity.access$000(MapsActivity.java:40)
at com.example.mtcloseby.MapsActivity$1.onNavigationItemSelected(MapsActivity.java:89)
at com.google.android.material.bottomnavigation.BottomNavigationView$1.onMenuItemSelected(BottomNavigationView.java:243)
at androidx.appcompat.view.menu.MenuBuilder.dispatchMenuItemSelected(MenuBuilder.java:840)
at androidx.appcompat.view.menu.MenuItemImpl.invoke(MenuItemImpl.java:158)
at androidx.appcompat.view.menu.MenuBuilder.performItemAction(MenuBuilder.java:991)
at com.google.android.material.bottomnavigation.BottomNavigationMenuView$1.onClick(BottomNavigationMenuView.java:127)
at android.view.View.performClick(View.java:6313)
at android.view.View$PerformClick.run(View.java:24933)
at android.os.Handler.handleCallback(Handler.java:790)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:175)
at android.app.ActivityThread.main(ActivityThread.java:6724)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:438)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:810)
I have managed to fix it, the problem was I was using SupportMapFragment and it should be MapFragment
I integrate react-native-code-push to my RN project. But when I installed the update, the APP was crashed. Here is the source code.
2018-10-30 11:26:52.274 14122-14122/com.example.jason.rnandroid E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.example.jason.rnandroid, PID: 14122
java.lang.AssertionError: recreateReactContextInBackground should only be called after the initial createReactContextInBackground call.
at com.facebook.infer.annotation.Assertions.assertCondition(Assertions.java:72)
at com.facebook.react.ReactInstanceManager.recreateReactContextInBackground(ReactInstanceManager.java:339)
at com.microsoft.codepush.react.CodePushNativeModule$2.run(CodePushNativeModule.java:151)
at android.os.Handler.handleCallback(Handler.java:789)
at android.os.Handler.dispatchMessage(Handler.java:98)
at android.os.Looper.loop(Looper.java:164)
at android.app.ActivityThread.main(ActivityThread.java:6541)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:240)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:767)
I don't know how to solve this problem, can anyone help?
I´m developing an app that reads the gyroscope and generates a graph with its values. I already did it using the accelerometer (Sensor.TYPE_ACCELEROMETER) and it did fine, but when I use the gyroscope(Sensor.TYPE_GYROSCOPE), the app closes.
I´m using SDK 16, and looking into the class the type_gyroscope is marked as deprecated, but I tried the SDK 21 and continued having the same problem. Does someone know what is happening?
LogCat:
10-05 02:10:58.117 3934-3934/com.smartapps.accel E/SensorManager: sensor or listener is null
10-05 02:11:00.700 3934-3934/com.smartapps.accel D/AndroidRuntime: Shutting down VM --------- beginning of crash
10-05 02:11:00.703 3934-3934/com.smartapps.accel E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.smartapps.accel, PID: 3934
java.lang.IndexOutOfBoundsException: Index: 0, Size: 0
at java.util.ArrayList.get(ArrayList.java:437)
at com.smartapps.accel.MainActivity.openChart(MainActivity.java:114)
at com.smartapps.accel.MainActivity.onClick(MainActivity.java:103)
at android.view.View.performClick(View.java:6256)
at android.view.View$PerformClick.run(View.java:24697)
at android.os.Handler.handleCallback(Handler.java:789)
at android.os.Handler.dispatchMessage(Handler.java:98)
at android.os.Looper.loop(Looper.java:164)
at android.app.ActivityThread.main(ActivityThread.java:6541)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:240)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:767)
The Google Play Developer Console shows me the following Pre-Launch-Report, for the Galaxy S6, after uploading the APK. The other nine devices, which Google uses to test the APK, have no error.
The provided stacktrace shows none of my code lines. How can I figure out, whether this is a real problem, and how can I fix it, if it is not based on my code?
Developer Console output:
Problem: java.lang.NullPointerException: Attempt to read from field 'java.lang.String android.accounts.Account.type' on a null object reference
FATAL EXCEPTION: main
Process: com.google.android.videos, PID: 28537
java.lang.NullPointerException: Attempt to read from field 'java.lang.String android.accounts.Account.type' on a null object reference
at android.os.Parcel.readException(Parcel.java:1552)
at android.os.Parcel.readException(Parcel.java:1499)
at com.android.vending.contentfilters.IContentFiltersService$Stub$Proxy.getContentFiltersAndIntent(SourceFile:139)
at com.google.android.videos.contentfiltering.ContentFiltersManager.saveContentFiltersToPreference(SourceFile:438)
at com.google.android.videos.contentfiltering.ContentFiltersManager.access$100(SourceFile:81)
at com.google.android.videos.contentfiltering.ContentFiltersManager$1.onServiceConnected(SourceFile:423)
at android.app.LoadedApk$ServiceDispatcher.doConnected(LoadedApk.java:1314)
at android.app.LoadedApk$ServiceDispatcher$RunConnection.run(LoadedApk.java:1331)
at android.os.Handler.handleCallback(Handler.java:739)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:145)
at android.app.ActivityThread.main(ActivityThread.java:6837)
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:372)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1404)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1199)
Is this normal? Why do I get this error only for the Galaxy S6?
I am trying to build an android application with chromecast.
I use MediaRouter to select chromecast devices but there are some error messages when I select and unselect many times.
For example, I select chromecast device, load media, play media then unselect. When I try to load the media at 4th or 5th, the error message show up.
There is the error message.
E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.kevin.chromecasttest, PID: 1066
java.lang.RuntimeException: Unable to create service com.google.android.gms.cast.framework.media.MediaNotificationService: java.lang.NullPointerException: Attempt to invoke interface method 'android.os.IBinder ani.asBinder()' on a null object reference
at android.app.ActivityThread.handleCreateService(ActivityThread.java:2909)
at android.app.ActivityThread.access$2000(ActivityThread.java:150)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1440)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:148)
at android.app.ActivityThread.main(ActivityThread.java:5444)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:746)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:636)
Caused by: java.lang.NullPointerException: Attempt to invoke interface method 'android.os.IBinder ani.asBinder()' on a null object reference
at anl.a(:com.google.android.gms.DynamiteModulesC:47)
at com.google.android.gms.cast.framework.internal.CastDynamiteModuleImpl.newMediaNotificationServiceImpl(:com.google.android.gms.DynamiteModulesC:72)
at aap.onTransact(:com.google.android.gms.DynamiteModulesC:121)
at android.os.Binder.transact(Binder.java:387)
at com.google.android.gms.internal.zzoj$zza$zza.zza(Unknown Source)
at com.google.android.gms.internal.zzog.zza(Unknown Source)
at com.google.android.gms.cast.framework.media.MediaNotificationService.onCreate(Unknown Source)
at android.app.ActivityThread.handleCreateService(ActivityThread.java:2899)
at android.app.ActivityThread.access$2000(ActivityThread.java:150)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1440)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:148)
at android.app.ActivityThread.main(ActivityThread.java:5444)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:746)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:636)
Thanks in advance for your answers!