Log in or register to post comments

RuntimeException in the

May 20, 2016 - 5:11am #1

I have the following problem:

Fatal Exception: java.lang.RuntimeException: Unable to destroy activity {br.com.myapp/br.com.myapp.ui.activities.ScannerActivity}: java.lang.RuntimeException: Use of the Java Vuforia APIs requires initalization via the com.qualcomm.vuforia.Vuforia class
       at android.app.ActivityThread.performDestroyActivity(ActivityThread.java:3791)
       at android.app.ActivityThread.handleDestroyActivity(ActivityThread.java:3809)
       at android.app.ActivityThread.handleRelaunchActivity(ActivityThread.java:4009)
       at android.app.ActivityThread.access$900(ActivityThread.java:155)
       at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1323)
       at android.os.Handler.dispatchMessage(Handler.java:102)
       at android.os.Looper.loop(Looper.java:135)
       at android.app.ActivityThread.main(ActivityThread.java:5343)
       at java.lang.reflect.Method.invoke(Method.java)
       at java.lang.reflect.Method.invoke(Method.java:372)
       at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:905)
       at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:700)
Caused by java.lang.RuntimeException: Use of the Java Vuforia APIs requires initalization via the com.qualcomm.vuforia.Vuforia class
       at com.qualcomm.vuforia.TrackerManager.getInstance(TrackerManager.java:49)
       at lib.application.MyApplication.doDeinitTrackers(MyApplication.java:396)
       at lib.application.MyApplicationSession.stopAR(MyApplicationSession.java:239)
       at lib.application.MyApplication.stopRecognitionService(MyApplication.java:718)
       at br.com.myapp.ui.activities.ScannerActivity.onDestroy(ScannerActivity.java:147)
       at android.app.Activity.performDestroy(Activity.java:6189)
       at android.app.Instrumentation.callActivityOnDestroy(Instrumentation.java:1164)
       at android.app.ActivityThread.performDestroyActivity(ActivityThread.java:3778)
       at android.app.ActivityThread.handleDestroyActivity(ActivityThread.java:3809)
       at android.app.ActivityThread.handleRelaunchActivity(ActivityThread.java:4009)
       at android.app.ActivityThread.access$900(ActivityThread.java:155)
       at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1323)
       at android.os.Handler.dispatchMessage(Handler.java:102)
       at android.os.Looper.loop(Looper.java:135)
       at android.app.ActivityThread.main(ActivityThread.java:5343)
       at java.lang.reflect.Method.invoke(Method.java)
       at java.lang.reflect.Method.invoke(Method.java:372)
       at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:905)
       at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:700)

----------------------------------------------------------------

MyApplication.java:396

**
     * Indicate if the trackers were deinitialized correctly
     * @return {@link boolean}
     */
    @Override
    public boolean doDeinitTrackers() {
        TrackerManager tManager = TrackerManager.getInstance(); //line 396
        tManager.deinitTracker(ObjectTracker.getClassType());

        return true;
    }

----------------------------------------------------------------

MyApplicationSession.java:239

/**
     * Stops any ongoing initialization, stops Recognition service
     * @throws ARApplicationException error
     */
    public void stopAR() throws ARApplicationException
    {
        // Cancel potentially running tasks
        if (mInitAdAliveTask != null
                && mInitAdAliveTask.getStatus() != InitAdAliveTask.Status.FINISHED)
        {
            mInitAdAliveTask.cancel(true);
            mInitAdAliveTask = null;
        }

        if (mLoadTrackerTask != null
                && mLoadTrackerTask.getStatus() != LoadTrackerTask.Status.FINISHED)
        {
            mLoadTrackerTask.cancel(true);
            mLoadTrackerTask = null;
        }

        mInitAdAliveTask = null;
        mLoadTrackerTask = null;

        mStarted = false;

        stopCamera();

        // Ensure that all asynchronous operations to initialize Recognition
        // and loading the tracker datasets do not overlap:
        synchronized (mShutdownLock)
        {

            boolean unloadTrackersResult;
            boolean deinitTrackersResult;

            // Destroy the tracking data set:
            unloadTrackersResult = mSessionControl.doUnloadTrackersData();

            // Deinitialize the trackers:
            deinitTrackersResult = mSessionControl.doDeinitTrackers(); //line 239

            // Deinitialize Recognition SDK:
            Vuforia.deinit();

            if (!unloadTrackersResult)
                throw new ARApplicationException(
                        ARApplicationException.UNLOADING_TRACKERS_FAILURE,
                        "Failed to unload trackers\' data");

            if (!deinitTrackersResult)
                throw new ARApplicationException(
                        ARApplicationException.TRACKERS_DEINITIALIZATION_FAILURE,
                        "Failed to deinitialize trackers");

        }
    }

----------------------------------------------------------------

Can you help me?

My Vuforia SDK version is 5.5.9.

 

 

RuntimeException in the

June 20, 2016 - 6:03am #2

Can anybody help me? I'm almost a year with this error and no solution! Updated the library (SDK) for the android 5-5-9 and 5-0-5 was earlier.

Log in or register to post comments