我正在尝试使用 metaioSDK 5.5.2 在 Android 中开发基于位置的 AR 应用程序,当我启动该应用程序时,它告诉我它无法启动陀螺仪传感器,并且我有一个NullPointerException
. 这是日志文件:
06-05 00:59:46.487: E/metaio-java(13855): Failed to start the gyroscope sensor
06-05 00:59:46.487: E/metaio(13855): 301: Failed to start the following quired sensors by the tracking configuration: 128
06-05 00:59:46.492: E/metaio-java(13855): Error stopping face detection: java.lang.RuntimeException: stop face detection failed
06-05 00:59:46.497: E/AndroidRuntime(13855): FATAL EXCEPTION: main
06-05 00:59:46.497: E/AndroidRuntime(13855): Process: com.mada.iacob.test, PID: 13855
06-05 00:59:46.492: E/metaio-java(13855): Error stopping face detection: java.lang.RuntimeException: stop face detection failed
06-05 00:59:46.497: E/AndroidRuntime(13855): FATAL EXCEPTION: main
06-05 00:59:46.497: E/AndroidRuntime(13855): Process: com.mada.iacob.test, PID: 13855
06-05 00:59:46.497: E/AndroidRuntime(13855): java.lang.IllegalStateException: Could not execute method of the activity
06-05 00:59:46.497: E/AndroidRuntime(13855): at android.view.View$1.onClick(View.java:3969)
06-05 00:59:46.497: E/AndroidRuntime(13855): at android.view.View.performClick(View.java:4640)
06-05 00:59:46.497: E/AndroidRuntime(13855): at android.view.View$PerformClick.run(View.java:19425)
06-05 00:59:46.497: E/AndroidRuntime(13855): at android.os.Handler.handleCallback(Handler.java:733)
06-05 00:59:46.497: E/AndroidRuntime(13855): at android.os.Handler.dispatchMessage(Handler.java:95)
06-05 00:59:46.497: E/AndroidRuntime(13855): at android.os.Looper.loop(Looper.java:146)
06-05 00:59:46.497: E/AndroidRuntime(13855): at android.app.ActivityThread.main(ActivityThread.java:5593)
06-05 00:59:46.497: E/AndroidRuntime(13855): at
java.lang.reflect.Method.invokeNative(Native Method)
06-05 00:59:46.497: E/AndroidRuntime(13855): at java.lang.reflect.Method.invoke(Method.java:515)
06-05 00:59:46.497: E/AndroidRuntime(13855): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1283)
06-05 00:59:46.497: E/AndroidRuntime(13855): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1099)
06-05 00:59:46.497: E/AndroidRuntime(13855): at dalvik.system.NativeStart.main(Native Method)
06-05 00:59:46.497: E/AndroidRuntime(13855): Caused by: java.lang.reflect.InvocationTargetException
06-05 00:59:46.497: E/AndroidRuntime(13855): at java.lang.reflect.Method.invokeNative(Native Method)
06-05 00:59:46.497: E/AndroidRuntime(13855): at java.lang.reflect.Method.invoke(Method.java:515)
06-05 00:59:46.497: E/AndroidRuntime(13855): at android.view.View$1.onClick(View.java:3964)
06-05 00:59:46.497: E/AndroidRuntime(13855): ... 11 more
06-05 00:59:46.497: E/AndroidRuntime(13855): Caused by: java.lang.NullPointerException
06-05 00:59:46.497: E/AndroidRuntime(13855): at com.mada.iacob.test.ARActivity.onGPSButtonClick(ARActivity.java:141)
06-05 00:59:46.497: E/AndroidRuntime(13855): ... 14 more
这是一段代码:
public void onGPSButtonClick(View v) {
boolean result = metaioSDK.setTrackingConfiguration("GPS");
metaioSDK.setLLAObjectRenderingLimits(100,1000);
Log.d("TestMETAIO", "aici9");
mMan.setVisible(false);
mSphere.setVisible(false);
Log.d("TestMETAIO", "aici 10");
mRadar.setVisible(true);
Log.d("TestMETAIO", "aici 11");
mBridge.setVisible(true);
mDowntown.setVisible(true);
mTwin.setVisible(true);
MetaioDebug.log("Markerless tracking data loaded" + result);
}
@SuppressWarnings("deprecation")
private void loadGPSContent() {
try {
mBridge = metaioSDK.createGeometryFromImage(createBillboardTexture("Bridge"));
mDowntown = metaioSDK.createGeometryFromImage(createBillboardTexture("Downtown"));
mTwin = metaioSDK.createGeometryFromImage(createBillboardTexture("Twin"));
updateGeometries(mSensors.getLocation());
mRadar = metaioSDK.createRadar();
mRadar.setBackgroundTexture(AssetsManager.getAssetPath("assets3/radar.png"));
mRadar.setObjectsDefaultTexture(AssetsManager.getAssetPath("assets3/yellow.png"));
mRadar.setRelativeToScreen(IGeometry.ANCHOR_TL);
mRadar.add(mBridge);
mRadar.add(mDowntown);
mRadar.add(mTwin);
mBridge.setVisible(false);
mDowntown.setVisible(false);
mTwin.setVisible(false);
} catch(Exception e) {
Log.d("EXCEPTIE", "aici 10"+e);
}
}
请如果有人可以帮助我。我在互联网上找不到任何东西,这真的很重要。