Question

I'm having trouble even opening up the CameraDemo-V9 application (Using version 0.6 of the library). The hardware I'm testing on is a Motorola Droid Razr Maxx HD. This is currently the only physical device I have access to, but the library worked on this phone when it was around version 0.4.2. I'm getting this in logcat:

    02-17 16:38:17.889: E/AndroidRuntime(4382): Caused by: java.lang.NullPointerException
02-17 16:38:17.889: E/AndroidRuntime(4382):     at com.commonsware.cwac.camera.CameraView.setHost(CameraView.java:87)
02-17 16:38:17.889: E/AndroidRuntime(4382):     at com.commonsware.cwac.camera.acl.CameraFragment.onCreateView(CameraFragment.java:40)
02-17 16:38:17.889: E/AndroidRuntime(4382):     at android.support.v4.app.Fragment.performCreateView(Fragment.java:1500)
02-17 16:38:17.889: E/AndroidRuntime(4382):     at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:927)
02-17 16:38:17.889: E/AndroidRuntime(4382):     at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1104)
02-17 16:38:17.889: E/AndroidRuntime(4382):     at android.support.v4.app.BackStackRecord.run(BackStackRecord.java:682)
02-17 16:38:17.889: E/AndroidRuntime(4382):     at android.support.v4.app.FragmentManagerImpl.execPendingActions(FragmentManager.java:1467)
02-17 16:38:17.889: E/AndroidRuntime(4382):     at android.support.v4.app.FragmentActivity.onStart(FragmentActivity.java:570)
02-17 16:38:17.889: E/AndroidRuntime(4382):     at android.app.Instrumentation.callActivityOnStart(Instrumentation.java:1163)
02-17 16:38:17.889: E/AndroidRuntime(4382):     at android.app.Activity.performStart(Activity.java:5068)
02-17 16:38:17.889: E/AndroidRuntime(4382):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2073)

Which seems to happen on this line:

if (host.getDeviceProfile().useTextureView()) {

of this method:

public void setHost(CameraHost host) {

    this.host = host;
    if (host.getDeviceProfile().useTextureView()) {
        previewStrategy = new TexturePreviewStrategy(this);
    } else {
        previewStrategy = new SurfacePreviewStrategy(this);
    }

}

I feel as though this might just be a problem with how I'm setting up the library now as I'm not importing any jars, I just downloaded the zip, and I'm importing the two library projects. Can anyone confirm that my settup seems to be "legal"? The only other idea I had was to check for previous issues, but it seem that this one might have been resolved already because of when the latest version (6.0) was released. Maybe this is because they are both motorola devices, but maybe that is an incorrect assumption?

Note: I get a crash before I see anything on the screen at all. No preview or anything.

Was it helpful?

Solution

It's a bug, because I don't have enough Motorola devices in my portfolio and missed a flaw in my new getDefaultProfile() implementation. Track the bug that you linked to and watch for an 0.6.1 release soonish. My apologies for the hassle, and thanks for letting me know!

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top