I'm trying to implement camera2api provided by google with this link
https://github.com/googlesamples/android-Camera2Video
Everything works fine but after after stoping the video the app crashes on mediarecorder.stop()
I'm using Xiaomi 4A
Logcat:
4-21 23:37:42.189 20375-20375/? E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.example.android.camera2video, PID: 20375
java.lang.RuntimeException: stop failed.
at android.media.MediaRecorder.stop(Native Method)
at com.example.android.camera2video.Camera2VideoFragment.stopRecordingVideo(Camera2VideoFragment.java:687)
at com.example.android.camera2video.Camera2VideoFragment.onClick(Camera2VideoFragment.java:314)
at android.view.View.performClick(View.java:5207)
at android.view.View$PerformClick.run(View.java:21177)
at android.os.Handler.handleCallback(Handler.java:739)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:148)
at android.app.ActivityThread.main(ActivityThread.java:5441)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:738)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:628)
I was using the same link and it was crashing on mediarecorder.onStop() on my Xiaomi 4A and it was giving IllegalStateException but code was working perfectly fine with other devices.
I solved the issue by simply updating my device using miui updater.
Related
i have an a simple app that takes a picture for sending it over to a server. The app works fine and all, but for some strange and unknown reasons it always crashes on LG-G6 devices in testing by google.
The pre launch report crash logs always points to following code which is setting FOCUS mode.
I have tried all flash modes yet the app crashes.
if(getPackageManager().hasSystemFeature(PackageManager.FEATURE_CAMERA_AUTOFOCUS)) {
parameters.setFocusMode(Camera.Parameters.FOCUS_MODE_CONTINUOUS_PICTURE);
camera.setParameters(parameters); //line 328
}
Following is the excerpt from crash log
FATAL EXCEPTION: ControllerMessenger Process:
com.localgsa.HcadPublicA, PID: 11403 java.lang.RuntimeException:
setParameters failed at
android.hardware.Camera.native_setParameters(Native Method) at
android.hardware.Camera.setParameters(Camera.java:2034) at
com.localgsa.hcad.activities.license_capture.LicenseFrontCaptureActivity.surfaceChanged(LicenseFrontCaptureActivity.java:328)
at android.view.SurfaceView.updateWindow(SurfaceView.java:646) at
android.view.SurfaceView$3.onPreDraw(SurfaceView.java:162) at
android.view.ViewTreeObserver.dispatchOnPreDraw(ViewTreeObserver.java:944)
at
android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:2288)
at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1306) at
android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:6579)
at
android.view.Choreographer$CallbackRecord.run(Choreographer.java:871)
at android.view.Choreographer.doCallbacks(Choreographer.java:683) at
android.view.Choreographer.doFrame(Choreographer.java:619) at
android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:857)
at android.os.Handler.handleCallback(Handler.java:751) at
android.os.Handler.dispatchMessage(Handler.java:95) at
androidx.test.espresso.base.Interrogator.a(Interrogator.java:19) at
androidx.test.espresso.base.UiControllerImpl.a(UiControllerImpl.java:164)
at
androidx.test.espresso.base.UiControllerImpl.a(UiControllerImpl.java:156)
at
androidx.test.espresso.base.UiControllerImpl.a(UiControllerImpl.java:34)
at androidx.test.espresso.action.MotionEvents.a(MotionEvents.java:75)
at androidx.test.espresso.action.MotionEvents.a(MotionEvents.java:50)
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:237) 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:6316) at
java.lang.reflect.Method.invoke(Native Method) at
com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:872)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:762)
Can anyone provide me with some insight? This issue has been pestering me for a while.
P.S i don't have a physical LG G6 device with me. I have tested the app on a slightly older LG device and the app ran fine.
I released my app to google play and i'm actually with 700 daily active users, i'm trying to fix the crashes that appear but there is one very weird crash
Fatal Exception: java.lang.RuntimeException: Error receiving broadcast Intent { act=android.hardware.usb.action.USB_DEVICE_DETACHED flg=0x10 pkg=com.tomatedigital.instagramgiveawaywinner } in org.chromium.media.AudioManagerAndroid$5#a283c54
at android.app.LoadedApk$ReceiverDispatcher$Args.run(LoadedApk.java:891)
at android.os.Handler.handleCallback(Handler.java:739)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:148)
at android.app.ActivityThread.main(ActivityThread.java:5420)
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.NullPointerException: Attempt to invoke virtual method 'int android.hardware.usb.UsbDevice.getInterfaceCount()' on a null object reference
at org.chromium.media.AudioManagerAndroid.hasUsbAudioCommInterface(AudioManagerAndroid.java:1224)
at org.chromium.media.AudioManagerAndroid.access$1200(AudioManagerAndroid.java:43)
at org.chromium.media.AudioManagerAndroid$5.onReceive(AudioManagerAndroid.java:1254)
at android.app.LoadedApk$ReceiverDispatcher$Args.run(LoadedApk.java:881)
at android.os.Handler.handleCallback(Handler.java:739)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:148)
at android.app.ActivityThread.main(ActivityThread.java:5420)
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)
This error appears to happen only on one specific hardware what is:
Device
Brand: LGE
Model: Nexus 4
Orientation: Portrait
RAM free: 1.12 GB
Disk free: 690.85 MB
Operating System
Version: 6.0.1
Orientation: Portrait
Rooted: No
So over 700 daily users and over 2k weekly users but only this specific hardware is generating this error
My app doesn't have any straight usage of chromium or any media stuff, so i believe this error is happening during an ad video from admob
can someone help me to fix it, or at least catch the exception and show a friendly message to the user?
Getting following error:
FATAL EXCEPTION: main
Process: com.SocialMob.Txme, PID: 29963
java.lang.UnsatisfiedLinkError: No implementation found for void
org.telegram.messenger.voip.VoIPController.nativeSetAudioOutputGainControlEnabled(long,
boolean) (tried
Java_org_telegram_messenger_voip_VoIPController_nativeSetAudioOutputGainControlEnabled
and
Java_org_telegram_messenger_voip_VoIPController_nativeSetAudioOutputGainControlEnabled__JZ)
at org.telegram.messenger.voip.VoIPController.nativeSetAudioOutputGainControlEnabled(Native
Method)
at org.telegram.messenger.voip.VoIPController.setAudioOutputGainControlEnabled(VoIPController.java:244)
at org.telegram.messenger.voip.VoIPBaseService.updateOutputGainControlState(VoIPBaseService.java:691)
at org.telegram.messenger.voip.VoIPBaseService.configureDeviceForCall(VoIPBaseService.java:445)
at org.telegram.messenger.voip.VoIPService.startOutgoingCall(VoIPService.java:200)
at org.telegram.messenger.voip.VoIPService.access$100(VoIPService.java:64)
at org.telegram.messenger.voip.VoIPService$1.run(VoIPService.java:127)
at android.os.Handler.handleCallback(Handler.java:746)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:148)
at android.app.ActivityThread.main(ActivityThread.java:5459)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:728)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618)
One of the libraries of the telegram was updated and was not mentioned on the source code page.
By updating library https://github.com/grishka/libtgvoip, and cleaning my project made my app working fine
recently (past few weeks maybe) most of the android 6 users of my app started to suffer from crashes. UnityPlayerActivity failed to start with exception logged: android.app.Fragment$InstantiationException.
Stack trace:
java.lang.RuntimeException:
android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2450)
android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2510)
android.app.ActivityThread.-wrap11(ActivityThread.java:0)
android.app.ActivityThread$H.handleMessage(ActivityThread.java:1363)
android.os.Handler.dispatchMessage(Handler.java:102)
android.os.Looper.loop(Looper.java:148)
android.app.ActivityThread.main(ActivityThread.java:5461)
java.lang.reflect.Method.invoke(Native Method:0)
com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
Caused by: android.app.Fragment$InstantiationException:
android.app.Fragment.instantiate(Fragment.java:628)
android.app.FragmentState.instantiate(Fragment.java:106)
android.app.FragmentManagerImpl.restoreAllState(FragmentManager.java:1858)
android.app.FragmentController.restoreAllState(FragmentController.java:122)
android.app.Activity.onCreate(Activity.java:918)
com.unity3d.player.UnityPlayerActivity.onCreate(Unknown Source:0)
android.app.Activity.performCreate(Activity.java:6251)
android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1108)
android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2403)
Initially my first thought was permissions problem but I can't reproduce this error on any of my android 6 devices even if I deny permission (WRITE_EXTERNAL_STORAGE).
Is there is any workaround for this problem(if this problem is a common for Unity on Android 6)?
Thanks in advance!
PS:
Unity version 5.5.0f3,
Android version from crush reports 6.0
I'm trying to integrate MonkeyTalk automation into my pre-existing Android app that is built using gradle.
I followed the steps here: Android Studio and MonkeyTalk? and got the demo app working, but when I run it in my own application I get the following crash on the second screen. Any idea why this happens?
This particular stack trace is using L preview targeting SDK 19, but I've also seen a similar (less detailed) stack trace on a Galaxy S4 with SDK 18 on it.
07-21 15:35:18.394 14642-14642/com.example.android.debug E/AndroidRuntime﹕ FATAL EXCEPTION: main
Process: com.example.android.debug, PID: 14642
java.lang.VerifyError: Rejecting class com.example.android.activity.main.MainActivity because it failed compile-time verification (declaration of 'com.example.android.activity.main.MainActivity' appears in /data/app/com.example.android.debug-1.apk)
at java.lang.reflect.Constructor.newInstance(Native Method)
at java.lang.Class.newInstance(Class.java:1572)
at android.app.Instrumentation.newActivity(Instrumentation.java:1062)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2157)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2317)
at android.app.ActivityThread.access$800(ActivityThread.java:143)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1258)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:135)
at android.app.ActivityThread.main(ActivityThread.java:5070)
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:836)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:631)
Any idea what this means? I'm using Dagger for dependency injection, is that why it might not work?
You can try the latest version of the monkeytalk and i guess your problem will not occur again.