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)
Related
I'm trying to get url from firebase and give it to mediaplayer.setDataSource but I get an err says :- `
java.lang.IllegalStateException
at android.media.MediaPlayer._setDataSource(Native Method)
at android.media.MediaPlayer.setDataSource(MediaPlayer.java:991)
at android.media.MediaPlayer.setDataSource(MediaPlayer.java:944)
at mks.master.musest.home$onCreateView$16$1$1.onDataChange(home.kt:425)
at com.firebase.client.core.ValueEventRegistration.fireEvent(ValueEventRegistration.java:45)
at com.firebase.client.core.view.DataEvent.fire(DataEvent.java:45)
at com.firebase.client.core.view.EventRaiser$1.run(EventRaiser.java:38)
at android.os.Handler.handleCallback(Handler.java:733)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:136)
at android.app.ActivityThread.main(ActivityThread.java:5019)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:515)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:779)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:595)
at dalvik.system.NativeStart.main(Native Method)
`
here is my code :-
`var mediaplayer:MediaPlayeria
mediaplayer=MediaPlayer()
firebase= Firebase(link+"song2song")
firebase.addValueEventListener(object:ValueEventListener{
override fun onCancelled(p0: FirebaseError?) {
}
override fun onDataChange(p0: DataSnapshot) {
mediaplayer.setDataSource(p0.getValue(String()::class.java))
mediaplayer.prepareAsync()
}
})`
and the main err is in this part mediaplayer.setDataSource(p0.getValue(String()::class.java))
You should call reset() before calling setDataSource().
Look at the following state diagram in Android reference, it gives you a clear vision of the different states of MediaPlayer
Also This table shows that setDataSource() can be executed from Idle state only.
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
I know that TransactionTooLargeException occurs when there is a large amount of data being transferred between services in the system. Usually, I would have some kind of control if I were to transfer large amount of data, but in this case, when I'm appying a wallpaper, I don't have that amount of control.
I'm applying a wallpaper by first cropping it with android-image-cropper, and then applying it by
WallpaperManager.setBitmap(bitmap);
...in a separate thread, to avoid overloading the UI thread. Now, when I press "apply wallpaper", and wait for some time, and then return to the homescreen, it works flawlessly, but when I apply the wallpaper and then immediately return to the homescreen, I get the alert that the app has crashed, along with this log:
07-31 18:50:41.611 32720-32720/elementary.elementarywallpapers E/JavaBinder: !!! FAILED BINDER TRANSACTION !!! (parcel size = 16385936)
07-31 18:50:41.614 32720-32720/elementary.elementarywallpapers D/AndroidRuntime: Shutting down VM
07-31 18:50:41.621 32720-32720/elementary.elementarywallpapers E/AndroidRuntime: FATAL EXCEPTION: main
Process: elementary.elementarywallpapers, PID: 32720
java.lang.RuntimeException: android.os.TransactionTooLargeException: data parcel size 16385936 bytes
at android.app.ActivityThread$StopInfo.run(ActivityThread.java:3752)
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:6077)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:865)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:755)
Caused by: android.os.TransactionTooLargeException: data parcel size 16385936 bytes
at android.os.BinderProxy.transactNative(Native Method)
at android.os.BinderProxy.transact(Binder.java:615)
at android.app.ActivityManagerProxy.activityStopped(ActivityManagerNative.java:3606)
at android.app.ActivityThread$StopInfo.run(ActivityThread.java:3744)
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:6077)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:865)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:755)
How can I fix this?
This question already has answers here:
What is a NullPointerException, and how do I fix it?
(12 answers)
Closed 6 years ago.
Hey guys so when I hit this particular button it is supposed to take me to the another layout. However everytime i hit it, the entire app crashes. Here is the onCreate method for that page im trying to get to:
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_bench_data_entry);
//opens the database
openDB();
//Initializes and declares the sensors, and accelerometer
mInitialized = false;
mSensorManager = (SensorManager) getSystemService(Context.SENSOR_SERVICE);
mAccelerometer = mSensorManager.getDefaultSensor(Sensor.TYPE_ACCELEROMETER);
mSensorManager.registerListener(this, mAccelerometer, SensorManager.SENSOR_DELAY_NORMAL);
// tv.setText("Aasfdaf");
}
Here is the onClick for the button I am pressing:
public void onClick_Bench(View v){
//Intent to create a new activity
Intent intent = new Intent(MainMenuActivity.this, BenchDataEntry.class);
//Goes to the Data Entry Screen
startActivity(intent);
}
and here is the error log I am getting when I press the button:
08-08 17:30:30.785 31113-31113/com.example.jacob.repcapture E/AndroidRuntime﹕ FATAL EXCEPTION: main
Process: com.example.jacob.repcapture, PID: 31113
java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{com.example.jacob.repcapture/com.example.jacob.repcapture.BenchDataEntry}: java.lang.NullPointerException: Attempt to invoke virtual method 'android.view.View android.view.Window.findViewById(int)' on a null object reference
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2327)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2476)
at android.app.ActivityThread.-wrap11(ActivityThread.java)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1344)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:148)
at android.app.ActivityThread.main(ActivityThread.java:5422)
at java.lang.reflect.Method.invoke(Native Method)
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.NullPointerException: Attempt to invoke virtual method 'android.view.View android.view.Window.findViewById(int)' on a null object reference
at android.app.Activity.findViewById(Activity.java:2096)
at com.example.jacob.repcapture.BenchDataEntry.<init>(BenchDataEntry.java:49)
at java.lang.Class.newInstance(Native Method)
at android.app.Instrumentation.newActivity(Instrumentation.java:1067)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2317)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2476)
at android.app.ActivityThread.-wrap11(ActivityThread.java)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1344)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:148)
at android.app.ActivityThread.main(ActivityThread.java:5422)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
I think error not in these code blocks logcat about android.view.View android.view.Window.findViewById(int)' on a null object reference
First - do clean project under build-menu, and restart the emulator. After that the exception went away in my situation.
Second - check FindviewById items You need to initialize them in the onCreate too.
Using
wifiManager.startScan();
ScanResultsList scanresultsList = wifiManager.getScanResults();
I obtain a list of scan results defined by ScanResult objects.
Problem:
Refering to scanResult.channelWidth I am presented with an error:
scanResult.channelWidth = No such instance field: 'channelWidth'
and
Exception
java.lang.NoSuchFieldError: No instance field channelWidth of type I
in class Landroid/net/wifi/ScanResult; or its superclasses
(declaration of 'android.net.wifi.ScanResult' appears in
/system/framework/framework.jar)
Stacktrace:
06-14 02:57:19.732 27116-27116/com.cynetstudios.frequencyselector E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.cynetstudios.frequencyselector, PID: 27116
java.lang.NoSuchFieldError: No instance field channelWidth of type I in class Landroid/net/wifi/ScanResult; or its superclasses (declaration of 'android.net.wifi.ScanResult' appears in /system/framework/framework.jar)
at com.cynetstudios.frequencyselector.main.initWiFiArrays(main.java:161)
at com.cynetstudios.frequencyselector.main.access$000(main.java:35)
at com.cynetstudios.frequencyselector.main$1$1.run(main.java:115)
at android.os.Handler.handleCallback(Handler.java:739)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:135)
at android.app.ActivityThread.main(ActivityThread.java:5291)
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:904)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:699)
I require this int value for further processing,
what is causing this no instance field?
This may be useful,check this link
https://developer.android.com/reference/android/net/wifi/ScanResult.html>