I am making a rather specialist camera app for a device which is physically always going to be held in a landscape orientation. Part of the spec is that it must be able to preview and take photos in a portrait orientation - see image below.
I am having some trouble with a runtime exception "setParameters failed" (in response to a call to camera.setParameters()) and I just wanted to check here whether there was some fundamental problem that you think I might be up against. For example perhaps the light sensors on the back of the camera are a arranged in a rectangle and physically this can not be achieved - or perhaps some other unavoidable issue. (By the way I have been informed that the light sensors should be arranged in a square, so this problem will not occur - but my sources may be mistaken). Maybe this is hardware dependant?
EDIT: FYI my crash log is below:
D/AndroidRuntime(7210): Shutting down VM
W/dalvikvm(7210): threadid=1: thread exiting with uncaught exception (group=0x415c2d88)
E/AndroidRuntime(7210): FATAL EXCEPTION: main
E/AndroidRuntime(7210): Process: com.rai.motion, PID: 7210
E/AndroidRuntime(7210): java.lang.RuntimeException: Unable to resume activity {com.rai.motion/com.rai.motion.MotionMain}: java.lang.RuntimeException: setParameters failed
E/AndroidRuntime(7210): at android.app.ActivityThread.performResumeActivity(ActivityThread.java:2850)
E/AndroidRuntime(7210): at android.app.ActivityThread.handleResumeActivity(ActivityThread.java:2879)
E/AndroidRuntime(7210): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2303)
E/AndroidRuntime(7210): at android.app.ActivityThread.access$800(ActivityThread.java:144)
E/AndroidRuntime(7210): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1246)
E/AndroidRuntime(7210): at android.os.Handler.dispatchMessage(Handler.java:102)
E/AndroidRuntime(7210): at android.os.Looper.loop(Looper.java:212)
E/AndroidRuntime(7210): at android.app.ActivityThread.main(ActivityThread.java:5151)
E/AndroidRuntime(7210): at java.lang.reflect.Method.invokeNative(Native Method)
E/AndroidRuntime(7210): at java.lang.reflect.Method.invoke(Method.java:515)
E/AndroidRuntime(7210): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:878)
E/AndroidRuntime(7210): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:694)
E/AndroidRuntime(7210): at dalvik.system.NativeStart.main(Native Method)
E/AndroidRuntime(7210): Caused by: java.lang.RuntimeException: setParameters failed
E/AndroidRuntime(7210): at android.hardware.Camera.native_setParameters(Native Method)
E/AndroidRuntime(7210): at android.hardware.Camera.setParameters(Camera.java:1689)
E/AndroidRuntime(7210): at com.rai.motion.MotionMain.change_java_recording_camera_settings(MotionMain.java:2105)
E/AndroidRuntime(7210): at com.rai.motion.MotionMain.start_recording_camera(MotionMain.java:2154)
E/AndroidRuntime(7210): at com.rai.motion.MotionMain.onResume(MotionMain.java:6013)
E/AndroidRuntime(7210): at android.app.Instrumentation.callActivityOnResume(Instrumentation.java:1192)
E/AndroidRuntime(7210): at android.app.Activity.performResume(Activity.java:5310)
E/AndroidRuntime(7210): at android.app.ActivityThread.performResumeActivity(ActivityThread.java:2840)
E/AndroidRuntime(7210): ... 12 more
I/Process(7210): Sending signal. PID: 7210 SIG: 9
I made a small camera test app a while ago. It was no problem, to show the camera preview in portrait mode, whilst the device was in landscape orientation. It was tricky to rotate the camera image by the right angle (because this rotation angle is device/camera dependant). A problem however was, that the perspective didn't match then: object seemed to be fatter or streched. But to find out the recalculating algorithm shouldn't take to much time on Stackoverflow.
So regarding
I just wanted to check here whether there was some fundamental problem
that you think I might be up against.
[...]and physically this can not be achieved - or perhaps some other unavoidable issue.
the answer is: it's a doable task. Your exception probably has a totally different reason.
Related
The latest update to the Microsoft Health application appears to have broken backwards compatibility with the SDK preview resulting in errors similar to the following for Android development:
04-28 20:02:09.001 8840-9755/org.hackerforhire.msbandlight E/AndroidRuntime﹕ FATAL EXCEPTION: f
Process: org.hackerforhire.msbandlight, PID: 8840
java.lang.RuntimeException: Parcel android.os.Parcel#1d1d95f2: Unmarshalling unknown type code 40 at offset 368
at android.os.Parcel.readValue(Parcel.java:2228)
at android.os.Parcel.readArrayMapInternal(Parcel.java:2485)
at android.os.BaseBundle.unparcel(BaseBundle.java:221)
at android.os.Bundle.getParcelable(Bundle.java:755)
at com.microsoft.band.f.d(SourceFile:820)
at com.microsoft.band.f.d(SourceFile:40)
at com.microsoft.band.f$d.a(SourceFile:892)
at com.microsoft.band.internal.e$3.handleMessage(SourceFile:137)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:135)
at com.microsoft.band.internal.e.run(SourceFile:148)
I previously assumed this was an issue with ProGuard rules per this stack overflow; however, that did not have any impact.
At this point, I'm really looking to see if anyone can suggest a good way to dig into the library JAR and see if there's something I can manually patch to get things working. Is there such a thing or is it best to just hope that Microsoft will release a new SDK soon?
Version information:
Microsoft Health Version: 1.3.10427.2
Microsoft Band SDK Version: 1.3.10215.1
Microsoft Band Firmware Version: 10.2.2810.0 09 R
Android Version: 5.1 (Nexus 6)
UPDATE 2015-04-30: Confirmed that the newest version of the SDK (1.3.10428.1) resolves this issue.
I'm afraid I don't have a solution, but can confirm the problem. I have hit the same problem today. My Xamarin.Forms Android build interfacing to Microsoft Band was working fine yesterday. Now it's dead - the call to BandClient.ConnectTaskAsync() never completes. Even the sample app fails to connect.
My app is using:
Microsoft.Band.Android 1.3.10215.1
Microsoft.Band.Portable 1.0.0.0
I am testing on a Motorola Moto E running Android 4.4.4
using a Microsoft Band with Firmware Version: 10.2.2810.0 09 R
The output from the debugger (from the sample app) follows:
FATAL EXCEPTION: f
Process: Microsoft.Band.Sample, PID: 9382
java.lang.RuntimeException: Parcel android.os.Parcel#4193eec8: Unmarshalling unknown type code 3473459 at offset 344
at android.os.Parcel.readValue(Parcel.java:2080)
at android.os.Parcel.readSparseArrayInternal(Parcel.java:2363)
at android.os.Parcel.readSparseArray(Parcel.java:1735)
at android.os.Parcel.readValue(Parcel.java:2070)
at android.os.Parcel.readArrayMapInternal(Parcel.java:2313)
at android.os.Bundle.unparcel(Bundle.java:249)
at android.os.Bundle.getParcelable(Bundle.java:1206)
at com.microsoft.band.f.d(SourceFile:820)
at com.microsoft.band.f.d(SourceFile:40)
at com.microsoft.band.f$d.a(SourceFile:892)
at com.microsoft.band.internal.e$3.handleMessage(SourceFile:137)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:136)
at com.microsoft.band.internal.e.run(SourceFile:148)
CURRENT freed 23K, 17% free 36752K/43852K, paused 4ms+23ms, total 113ms
Activity microsoft.band.sample.MainActivity has leaked ServiceConnection com.microsoft.band.f$1#41aa1438 that was originally bound here
android.app.ServiceConnectionLeaked: Activity microsoft.band.sample.MainActivity has leaked ServiceConnection com.microsoft.band.f$1#41aa1438 that was originally bound here
at com.micros04-29 17:21:27.607 E/ActivityThread( 9382): at android.app.LoadedApk$ServiceDispatcher.<init>(LoadedApk.java:979)
at android.app.LoadedApk.getServiceDispatcher(LoadedApk.java:873)
at android.app.ContextImpl.bindServiceCommon(ContextImpl.java:1690)
at android.app.ContextImpl.bindService(ContextImpl.java:1673)
at android.content.ContextWrapper.bindService(ContextWrapper.java:517)
at com.microsoft.band.f.f(SourceFile:330)
at com.microsoft.band.a.connect(SourceFile:106)
at mono.android.view.View_OnClickListenerImplementor.n_onClick(Native Method)
at mono.android.view.View_OnClickListenerImplementor.onClick(View_OnClickListenerImplementor.java:29)
at android.view.View.performClick(View.java:4456)
at android.view.View$PerformClick.run(View.java:18465)
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:5086)
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:785)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:601)
at dalvik.system.NativeStart.main(Native Method)
I imported the latest master folder (master branch 26-12-2014) to Android-Studio,Gradle build the project successfully after little fix (asset missing,inner fragment static error) then i launched the debugger on my device (samsung galaxy 3 min,Android 4.1.2),I expect to have Osmand running on my device but the application crashes and the log indicate that it happen on getting routing.xml file.
12-26 10:47:10.069 10508-10508/net.osmand.plus E/AndroidRuntime﹕ FATAL EXCEPTION: main
java.lang.RuntimeException: Unable to create application net.osmand.plus.OsmandApplication: java.lang.IllegalStateException: java.lang.IllegalArgumentException
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4200)
at android.app.ActivityThread.access$1400(ActivityThread.java:134)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1278)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:137)
at android.app.ActivityThread.main(ActivityThread.java:4867)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:511)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1007)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:774)
at dalvik.system.NativeStart.main(Native Method)
Caused by: java.lang.IllegalStateException: java.lang.IllegalArgumentException
at net.osmand.router.RoutingConfiguration.getDefault(RoutingConfiguration.java:171)
at net.osmand.plus.helpers.AvoidSpecificRoads.getBuilder(AvoidSpecificRoads.java:44)
at net.osmand.plus.helpers.AvoidSpecificRoads.<init>(AvoidSpecificRoads.java:38)
at net.osmand.plus.OsmandApplication.onCreate(OsmandApplication.java:168)
Thanks.
Make sure that there is a folder named "router" inside your "OsmAnd/scr/net/osmand/" folder which contains the routing.xml file.
If not you can find the resources needed here
I have been editing the FriendPikcerSample provided by Facebook SDK for Android (latest version).
A couple of hours ago I successfully inserted a listview instead of a textview, so that when I select a name in the ListView, I can fetch more details of the user in the further activity
But Now, after restarting my PC, the app is behaving weird. When I launch it and click on "Pick Friends", it should be showing the list of friends who are using the app. Instead, now the app crashes and logcat shows this error.
12-30 07:35:15.820 2238-2238/com.facebook.samples.friendpicker E/AndroidRuntime﹕ FATAL EXCEPTION: main
Process: com.facebook.samples.friendpicker, PID: 2238
com.facebook.FacebookGraphObjectException: Factory can't proxy method: public abstract void com.facebook.model.GraphUser.setBirthday()
at com.facebook.model.GraphObject$Factory.verifyCanProxyClass(GraphObject.java:290)
at com.facebook.model.GraphObject$Factory.createGraphObjectProxy(GraphObject.java:216)
at com.facebook.model.GraphObject$Factory.coerceValueToExpectedType(GraphObject.java:340)
at com.facebook.model.GraphObject$Factory$GraphObjectListImpl.get(GraphObject.java:772)
at java.util.AbstractList$SimpleListIterator.next(AbstractList.java:55)
at java.util.AbstractCollection.toArrayList(AbstractCollection.java:349)
at java.util.AbstractCollection.toArray(AbstractCollection.java:339)
at java.util.ArrayList.addAll(ArrayList.java:188)
at com.facebook.widget.SimpleGraphObjectCursor.addGraphObjects(SimpleGraphObjectCursor.java:46)
at com.facebook.widget.GraphObjectPagingLoader.addResults(GraphObjectPagingLoader.java:203)
at com.facebook.widget.GraphObjectPagingLoader.requestCompleted(GraphObjectPagingLoader.java:186)
at com.facebook.widget.GraphObjectPagingLoader.access$000(GraphObjectPagingLoader.java:27)
at com.facebook.widget.GraphObjectPagingLoader$2.onCompleted(GraphObjectPagingLoader.java:134)
at com.facebook.Request$4.run(Request.java:1666)
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:5017)
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)
Can anyone help me understand what's gone wrong?
I'm getting a crash always when I install or uninstall an app that use Sync Service, like Facebook, whatsup, etc.
"Unfortunately, Exchange Services has stopped."
I don't know why, but it just happens for some devices, in my case all of then are Android 4.4.2.
First I thought it's my app's fault, but it doesn't make sense once I uninstall my app and the problem continues happening for others apps.
Do you know something about it?
Thank you.
02-07 14:31:49.864 3015-3015/? E/ActivityThread﹕ Failed to find provider info for com.google.android.email.provider
02-07 14:31:49.864 3015-3015/? E/AndroidRuntime﹕ FATAL EXCEPTION: main
Process: com.google.android.exchange, PID: 3015
java.lang.RuntimeException: Unable to create application com.android.exchange.Exchange: java.lang.IllegalArgumentException: Unknown URI content://com.google.android.email.provider
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4347)
at android.app.ActivityThread.access$1500(ActivityThread.java:135)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1256)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:136)
at android.app.ActivityThread.main(ActivityThread.java:5017)
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)
Caused by: java.lang.IllegalArgumentException: Unknown URI content://com.google.android.email.provider
at android.content.ContentResolver.call(ContentResolver.java:1352)
at com.android.exchange.Exchange.onCreate(Exchange.java:34)
at android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:1007)
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4344)
at android.app.ActivityThread.access$1500(ActivityThread.java:135)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1256)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:136)
at android.app.ActivityThread.main(ActivityThread.java:5017)
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)
I found what was happening!
The problem occurs by device when there are sync accounts registered, but the Exchange Service cannot find any application to answer the URI, in my case it was "content://com.google.android.email.provider", to fix it I checked my disable applications and there was it, my default email application was disable. I just enable it again and the problem never occurs again.
Go to Settings > Apps > ALL> Exchange Services > Clear Cache and try opening it. When it opens, check once.
I had that problem. now I’m using a good app called Mailwise. it’s a free email app, very convenient for businesses, you can easily set up multiple email accounts, and it works great with Exchange.
https://play.google.com/store/apps/details?id=com.syntomo.email&hl=en
I have the following Android exception. It is reported by Bugsense and I cannot find out where it comes from as there is no reference to any class of my app.
java.lang.IndexOutOfBoundsException: Invalid index 0, size is 0
at java.util.ArrayList.throwIndexOutOfBoundsException(ArrayList.java:251)
at java.util.ArrayList.get(ArrayList.java:304)
at android.widget.HeaderViewListAdapter.isEnabled(HeaderViewListAdapter.java:164)
at android.widget.AbsListView$ListItemAccessibilityDelegate.onInitializeAccessibilityNodeInfo(AbsListView.java:2512)
at android.view.View.onInitializeAccessibilityNodeInfo(View.java:4849)
at android.widget.LinearLayout.onInitializeAccessibilityNodeInfo(LinearLayout.java:1768)
at android.view.View.createAccessibilityNodeInfo(View.java:4812)
at android.view.AccessibilityInteractionController$AccessibilityNodePrefetcher.prefetchDescendantsOfRealNode(AccessibilityInteractionController.java:825)
at android.view.AccessibilityInteractionController$AccessibilityNodePrefetcher.prefetchDescendantsOfRealNode(AccessibilityInteractionController.java:848)
at android.view.AccessibilityInteractionController$AccessibilityNodePrefetcher.prefetchDescendantsOfRealNode(AccessibilityInteractionController.java:848)
at android.view.AccessibilityInteractionController$AccessibilityNodePrefetcher.prefetchDescendantsOfRealNode(AccessibilityInteractionController.java:848)
at android.view.AccessibilityInteractionController$AccessibilityNodePrefetcher.prefetchDescendantsOfRealNode(AccessibilityInteractionController.java:848)
at android.view.AccessibilityInteractionController$AccessibilityNodePrefetcher.prefetchAccessibilityNodeInfos(AccessibilityInteractionController.java:734)
at android.view.AccessibilityInteractionController.findAccessibilityNodeInfoByAccessibilityIdUiThread(AccessibilityInteractionController.java:205)
at android.view.AccessibilityInteractionController.access$400(AccessibilityInteractionController.java:49)
at android.view.AccessibilityInteractionController$PrivateHandler.handleMessage(AccessibilityInteractionController.java:985)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:137)
at android.app.ActivityThread.main(ActivityThread.java:4867)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:511)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1007)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:774)
at dalvik.system.NativeStart.main(Native Method)
I do suspect it has something to do with updating a widget. Any ideas on how to trace?
Got similar Nullpointer with a Google map view.
try and turn off any accessibility options enabled on your phone?
And there is a another accessibility bug reported on the Android Issues tracker here
It looks like there is no easy way to turn of accessibility from code, except for overriding the addChildrenForAccessibility method in a custom view. (see above link)