Start a new topic

Black Screen with ArchitectWorld URL on it

Black Screen with ArchitectWorld URL on it


Hi Andreas! 

Thank you very much for your reply. In my case the problems was elsewhere. I ran application on a different defice and got a new error messages which helped me traced the problem. Wikitude library could not connect to device camera.  I have missplaced the permissions puttings them inside of <application> tag in AndroidManifest file. Onced I have moved permissions to a correct place black screen went away and camera started working. 

I have double checked the lifecycle methods. I use all recommended methods and I do get my Architect world loaded and image recognition works. However almost every second time when I close app and then start again it closes withouht a crash message. Then I start it again it starts normally. I take it down and start again it starts and sighlently closes right away without any android dialog message like "Application stopped working"... I tried on couple of other devices and it behaves the same way... Have you experienced anything like this before? 

 

Thank you!
Hi there,
The SDK Sample App's section where you can enter the url to an ARchitect-World uses the Fragment approach.
Please double check your implementation against it. If you can't fix the issue, you may send a small sample project where we can check in detail to android(at)wikitude.com, referring to this forum post.

Kind regards,
Andreas

PS.: I hope you understand that debugging your whole project is not part of out support, but a simplified sample helps us a lot more ;-)

Hi Andreas! 

Thank you very much for your response!

I checked the examples folder for an example with architectview and fragment. Maybe there is somethings I do not see but this is what I was making sure I do: 

1. Load architectview in a separate activity (extends Fragment)

2. Use Framelayout for com.wikitude.architect.ArchitectView

3. Make sure in my Fragment I override all found lifecycle methods: 

onCreate(), onPostCreate(), onPause, onDestroy()

4. Creare and load architectview in public void onActivityCreated(Bundle savedInstanceState).

 

But every other time application  crashes either on start or when I try use it. Sometimes it starts and even recognizes the object and pops up my video overlay and video plays. But if I close it and start again it starts crashing... 

I am testing on Galaxy Nexus. Android 4.2.1 

Will log file help?: 

 

03-24 14:44:21.903    7040-7087/com.ourcompany.theprojectv5.app I/Process? Sending signal. PID: 7040 SIG: 9 

03-24 14:44:53.989    7182-7186/com.ourcompany.theprojectv5.app D/dalvikvm? GC_CONCURRENT freed 158K, 3% free 9101K/9288K, paused 4ms+4ms, total 23ms 

03-24 14:44:54.028    7182-7186/com.ourcompany.theprojectv5.app D/dalvikvm? GC_CONCURRENT freed 251K, 3% free 9292K/9572K, paused 2ms+2ms, total 18ms 

03-24 14:44:54.129    7182-7186/com.ourcompany.theprojectv5.app D/dalvikvm? GC_CONCURRENT freed 191K, 3% free 9540K/9764K, paused 3ms+2ms, total 25ms 

03-24 14:44:54.856    7182-7182/com.ourcompany.theprojectv5.app D/dalvikvm? Trying to load lib /data/data/com.ourcompany.theprojectv5.app/libarchitect.so 0x41389bc8 

03-24 14:44:54.895    7182-7182/com.ourcompany.theprojectv5.app D/dalvikvm? Added shared lib /data/data/com.ourcompany.theprojectv5.app/libarchitect.so 0x41389bc8 

03-24 14:44:55.739    7182-7182/com.ourcompany.theprojectv5.app D/dalvikvm? Trying to load lib /data/data/com.ourcompany.theprojectv5.app/libarchitect.so 0x41389bc8 

03-24 14:44:55.739    7182-7182/com.ourcompany.theprojectv5.app D/dalvikvm? Shared lib '/data/data/com.ourcompany.theprojectv5.app/libarchitect.so' already loaded in same CL 0x41389bc8 

03-24 14:44:56.059    7182-7186/com.ourcompany.theprojectv5.app D/dalvikvm? GC_CONCURRENT freed 290K, 4% free 9650K/9980K, paused 4ms+2ms, total 23ms 

03-24 14:44:56.059    7182-7182/com.ourcompany.theprojectv5.app D/dalvikvm? WAIT_FOR_CONCURRENT_GC blocked 12ms 

03-24 14:44:56.059    7182-7182/com.ourcompany.theprojectv5.app I/dalvikvm-heap? Grow heap (frag case) to 10.058MB for 640016-byte allocation 

03-24 14:44:56.082    7182-7191/com.ourcompany.theprojectv5.app D/dalvikvm? GC_FOR_ALLOC freed <1K, 4% free 10275K/10608K, paused 16ms, total 16ms 

03-24 14:44:56.121    7182-7182/com.ourcompany.theprojectv5.app I/ArchitectWebView? ARchitect Build: dcc01bf 

03-24 14:44:56.192    7182-7182/com.ourcompany.theprojectv5.app D/libEGL? loaded /vendor/lib/egl/libEGL_POWERVR_SGX540_120.so 

03-24 14:44:56.200    7182-7182/com.ourcompany.theprojectv5.app D/libEGL? loaded /vendor/lib/egl/libGLESv1_CM_POWERVR_SGX540_120.so 

03-24 14:44:56.207    7182-7182/com.ourcompany.theprojectv5.app D/libEGL? loaded /vendor/lib/egl/libGLESv2_POWERVR_SGX540_120.so 

03-24 14:44:56.293    7182-7182/com.ourcompany.theprojectv5.app D/OpenGLRenderer? Enabling debug mode 0 

03-24 14:44:56.332    7182-7228/com.ourcompany.theprojectv5.app E/libEGL? called unimplemented OpenGL ES API 

03-24 14:44:56.332    7182-7228/com.ourcompany.theprojectv5.app E/libEGL? called unimplemented OpenGL ES API 

03-24 14:44:56.426    7182-7182/com.ourcompany.theprojectv5.app D/dalvikvm? GC_FOR_ALLOC freed 173K, 3% free 10333K/10608K, paused 19ms, total 19ms 

03-24 14:44:56.434    7182-7182/com.ourcompany.theprojectv5.app I/dalvikvm-heap? Grow heap (frag case) to 10.554MB for 460816-byte allocation 

03-24 14:44:56.450    7182-7182/com.ourcompany.theprojectv5.app D/dalvikvm? GC_FOR_ALLOC freed <1K, 3% free 10782K/11060K, paused 19ms, total 19ms 

03-24 14:44:56.450    7182-7182/com.ourcompany.theprojectv5.app I/dalvikvm-heap? Grow heap (frag case) to 10.994MB for 460816-byte allocation 

03-24 14:44:56.465    7182-7238/com.ourcompany.theprojectv5.app D/dalvikvm? GC_FOR_ALLOC freed 0K, 3% free 11232K/11512K, paused 17ms, total 17ms 

03-24 14:44:56.496    7182-7186/com.ourcompany.theprojectv5.app D/dalvikvm? GC_CONCURRENT freed 28K, 3% free 11266K/11512K, paused 3ms+2ms, total 28ms 

03-24 14:44:56.911    7182-7182/com.ourcompany.theprojectv5.app E/Web Console? Uncaught ReferenceError: AR is not defined at null:1 

03-24 14:44:56.911    7182-7182/com.ourcompany.theprojectv5.app I/Choreographer? Skipped 42 frames!  The application may be doing too much work on its main thread. 

03-24 14:44:58.520    7182-7228/com.ourcompany.theprojectv5.app W/dalvikvm? threadid=14: thread exiting with uncaught exception (group=0x40ae4930) 

03-24 14:44:58.520    7182-7228/com.ourcompany.theprojectv5.app E/AndroidRuntime? FATAL EXCEPTION: GLThread 329 

    java.util.ConcurrentModificationException 

            at java.util.ArrayList$ArrayListIterator.next(ArrayList.java:569) 

            at com.wikitude.architect.VideoManager.b(Unknown Source) 

            at com.wikitude.architect.Gameplay3dView$b.onDrawFrame(Unknown Source) 

            at android.opengl.GLSurfaceView$GLThread.guardedRun(GLSurfaceView.java:1516) 

            at android.opengl.GLSurfaceView$GLThread.run(GLSurfaceView.java:1240) 

03-24 14:44:58.746    7182-7182/com.ourcompany.theprojectv5.app D/TilesManager? Starting TG #0, 0x587034e8 

03-24 14:44:58.754    7182-7182/com.ourcompany.theprojectv5.app D/TilesManager? new EGLContext from framework: 57ea7b08 

03-24 14:44:58.754    7182-7182/com.ourcompany.theprojectv5.app D/GLWebViewState? Reinit shader 

03-24 14:44:58.762    7182-7182/com.ourcompany.theprojectv5.app D/GLWebViewState? Reinit transferQueue 

03-24 14:44:59.426    7182-7182/com.ourcompany.theprojectv5.app D/webviewglue? nativeDestroy view: 0x57e27560 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

I thought may be I should also share the Activity and Fragment. May be you will notifce something very obviouse I do not do... 

 

 

public class MainActivity extends FragmentActivity {

    final String data ={"Camera view","Menu one","Menu two"};

    final String fragments ={

            "com.earthlandia.complementv5.app.MyCameraActivity",

            "com.earthlandia.complementv5.app.MyWebView",

            "com.earthlandia.complementv5.app.MyWebView"};

    @Override

    protected void onCreate(Bundle savedInstanceState) {

        super.onCreate(savedInstanceState);

        setContentView(R.layout.activity_main);

 

        ArrayAdapter adapter = new ArrayAdapter(getActionBar().getThemedContext(), android.R.layout.simple_list_item_1, data);

 

        final DrawerLayout drawer = (DrawerLayout)findViewById(R.id.drawer_layout);

        final ListView navList = (ListView) findViewById(R.id.drawer);

        navList.setAdapter(adapter);

        navList.setOnItemClickListener(new OnItemClickListener(){

            @Override

            public void onItemClick(AdapterView<?> parent, View view, final int pos,long id){

                drawer.setDrawerListener( new DrawerLayout.SimpleDrawerListener(){

                    @Override

                    public void onDrawerClosed(View drawerView){

                        super.onDrawerClosed(drawerView);

                        FragmentTransaction tx = getSupportFragmentManager().beginTransaction();

                        tx.replace(R.id.main, Fragment.instantiate(getApplicationContext(), fragments));

                        tx.commit();

                    }

                });

                drawer.closeDrawer(navList);

            }

        });

 

    }

 

    @Override

    protected void onStart() {

        super.onStart();

 

        FragmentTransaction tx = getSupportFragmentManager().beginTransaction();

        tx.replace(R.id.main,Fragment.instantiate(MainActivity.this, fragments));

        tx.commit();

    }

}

 

 

 

 

Here is Fragment code.

 

 

 

 


 

public class MyCameraActivity extends Fragment {

    ArchitectView architectView;

 

 

    public static Fragment newInstance(Context context) {

        MyCameraActivity f = new MyCameraActivity();

 

        return f;

    }

 

    @Override

    public View onCreateView(LayoutInflater inflater, ViewGroup container,Bundle savedInstanceState) {

        ViewGroup root = (ViewGroup) inflater.inflate(R.layout.activity_my_camera, null);

        return inflater.inflate(R.layout.activity_my_camera,container,false);

        //return root;

    }

 

 

    @Override

    public void onActivityCreated(Bundle savedInstanceState) {

        super.onActivityCreated(savedInstanceState);

        View rootView = null;

        architectView = (ArchitectView) this.getView().findViewById(R.id.architectView);

        final ArchitectConfig config = new ArchitectConfig("");

        architectView.onCreate(config);

        architectView.onPostCreate();

 

        try {

 

            if (architectView != null) {

                architectView.load("index.html");

            }

        } catch(Exception ex)

        {

            ex.printStackTrace();

        }

    }

 

 

 

 

 

    @Override

    public void onResume() {

        //Log.e("DEBUG", "onResume of HomeFragment");

        super.onResume();

 

        if(architectView !=null)

        {

            architectView.onResume();

        }

 

 

    }

 

    @Override

    public void onPause() {

        //Log.e("DEBUG", "OnPause of HomeFragment");

        super.onPause();

        if(architectView !=null)

        {

            architectView.onPause();

        }

    }

 

    @Override

    public void onDestroy() {

        super.onDestroy();

        if(architectView !=null)

        {

            architectView.onDestroy();

           // architectView = null;

        }

 

    }

 

    @Override

    public void onLowMemory() {

        super.onLowMemory();

        if ( architectView != null ) {

            architectView.onLowMemory();

        }

    }

 

 

 

    @Override

    public void onStop() {

        super.onStop();

    }

}

 

thanks for reporting the issue. We had a detailed look at it and believe this is fixed with another VideoDrawable issue we have fixed for the upcoming version. It will be released next week and I kindly ask you to try it out when it becomes available. Please let us know if it resolves all your issues.

Thanks!

Wolfgang, thank you so much for taking time and looking into it! This is a very good news! I am so looking forward to downloading and trying the new version of SDK!

 

 

Hello! 

I am using HTC device with Android 4.0.3. Wikitude App downloaded from Playstore works well on it and does open ArchitectWorld from my remote server. 

I have created a simple app with NavigationDrawer(https://developer.android.com/design/patterns/navigation-drawer.html) and load ArchitectWorld in a Fragment. However I get a black screen with ArchitectWorld URL displayed on it. Camera view does not start. I have also noticed following error message in logcat "E/libEGL? called unimplemented OpenGL ES API". As development environment I use Android Studio. 

Please advise me why is it that I am getting this black screen? I do call onCreate and PostCreate and all lifecycle methods. Also device is supported and I get true for: ArchitectView.isDeviceSupported(getActivity().getApplicationContext());

 

Where could be the problem?

    @Override

        public void onActivityCreated(Bundle savedInstanceState) {

            super.onActivityCreated(savedInstanceState);

      }

 

public View onCreateView(LayoutInflater inflater, ViewGroup container,

                Bundle savedInstanceState) {


              rootView = inflater.inflate(R.layout.fragment_main, container, false);

              architectView = (ArchitectView) rootView.findViewById(R.id.architectView);

              final ArchitectConfig config = new ArchitectConfig( "" /* license key */ );

              architectView.onCreate( "config);

              architectView.onPostCreate();

 


       try

            {

                architectView.load( "MyWorld.html" ); // The URL used here is actually pointing to another server. URL is correct and works in another application. 

             }

            catch (final IOException e)

            {

                e.printStackTrace();

            }


 

 

 

 

// I also do call lifecycle methods. 


    @Override

        public void onResume() {

            //Log.e("DEBUG", "onResume of HomeFragment");

            super.onResume();

 

            if(architectView !=null)

            {

                architectView.onResume();

            }

 

 

        }

 

        @Override

        public void onPause() {

            //Log.e("DEBUG", "OnPause of HomeFragment");

            super.onPause();

            if(architectView !=null)

            {

                architectView.onPause();

            }

        }

 

        @Override

        public void onDestroy() {

            super.onDestroy();

            if(architectView !=null)

            {

                architectView.onDestroy();

                architectView = null;

            }

 

        }

 

        @Override

        public void onLowMemory() {

            super.onLowMemory();

            if ( architectView != null ) {

                architectView.onLowMemory();

            }

        }

 

        @Override

        public void onDetach()

        {

            super.onDetach();

            if(architectView!=null)

            {

                ((ViewGroup) architectView.getParent()).removeView(architectView);

            }

        }


 


}

 

 

 

Here is my Android Manifest 

 


        <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.camera.autofocus" />

        <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" />

        <uses-sdk android:targetSdkVersion="17" android:minSdkVersion="14"/>

Hi Sergey,

Please check "ARchitectUrlLauncherCamActivity.java" in the Android SampleProject.
Have a look at "SampleCamFragment" which extends "AbstractArchitectCamFragmentV4" handling lifecycle-events for you.

Hope this helps.

Kind regards,
Andreas
Login or Signup to post a comment