Start a new topic

startPreview failed

startPreview failed


Hi, All.
I write an application, using Android SDK.
It works fine on most phones, but app throws error "startPreview failed" on some devices like Galaxy Y (GT-S5360), Galaxy Ace (GT-S5830i).
I check ArchitectView.isDeviceSupported before AR activity start, but those devices are supported.
I think it's because of the small size of the screen, like 320x240.
Need in advice, should I prohibit using my app on all devices with small screen?

Error stacktrace:

java.lang.RuntimeException: startPreview failed
at android.hardware.Camera.startPreview(Native Method)
at com.wikitude.architect.CameraPreviewService.a(Unknown Source)
at com.wikitude.architect.CameraPreviewService.surfaceChanged(Unknown Source)
at android.view.SurfaceView.updateWindow(SurfaceView.java:558)
at android.view.SurfaceView.dispatchDraw(SurfaceView.java:350)
at android.view.ViewGroup.drawChild(ViewGroup.java:1644)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1373)
at android.view.ViewGroup.drawChild(ViewGroup.java:1644)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1373)
at android.view.View.draw(View.java:6883)
at android.widget.FrameLayout.draw(FrameLayout.java:357)
at android.view.ViewGroup.drawChild(ViewGroup.java:1646)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1373)
at android.view.ViewGroup.drawChild(ViewGroup.java:1644)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1373)
at android.view.ViewGroup.drawChild(ViewGroup.java:1644)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1373)
at android.view.View.draw(View.java:6883)
at android.widget.FrameLayout.draw(FrameLayout.java:357)
at com.android.internal.policy.impl.PhoneWindow$DecorView.draw(PhoneWindow.java:1940)
at android.view.ViewRoot.draw(ViewRoot.java:1527)
at android.view.ViewRoot.performTraversals(ViewRoot.java:1264)
at android.view.ViewRoot.handleMessage(ViewRoot.java:1865)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:130)
at android.app.ActivityThread.main(ActivityThread.java:3687)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:507)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:867)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:625)
at dalvik.system.NativeStart.main(Native Method)

Hi Andrey!

Could you please let me know the Android Version of the affected devices.
Given fact that low-resolution and small devices are usually also low-end devices I recommend you to exclude them via AndroidManifest

<supports-screens

        android:anyDensity="true"

        android:largeScreens="true"

        android:normalScreens="true"

        android:smallScreens="false"

        android:xlargeScreens="true" />

Please let me know more details of the devices so we can have a closer look and ensure isDeviceSupported returns false in upcoming version for these devices.

Kind regards,
Andreas

I see errors in GooglePlay developer console, so I see versions Android 2.3.3 - 2.3.7

My app manifest use minSdkVersion="9".

In this week I see theese 134 errors. Devices:




Galaxy Y (GT-S5360)

27

18,4 %



Galaxy Y (GT-S5360L)

20

13,6 %



Galaxy Ace (GT-S5830i)

12

8,2 %



Galaxy Y Duos (GT-S6102)

9

6,1 %



Galaxy Y (GT-S5360B)

8

5,4 %



Galaxy Pocket (GT-S5300)

7

4,8 %



Galaxy Mini (GT-S5570I)

5

3,4 %



Galaxy Y Duos (GT-S6102B)

5

3,4 %



Galaxy Ace (GT-S5830L)

4

2,7 %



Galaxy Ace (GT-S5830M)

4

2,7 %



Galaxy Y (GT-S5369)

4

2,7 %



Galaxy Prevail (SPH-M820)

3

2,0 %



Galaxy Ace Duos (GT-S6802)

3

2,0 %



Galaxy Ace (GT-S5839i)

3

2,0 %



Galaxy Pocket (GT-S5302)

3

2,0 %




 

and so on

Hi Andrey!

We will check your issue for next SDK update. Meanwhile you may set minSdkVersion to 11 and exclude small screen devices to exclude potential troublemakers.

Kind regards & Sorry for inconvenience.

Thank you.
I don't want to exclude Android 2.3 by manifest, because I have more then 67'000 such devices in active user list.
At this time I try to restrict AR using by checking screen dencity and size...
Login or Signup to post a comment