使用Wikitude在Android Studio上创建应用,但是在启动时不断崩溃

时间:2019-02-05 09:16:39

标签: android-studio wikitude

我正在尝试在android studio上设置wikitude sdk。我遵循了https://www.wikitude.com/external/doc/documentation/latest/android/setupguideandroid.html处的所有说明,但是我的应用在运行时只是停止响应。该消息只是说明应用已停止。

由于我是Android Studio的新手,所以我很沮丧。

MainActivity

package com.example.artsjs;

import android.app.Activity;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;

import com.wikitude.architect.ArchitectStartupConfiguration;
import com.wikitude.architect.ArchitectView;


public class MainActivity extends Activity {
    private ArchitectView architectView;


    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);

        this.architectView = (ArchitectView) this.findViewById(R.id.architectView);
        final ArchitectStartupConfiguration config = new ArchitectStartupConfiguration();
        config.setLicenseKey("FS8VCQolBiXzy06ODtuZYX0j+mWpVjUppYKGHFnAQloGQ+8wa9NzIMYG5JmLxuiM5TPnrySa02Ai87JfQtSUyezAJ2xaAYsDleB6w9Z3ZBVKENI4ZBvQJTs1F5yCjO4uZdBNAdHfbTSHH7Xg/8aWG85yzzDxTmUePF7YyOKsyepTYWx0ZWRfX6AnV2zVxzo7V1ushyA4mX+Y0OloZxs6RroaxeVKV89ddhq/SKc8vpToMCozEH41sxaCL4EaMijDuvPZj3aOT6jMvJpn/xNd7rWWDq0wLYwqFXLKNKSY7oRqITOLaBXL8zCjho1u6qyKQjJsFt8jn6FqC+Pf2p7dXhc1Q+y5YA6pt1ICvyIkF8WARbbdrr0wbF8QDm0JzvavtCUSUsMYb7v/WokrQ+y9+nKoNA36MASrkGA5H7xde2lGkNIpTO/lLan90ugf45SI7lDD4dMjUkxS6qpVMns3jfmJ/eQfzRftJu/6s0JypKYBsIL+iTq16bXOgjD1qFF6BGL1daLd4FKcZewTSQ7RY5KHsNw3MKCryrzVuCn/hVMlot+eIGZmWtn3JTwvt/jftHQKOyXZ8igfMcE/vvSXqBs/rNzAbo+Mxkztheh40SIzPEWuvmLmfFmymFup1hFg+A5UcgZYF+Ll4IjkJp2A/dCOalIfGs+fcANJIwlyXE1KZLcx206aQ+QaIxgXkIxwgEUM2l1wnSpSgA5Ge3rZ3g==");
        this.architectView.onCreate(config);
    }


    @Override
    protected void onPostCreate(Bundle savedInstanceState) {
        super.onPostCreate(savedInstanceState);

        architectView.onPostCreate();

        try {
            this.architectView.load("file:///android_asset/demo1/index.html");
        } catch (Exception e){

        }

    }

    @Override
    protected void onResume(){
        super.onResume();

        architectView.onResume();
    }


    @Override
    protected void onDestroy(){
        super.onDestroy();

        architectView.onDestroy();
    }

    @Override
    protected void onPause(){
        super.onPause();

        architectView.onPause();
    }
}

AndroidManifest

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.example.artsjs">
    <uses-permission android:name="android.permission.INTERNET" />
    <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
    <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
    <uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
    <uses-permission android:name="android.permission.ACCESS_GPS" />
    <uses-permission android:name="android.permission.CAMERA" />
    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
    <uses-feature android:name="android.hardware.camera" android:required="true" />
    <uses-feature android:name="android.hardware.location" android:required="true" />
    <uses-feature android:name="android.hardware.sensor.accelerometer" android:required="true" />
    <uses-feature android:name="android.hardware.sensor.compass" android:required="true" />
    <uses-feature android:glEsVersion="0x00020000" android:required="true" />

    <application
        android:allowBackup="true"
        android:icon="@mipmap/ic_launcher"
        android:label="@string/app_name"
        android:roundIcon="@mipmap/ic_launcher_round"
        android:supportsRtl="true"
        android:theme="@style/AppTheme">
        <activity android:name=".MainActivity">
        (Label = "MainActivity", ConfigurationChanges = Android.Content.PM.ConfigChanges.Orientation | Android.Content.PM.ConfigChanges.KeyboardHidden | Android.Content.PM.ConfigChanges.ScreenSize)
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />

                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
    </application>

</manifest>

0 个答案:

没有答案