Log in or register to post comments

Camera is not Working

August 26, 2013 - 2:55am #1

Hello Everyone,

 

I build a simple AR Application with Unity 4.2 and the newest Version of the Vuforia SDK. When I build the Projekt from Unity with File -> Build&Run everything works fine. 

The thing is that I want to integrate the AR Part into an existing Android Application. For this, I followed first this guide for setting up the enviornment properly:

https://developer.vuforia.com/resources/dev-guide/extending-unity-android-activity-and-adding-custom-views-eclipse

I skipped steps 1 to 7 as Unity supports building Android Projects. 

As it is not the main view I want to start, I also followed this tutorial to start the unity player from within android:

http://www.geekyhamster.com/2013/07/unityplayer-as-subview-with-transparent.html

So far so good, Unity starts and I can see my help icon - but no camera view. Also if I hold the camera above the markers I cannot see the augmentation. I just see a black background with my help icon on top.

When I look into LogCat I could find this messages:

08-26 11:44:32.164: E/Unity(19461): Could not initialize the tracker.
08-26 11:44:32.164: E/Unity(19461):  
08-26 11:44:32.164: E/Unity(19461): (Filename: ./Runtime/ExportGenerated/AndroidManaged/UnityEngineDebug.cpp Line: 54)
08-26 11:44:32.164: E/Unity(19461): Could not initialize the tracker.
08-26 11:44:32.164: E/Unity(19461):  
08-26 11:44:32.164: E/Unity(19461): (Filename: ./Runtime/ExportGenerated/AndroidManaged/UnityEngineDebug.cpp Line: 54)
08-26 11:44:32.174: E/AR(19461): 2013-08-26 11:44:32: Failed to set hint 'HINT_MAX_SIMULTANEOUS_IMAGE_TARGETS' because the ImageTracker has not been initialized.
08-26 11:44:32.474: E/AR(19461): 2013-08-26 11:44:32: CameraDevice::getCameraCalibration(): Failed to get camera calibration because the camera is not initialized.
 
Those were the messages marked as error.
 
Does anybody have any Idea why this could occur? I have copied the manifest and have both the permisson and uses-feature tag for the camera. I also do not use ImageTargets but FrameMarkers.
 
It would be great if anybody knew any help!
 
Thanks!

 

Camera is not Working

September 10, 2016 - 12:00pm #15

ANY SOLUTIONS?

Camera is not Working

August 31, 2013 - 8:39am #14

good to hear.

Textures do not get loaded in Android [SOLVED]

August 31, 2013 - 12:18am #13

Just in case anyone runs into the same problem of only seeing black object - for me it was solved the following:

I had all my materials, textures, models, etc. under the resources folder in unity. I guess there is a process when the assets folder is generated that needs all the folders directly in the unity assets folder to get converted correctly even though the other folder structure works in unity itself.

So i just moved textures, materials, models to be direct subfolders of assets, built the project, did steps 12 to 14 of the tutorial again and it worked perfectly fine.

Camera is not Working

August 30, 2013 - 11:46pm #12

Hi Alessandro,

I now also tried to make the Framemarkers sample as my Library which worked perfectly fine. I guess I have done something wrong with adding the textures to my Objects so it's a Unity problem. 

Thanks again for the great support!

 

- S

Camera is not Working

August 30, 2013 - 1:42am #11

I tried wthe exporting to Eclipse once again (following the tutorial) and starting from the Image Targets sample in Unity (with the textures of the teapots) and this works fine....

I am running out of ideas on what could be the issue... have you tried asking on the Unity forum to see if they have some hints on what Unity does with textures when creating the Staging Area ?  

 

Camera is not Working

August 30, 2013 - 1:21am #10

I did all the steps exactly as mentioned. In my eclipse project there is a assets folder including bin, libs and QCAR folders with their content.

I tried some different textures which were available for download on the vuforia page: the teapot and the QCAR letters. With both I have trouble showing the texture in eclipse but unity works fine. I also took some default Objects and put a coloured material on them to see if the problem is there but this worked fine so it definiteley must be the Textures. And as I took the textures from this page I guess it is a general problem as the Textures are configured right.

Do you need any additional Information?

- S

Camera is not Working

August 30, 2013 - 12:22am #9

Hi,

the textures (and other assets) should be packaged by Unity into the "assets" folder under the StagingArea dir.

If you look back at the tutorial I was originally referring ti:

https://developer.vuforia.com/resources/dev-guide/extending-unity-android-activity-and-adding-custom-views-eclipse

there is a step mentioning:

Move the "/assets" and "/libs" folders from the "QCARUnity" project directory to the "QCARJava" project folder.

By doing that, the "assets" folder that is created by Unity will end up into your Eclipse project, and this should guarantee that you can load your textures.

If you have already done the step above, then there might be something going wrong with that specific texture. Is it the only texture in your project ?

if you have other textures, can you see them rendered correctly ? (i.e. is the problem specific to that specific texture, or is it general ?)

 

Camera is not Working

August 30, 2013 - 12:09am #8

Hi Alessandro,

I tried your suggestions but everything is set as you said. 

I also should mention that this error only occurs when having the unity project in eclips and startet within an android application. When I start my project from Unity I have no problems at all and the texture is displayed correctly. I also adjustet my directional light so that it points directly on the object, but this didn't help either. Do you have any other idea where this could come from? especially as it only occurs in eclipse and not in unity? Could you maybe tell me where I would find the resources for the texture in the stating area folder so that I can check if they are embedded correctly?

Thank you so much for the great support!

-S

Camera is not Working

August 28, 2013 - 3:23am #7

I too have the same problem

Camera is not Working

August 27, 2013 - 12:54am #6

A texture could be black for various reasons; one possibility is that the image dimensions are non-power-of-two; if that's the case, you would need to resize the image to something like 256 x 256 or 512 x256, or 1024 x 512, etc.

Another possiblity is that you are not loading the texture image (e.g. file/resource not found)

.

 

Camera is not Working

August 27, 2013 - 12:47am #5

Or as you're online - do you happen to have any idea why it could be black?

 

Thanks again =)

Camera is not Working

August 27, 2013 - 12:42am #4

You're welcome!

Camera is not Working

August 27, 2013 - 12:41am #3

Hi Alessandro,

 

thanks so much for that tip! I wasn't thinking that this could be the problem. Now the camera works, just the augmented hasn't the right texture (in fact it is just black) but I'm sure it is just a problem of assets, I'll try a rebuild. Thanks again!

 

best,

 

Solany

Camera is not Working

August 26, 2013 - 5:34am #2

Have you tried following all the steps exactly as explained in the tutorial (including steps 1 and 7 that you skipped) ?

Even if Unity allows exporting Android project, it may be worth trying the tutorial steps exactly as explained, as this has been tested and verified by many devs 

 

Log in or register to post comments