0

VrPanoramaView現在、Xamarin を使用して Google VR を簡単に起動して実行しようとしています。

このプロジェクト (Xamarin コンポーネント)を使用して、Java ライブラリを手動でバインドしました。プロジェクト、具体的にはPanoWidgetをバインドすると、次のようになりました: PanoWidget 画像

オブジェクト ブラウザーを使用してVrPanoramaViewの C# コード (部分的に含まれているコード)を調べると、次のコードが表示されます。

using System;
using System.Collections.Generic;
using Android.Runtime;

namespace Google.VR.SDK.Widgets.Pano {

    // Metadata.xml XPath class reference: path="/api/package[@name='com.google.vr.sdk.widgets.pano']/class[@name='VrPanoramaView']"
    [global::Android.Runtime.Register ("com/google/vr/sdk/widgets/pano/VrPanoramaView", DoNotGenerateAcw=true)]
    public partial class VrPanoramaView : global::Google.VR.SDK.Widgets.Common.VrWidgetView {
        [...]
        [...]
        [...]
        // Metadata.xml XPath constructor reference: path="/api/package[@name='com.google.vr.sdk.widgets.pano']/class[@name='VrPanoramaView']/constructor[@name='VrPanoramaView' and count(parameter)=2 and parameter[1][@type='android.content.Context'] and parameter[2][@type='android.util.AttributeSet']]"
        [Register (".ctor", "(Landroid/content/Context;Landroid/util/AttributeSet;)V", "")]
        public unsafe VrPanoramaView (global::Android.Content.Context p0, global::Android.Util.IAttributeSet p1)
        : base (IntPtr.Zero, JniHandleOwnership.DoNotTransfer) {
            [...]
            [...]
            [...]
         }
    }
}

私が理解できることから、VrPanoramaViewは登録されており、レイアウトで次の方法で参照することでアクセスできると思われます。

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent">

  <com.google.vr.sdk.widgets.pano.VrPanoramaView
    android:id="@+id/pano_view"
    android:layout_margin="5dip"
    android:layout_width="match_parent"
    android:scrollbars="@null"
    android:layout_height="250dip" />

  <Button
      android:id="@+id/MyButton"
      android:layout_width="match_parent"
      android:layout_height="wrap_content"
      android:text="@string/Hello" />
</RelativeLayout>

それにもかかわらず、アプリケーションをビルドしてデプロイすると、次のエラーが発生します。

Android.Views.InflateException: Binary XML file line #1: Binary XML file line #1: Error inflating class com.google.vr.sdk.widgets.pano.VrPanoramaView

より具体的には、クラスが見つからないようです:

Java.Lang.ClassNotFoundException: Didn't find class "com.google.vr.sdk.widgets.pano.VrPanoramaView" on path: DexPathList[[zip file "/data/app/App7.App7-1/base.apk"],nativeLibraryDirectories=[/data/app/App7.App7-1/lib/arm64, /data/app/App7.App7-1/base.apk!/lib/arm64-v8a, /vendor/lib64, /system/lib64]]
4

0 に答える 0