Facing this crash on Nexus 5X on aws amplify - java

Fatal Exception: java.lang.NullPointerException: Attempt to invoke virtual method 'java.util.List d.c.g.m.g()' on a null object reference
at com.amplifyframework.devmenu.DeveloperMenu.getLogs(DeveloperMenu.java:2)
at com.amplifyframework.devmenu.DevMenuLogsFragment.onCreateView(DevMenuLogsFragment.java:31)
at androidx.fragment.app.Fragment.performCreateView(Fragment.java:15)
at androidx.fragment.app.FragmentStateManager.createView(FragmentStateManager.java:16)
at androidx.fragment.app.FragmentManager.moveToState(FragmentManager.java:16)
at androidx.fragment.app.FragmentManager.addAddedFragments(FragmentManager.java:37)
at androidx.fragment.app.FragmentManager.executeOpsTogether(FragmentManager.java:8)
at androidx.fragment.app.FragmentManager.removeRedundantOperationsAndExecute(FragmentManager.java:94)
at androidx.fragment.app.FragmentManager.execPendingActions(FragmentManager.java:4)
at androidx.fragment.app.FragmentManager$4.run(FragmentManager.java:3)
at android.os.Handler.handleCallback(Handler.java:790)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:164)
at android.app.ActivityThread.main(ActivityThread.java:6494)
at java.lang.reflect.Method.invoke(Method.java)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:438)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:807)

Related

app crashes when try to get text from clipboard (Android 12)

I want to get the primary text on my clipboard and would like to know how to do that in newer android versions.
This code works perfectly when I tested it in an emulator running Android Pie, but the app crashes when I use it on my Phone running android 12.1.
please help me with this.
clipboard = (ClipboardManager) getSystemService(Context.CLIPBOARD_SERVICE);
if (clipboard.hasPrimaryClip())
clipItem = clipboard.getPrimaryClip().getItemAt(0);
clipText = clipItem.getText().toString();
Details.setText(clipItem.getText().toString());
Here's the Error I got from Logcat
2022-10-01 19:23:27.595 1349-5125 ClipboardService pid-1349 E Denying clipboard access to com.jery.tachisyrpc, the application is not in focus nor is it a system service for user 0
2022-10-01 19:23:27.595 8222-8222 AndroidRuntime com.jery.tachisyrpc D Shutting down VM
2022-10-01 19:23:27.596 8222-8222 AndroidRuntime com.jery.tachisyrpc E FATAL EXCEPTION: main
Process: com.jery.tachisyrpc, PID: 8222
java.lang.RuntimeException: Unable to start activity ComponentInfo{com.jery.tachisyrpc/com.jery.tachisyrpc.MainActivity}: java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.CharSequence android.content.ClipData$Item.getText()' on a null object reference at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:4111) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:4277) at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:103)at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:135) at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:95) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2443) at android.os.Handler.dispatchMessage(Handler.java:106) at android.os.Looper.loopOnce(Looper.java:226) at android.os.Looper.loop(Looper.java:313)
at android.app.ActivityThread.main(ActivityThread.java:8751)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:571)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1135)
Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.CharSequence android.content.ClipData$Item.getText()' on a null object reference
at com.jery.tachisyrpc.MainActivity.onCreate(MainActivity.java:55)
at android.app.Activity.performCreate(Activity.java:8290)
at android.app.Activity.performCreate(Activity.java:8270)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1329)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:4085)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:4277) 
at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:103) 
at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:135) 
at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:95) 
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2443) 
at android.os.Handler.dispatchMessage(Handler.java:106) 
at android.os.Looper.loopOnce(Looper.java:226) 
at android.os.Looper.loop(Looper.java:313) 
at android.app.ActivityThread.main(ActivityThread.java:8751) 
at java.lang.reflect.Method.invoke(Native Method) 
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:571) 
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1135)

Why is my intent not working when it doesn't show any syntax error? [duplicate]

This question already has answers here:
What is a NullPointerException, and how do I fix it?
(12 answers)
Closed 1 year ago.
The function called to switch activity is
public void GoToLogIn(View v){
Intent goToLogIn = new Intent(MainActivity.this,LogInActivity.class);
startActivity(goToLogIn);
finish();
}
This segment of code is showing error on logcat:
2021-08-21 12:43:33.396 9644-9644/com.example.expenditurehandlingapplication E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.example.expenditurehandlingapplication, PID: 9644
java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{com.example.expenditurehandlingapplication/com.example.expenditurehandlingapplication.LogInActivity}: java.lang.NullPointerException: Attempt to invoke virtual method 'android.content.pm.ApplicationInfo android.content.Context.getApplicationInfo()' on a null object reference
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2679)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2856)
at android.app.ActivityThread.-wrap11(Unknown Source:0)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1589)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loop(Looper.java:164)
at android.app.ActivityThread.main(ActivityThread.java:6494)
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:807)
Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'android.content.pm.ApplicationInfo android.content.Context.getApplicationInfo()' on a null object reference
at android.content.ContextWrapper.getApplicationInfo(ContextWrapper.java:152)
at android.view.ContextThemeWrapper.getTheme(ContextThemeWrapper.java:157)
at android.content.Context.obtainStyledAttributes(Context.java:655)
at androidx.appcompat.app.AppCompatDelegateImpl.createSubDecor(AppCompatDelegateImpl.java:842)
at androidx.appcompat.app.AppCompatDelegateImpl.ensureSubDecor(AppCompatDelegateImpl.java:809)
at androidx.appcompat.app.AppCompatDelegateImpl.findViewById(AppCompatDelegateImpl.java:633)
at androidx.appcompat.app.AppCompatActivity.findViewById(AppCompatActivity.java:259)
at com.example.expenditurehandlingapplication.LogInActivity.<init>(LogInActivity.java:10)
at java.lang.Class.newInstance(Native Method)
at android.app.Instrumentation.newActivity(Instrumentation.java:1174)
I have given the proper class name, but the app still stops working at this point. Can anyone please tell me what did i do wrong in this?
Are you sure that you added all activities to Manifest file?

'android.os.Looper.quit()' on a null object reference - Android O

First Activity of my Application starts a STICKY sevice that I'm using for creating notifications. Recently I've noticed a bug on Android O devices: when user starts an Application and then after a few seconds application was in background state the user gets this excpetion:
FATAL EXCEPTION: main
Process: com.callcatcher.callcatcher, PID: 27566
java.lang.RuntimeException: Unable to stop service callcatcher.call.com.callcatcher.NotificationService#e5b03d1: java.lang.NullPointerException: Attempt to invoke virtual method 'void android.os.Looper.quit()' on a null object reference
at android.app.ActivityThread.handleStopService(ActivityThread.java:3563)
at android.app.ActivityThread.-wrap26(Unknown Source:0)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1721)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loop(Looper.java:171)
at android.app.ActivityThread.main(ActivityThread.java:6633)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:547)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:823)
Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'void android.os.Looper.quit()' on a null object reference
at android.app.IntentService.onDestroy(IntentService.java:147)
at callcatcher.call.com.callcatcher.NotificationService.onDestroy(NotificationService.java:94)
at android.app.ActivityThread.handleStopService(ActivityThread.java:3541)
at android.app.ActivityThread.-wrap26(Unknown Source:0) 
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1721) 
at android.os.Handler.dispatchMessage(Handler.java:106) 
at android.os.Looper.loop(Looper.java:171) 
at android.app.ActivityThread.main(ActivityThread.java:6633) 
at java.lang.reflect.Method.invoke(Native Method) 
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:547) 
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:823) 
Still not sure about the reason of exception, but I just switched from IntentService to Service and now it works fine.

Binder invocation to an incorrect interface

I tried to build android app for android box. In my scenario my app need to stream live TV channels by using HDMI input.Why am I getting this kind of exception?
Any help to slow this error would be highly appreciated!
Thank you!
Fatal Exception: java.lang.RuntimeException: Unable to start activity ComponentInfo{eu.danman.zidostreamer.zidostreamer/eu.danman.zidostreamer.zidostreamer.MainActivity}: java.lang.SecurityException: Binder invocation to an incorrect interface
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2417)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2477)
at android.app.ActivityThread.-wrap11(ActivityThread.java)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1345)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:148)
at android.app.ActivityThread.main(ActivityThread.java:5458)
at java.lang.reflect.Method.invoke(Method.java)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
Caused by java.lang.SecurityException: Binder invocation to an incorrect interface
at android.os.Parcel.readException(Parcel.java:1620)
at android.os.Parcel.readException(Parcel.java:1573)
at com.mstar.android.tv.ITvService$Stub$Proxy.getTvCommon(ITvService.java:365)
at com.mstar.android.tv.TvManager.getTvCommon(TvManager.java:205)
at com.mstar.android.tv.TvCommonManager.getService(TvCommonManager.java:136)
at com.mstar.android.tv.TvCommonManager.getCurrentInputSource(TvCommonManager.java:166)
at eu.danman.zidostreamer.zidostreamer.MainActivity.changeInputSource(MainActivity.java:49)
at eu.danman.zidostreamer.zidostreamer.MainActivity.enableHDMI(MainActivity.java:69)
at eu.danman.zidostreamer.zidostreamer.MainActivity.onCreate(MainActivity.java:89)
at android.app.Activity.performCreate(Activity.java:6251)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1107)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2370)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2477)
at android.app.ActivityThread.-wrap11(ActivityThread.java)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1345)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:148)
at android.app.ActivityThread.main(ActivityThread.java:5458)
at java.lang.reflect.Method.invoke(Method.java)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)

android page transition laybrary integration null pointer exception

Hello everyone i've got this error a nullPointerException error after i tried to integrate the android-page-transition and i couldn't find it's cause
this is the code where the error is shown PS: it's the same exact caude in the library i just integrated the code into mywork
/**
* Réglage Menu immersive title
*/
private void dealStatusBar() {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
int statusBarHeight = getStatusBarHeight();
ViewGroup.LayoutParams lp = positionView.getLayoutParams();
lp.height = statusBarHeight;
positionView.setLayoutParams(lp);
}
}
this is the error i get when i run
11-19 12:11:30.781 16089-16089/mobile.esprit.tn.mobileteam E/AndroidRuntime: FATAL EXCEPTION: main
Process: mobile.esprit.tn.mobileteam, PID: 16089
java.lang.RuntimeException: Unable to start activity ComponentInfo{mobile.esprit.tn.mobileteam/mobile.esprit.tn.mobileteam.Activities.Project.PrjectsCardViews}: java.lang.NullPointerException: Attempt to invoke virtual method 'android.view.ViewGroup$LayoutParams android.view.View.getLayoutParams()' on a null object reference
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2693)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2758)
at android.app.ActivityThread.access$900(ActivityThread.java:177)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1448)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:145)
at android.app.ActivityThread.main(ActivityThread.java:5942)
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:1400)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1195)
Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'android.view.ViewGroup$LayoutParams android.view.View.getLayoutParams()' on a null object reference
at mobile.esprit.tn.mobileteam.Activities.Project.PrjectsCardViews.dealStatusBar(PrjectsCardViews.java:129)
at mobile.esprit.tn.mobileteam.Activities.Project.PrjectsCardViews.onCreate(PrjectsCardViews.java:54)
at android.app.Activity.performCreate(Activity.java:6289)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1119)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2646)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2758) 
at android.app.ActivityThread.access$900(ActivityThread.java:177) 
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1448) 
at android.os.Handler.dispatchMessage(Handler.java:102) 
at android.os.Looper.loop(Looper.java:145) 
at android.app.ActivityThread.main(ActivityThread.java:5942) 
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:1400) 
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1195) 
the PrjectsCardViews.java:129 is the code i posted above
ok i found the problem it was a dump fault caused by the copy and paste , i dident refere the oncreate to the necessary activity layout
You might have copied the projet but you may forgotten to change
<com.stone.transition.DragLayout
android:id="#+id/drag_layout" when you merged the code in your project check this out it will work

Categories

Resources