Closed patvin80 closed 4 years ago
@patvin80 I'd suggest you consult the Xamarin experts on this one since you're now dipping directly into Xamarin ARCore\Sceneform territory. It's possible that you're hitting an issue in the Xamarin Sceneform bindings.
Hi, I am a CSE student, I have imported Java project folder for Android in Android Studio and connected it to Azure resource. I want to change the shape of the anchors from Sphere/Cylinder to Android jelly bean icon. How I will change it? I will be helpful if anyone help me.
I am trying to extend the Xamarin Android Application to leverage a Model Obj file and were looking for steps to achieve the same. I am looking at the Android code base and see that I could use the ModelRenderer methods for the same. But everytime I end up going to the exception block and have copied the exception
I have changed Anchor Visual.cs
case NamedShape.Andy: try { ModelRenderable.InvokeBuilder().SetSource(context, Resource.Raw.andy).Build((renderable) => { andyRenderable = renderable; transformableNode.Renderable = andyRenderable; }); } catch (Exception ex) { renderable = ShapeFactory.MakeCylinder( 0.0874f, 0.175f, new Vector3(0.0f, 0.0875f, 0.0f), material); }
Here is the error I see: {Java.Lang.NoSuchMethodError: no non-static method "Lcom/google/ar/sceneform/rendering/ModelRenderable$Builder;.setSource(Landroid/content/Context;I)Ljava/lang/Object;" at Java.Interop.JniEnvironment+InstanceMethods.GetMethodID (Java.Interop.JniObjectReference type, System.String name, System.String signature) [0x0005b] in <064cde681fba4dd08eaf8b1bdbbfb8c8>:0 at Java.Interop.JniType.GetInstanceMethod (System.String name, System.String signature) [0x0000c] in <064cde681fba4dd08eaf8b1bdbbfb8c8>:0 at Java.Interop.JniPeerMembers+JniInstanceMethods.GetMethodInfo (System.String encodedMember) [0x00031] in <064cde681fba4dd08eaf8b1bdbbfb8c8>:0 at Java.Interop.JniPeerMembers+JniInstanceMethods.InvokeAbstractObjectMethod (System.String encodedMember, Java.Interop.IJavaPeerable self, Java.Interop.JniArgumentValue* parameters) [0x00006] in <064cde681fba4dd08eaf8b1bdbbfb8c8>:0 at Google.AR.Sceneform.Rendering.ModelRenderable+Builder.SetSource (Android.Content.Context context, System.Int32 resource) [0x00044] in:0
at SampleXamarin.AnchorVisual.RecreateRenderableOnMainThread () [0x000cc] in **\Projects\azure-spatial-anchors-samples\Xamarin\SampleXamarin.Android\AnchorVisual.cs:159
--- End of managed Java.Lang.NoSuchMethodError stack trace ---
java.lang.NoSuchMethodError: no non-static method "Lcom/google/ar/sceneform/rendering/ModelRenderable$Builder;.setSource(Landroid/content/Context;I)Ljava/lang/Object;"
at crc64858f76dd0f2d188d.FutureResultConsumer_1.n_accept(Native Method)
at crc64858f76dd0f2d188d.FutureResultConsumer_1.accept(FutureResultConsumer_1.java:30)
at java.util.concurrent.CompletableFuture.uniAccept(CompletableFuture.java:664)
at java.util.concurrent.CompletableFuture$UniAccept.tryFire(CompletableFuture.java:640)
at java.util.concurrent.CompletableFuture.postComplete(CompletableFuture.java:482)
at java.util.concurrent.CompletableFuture.postFire(CompletableFuture.java:569)
at java.util.concurrent.CompletableFuture$UniApply.tryFire(CompletableFuture.java:588)
at java.util.concurrent.CompletableFuture$Completion.run(CompletableFuture.java:450)
at android.os.Handler.handleCallback(Handler.java:789)
at android.os.Handler.dispatchMessage(Handler.java:98)
at android.os.Looper.loop(Looper.java:164)
at android.app.ActivityThread.main(ActivityThread.java:6710)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:240)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:770)
}