问题描述
我收到此崩溃时,我在Android版本4.2.1播放视频videoView。我发现了这一点,特别是福邦帆布A210设备上。它不表示将错误发生的任何消息。这是一个错误或一些错误的应用程序吗?崩溃日志如下:
11月9号至十八日:05:53.245:E / AndroidRuntime(2323):致命异常:主要
十一月九号至18日:05:53.245:E / AndroidRuntime(2323):java.lang.StringIndexOutOfBoundsException:长度= 11; regionStart = 0; regionLength = -1
十一月九号至18日:05:53.245:E / AndroidRuntime(2323):在java.lang.String.startEndAndLength(String.java:583)
十一月九号至18日:05:53.245:E / AndroidRuntime(2323):在java.lang.String.substring(String.java:1464)
十一月九号至18日:05:53.245:E / AndroidRuntime(2323):在android.widget.VideoView.openVideo(VideoView.java:407)
十一月九号至18日:05:53.245:E / AndroidRuntime(2323):在android.widget.VideoView $ 6.surfaceCreated(VideoView.java:730)
十一月九号至18日:05:53.245:E / AndroidRuntime(2323):在android.view.SurfaceView.updateWindow(SurfaceView.java:606)
十一月九号至18日:05:53.245:E / AndroidRuntime(2323):在android.view.SurfaceView.access $ 000(SurfaceView.java:88)
十一月九号至18日:05:53.245:E / AndroidRuntime(2323):在android.view.SurfaceView $ 3.on preDraw(SurfaceView.java:183)
十一月九号至18日:05:53.245:E / AndroidRuntime(2323):在android.view.ViewTreeObserver.dispatchOn preDraw(ViewTreeObserver.java:692)
十一月九号至18日:05:53.245:E / AndroidRuntime(2323):在android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:2123)
十一月九号至18日:05:53.245:E / AndroidRuntime(2323):在android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1139)
十一月九号至18日:05:53.245:E / AndroidRuntime(2323):在android.view.ViewRootImpl $ TraversalRunnable.run(ViewRootImpl.java:4879)
十一月九号至18日:05:53.245:E / AndroidRuntime(2323):在android.view.Choreographer $ CallbackRecord.run(Choreographer.java:776)
十一月九号至18日:05:53.245:E / AndroidRuntime(2323):在android.view.Choreographer.doCallbacks(Choreographer.java:579)
十一月九号至18日:05:53.245:E / AndroidRuntime(2323):在android.view.Choreographer.doFrame(Choreographer.java:548)
十一月九号至18日:05:53.245:E / AndroidRuntime(2323):在android.view.Choreographer $ FrameDisplayEventReceiver.run(Choreographer.java:762)
十一月九号至18日:05:53.245:E / AndroidRuntime(2323):在android.os.Handler.handleCallback(Handler.java:725)
十一月九号至18日:05:53.245:E / AndroidRuntime(2323):在android.os.Handler.dispatchMessage(Handler.java:92)
十一月九号至18日:05:53.245:E / AndroidRuntime(2323):在android.os.Looper.loop(Looper.java:153)
十一月九号至18日:05:53.245:E / AndroidRuntime(2323):在android.app.ActivityThread.main(ActivityThread.java:5297)
十一月九号至18日:05:53.245:E / AndroidRuntime(2323):在java.lang.reflect.Method.invokeNative(本机方法)
十一月九号至18日:05:53.245:E / AndroidRuntime(2323):在java.lang.reflect.Method.invoke(Method.java:511)
十一月九号至18日:05:53.245:E / AndroidRuntime(2323):在com.android.internal.os.ZygoteInit $ MethodAndArgsCaller.run(ZygoteInit.java:833)
十一月九号至18日:05:53.245:E / AndroidRuntime(2323):在com.android.internal.os.ZygoteInit.main(ZygoteInit.java:600)
十一月九号至18日:05:53.245:E / AndroidRuntime(2323):在dalvik.system.NativeStart.main(本机方法)
这是我测试我的应用程序,并运行良好其他版本和设备有:
的Android版本:4.1.2,4.2.2,4.3,2.3.3,4.0.3,4.0.4
设备:三星Galaxy S2,三星Galaxy Tab 2(7和10),三星Galaxy S另外,索尼Xperia TIPO双,三星Galaxy盛大(夸和兆)的Nexus 4
您是开发人员,并在你的应用程序使用视频查看。如果是这样的尝试调试和验证您提供一个有效的URI / URL的视频查看。虽然有是android.widget.VideoView类在openVideo空检查(),该URI可以是空字符串。
<一个href="http://grep$c$c.com/file/repository.grep$c$c.com/java/ext/com.google.android/android/4.2.1_r1.2/android/widget/VideoView.java#VideoView.openVideo%28%29"相对=nofollow>这是你提到的Android版本的视频查看类的源。
I am getting this crash when I play video on videoView in Android version 4.2.1. I found this out specifically on Micromax Canvas A210 device. It is not showing any message where the error is occurring. Is this a bug or something wrong in application? The crash log is as below:
09-18 11:05:53.245: E/AndroidRuntime(2323): FATAL EXCEPTION: main
09-18 11:05:53.245: E/AndroidRuntime(2323): java.lang.StringIndexOutOfBoundsException: length=11; regionStart=0; regionLength=-1
09-18 11:05:53.245: E/AndroidRuntime(2323): at java.lang.String.startEndAndLength(String.java:583)
09-18 11:05:53.245: E/AndroidRuntime(2323): at java.lang.String.substring(String.java:1464)
09-18 11:05:53.245: E/AndroidRuntime(2323): at android.widget.VideoView.openVideo(VideoView.java:407)
09-18 11:05:53.245: E/AndroidRuntime(2323): at android.widget.VideoView$6.surfaceCreated(VideoView.java:730)
09-18 11:05:53.245: E/AndroidRuntime(2323): at android.view.SurfaceView.updateWindow(SurfaceView.java:606)
09-18 11:05:53.245: E/AndroidRuntime(2323): at android.view.SurfaceView.access$000(SurfaceView.java:88)
09-18 11:05:53.245: E/AndroidRuntime(2323): at android.view.SurfaceView$3.onPreDraw(SurfaceView.java:183)
09-18 11:05:53.245: E/AndroidRuntime(2323): at android.view.ViewTreeObserver.dispatchOnPreDraw(ViewTreeObserver.java:692)
09-18 11:05:53.245: E/AndroidRuntime(2323): at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:2123)
09-18 11:05:53.245: E/AndroidRuntime(2323): at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1139)
09-18 11:05:53.245: E/AndroidRuntime(2323): at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:4879)
09-18 11:05:53.245: E/AndroidRuntime(2323): at android.view.Choreographer$CallbackRecord.run(Choreographer.java:776)
09-18 11:05:53.245: E/AndroidRuntime(2323): at android.view.Choreographer.doCallbacks(Choreographer.java:579)
09-18 11:05:53.245: E/AndroidRuntime(2323): at android.view.Choreographer.doFrame(Choreographer.java:548)
09-18 11:05:53.245: E/AndroidRuntime(2323): at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:762)
09-18 11:05:53.245: E/AndroidRuntime(2323): at android.os.Handler.handleCallback(Handler.java:725)
09-18 11:05:53.245: E/AndroidRuntime(2323): at android.os.Handler.dispatchMessage(Handler.java:92)
09-18 11:05:53.245: E/AndroidRuntime(2323): at android.os.Looper.loop(Looper.java:153)
09-18 11:05:53.245: E/AndroidRuntime(2323): at android.app.ActivityThread.main(ActivityThread.java:5297)
09-18 11:05:53.245: E/AndroidRuntime(2323): at java.lang.reflect.Method.invokeNative(Native Method)
09-18 11:05:53.245: E/AndroidRuntime(2323): at java.lang.reflect.Method.invoke(Method.java:511)
09-18 11:05:53.245: E/AndroidRuntime(2323): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:833)
09-18 11:05:53.245: E/AndroidRuntime(2323): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:600)
09-18 11:05:53.245: E/AndroidRuntime(2323): at dalvik.system.NativeStart.main(Native Method)
Other versions and devices that I have tested my app on and is working fine are:
Android versions: 4.1.2, 4.2.2, 4.3, 2.3.3, 4.0.3, 4.0.4
Devices: Samsung Galaxy s2, Samsung Galaxy Tab 2 (7" and 10"), Samsung Galaxy s plus, Sony Xperia Tipo dual, Samsung Galaxy Grand (Quatro and Mega), Nexus 4
Are you a developer and using Video View in you application. If so try to debug and verify that you provide a valid uri/url to the Video View. Though there is a null check in the openVideo() of the android.widget.VideoView class, the uri may be empty string.
Here is the source of the Video View class for the android version you mentioned.
这篇关于java.lang.StringIndexOutOfBoundsException同时播放视频videoView:Android的v 4.2.1的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!