Search code examples
androidandroid-emulatoraugmented-reality

While running augmented reality app showing UnsatisfiedLinkError


I am doing an Augmented Reality application. Here I have Java Eclipse SDK . So I didn't change anything in the Eclipse SDK and Java. I didn't set any path for SDK also and I just downloaded and installed cygwin then I set path for that. I again installed vuforia.exe file and I set path in Eclipse preferences to vuforia and again download NDK. I just extact those ndk and copy in sdk root folder and I set path to ndk. Now I have downloaded vuforia sample apps and I copied all apps in samples folder. In Eclipse I just imported ImageTarget application and it's not showing any error but after running that while clicking start button I'm getting this error:

java.lang.UnsatisfiedLinkError: getOpenGlEsVersionNative

I checked QCAR jar in order and export and I cleaned my app but I am getting same exception can any one suggest me where I went wrong?

ImageTargets.class:

public class ImageTargets extends Activity
{
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
    }
}

Solution

  • You should build the native code (C++) by running ndk-build command from cygwin command-line. Open up the Cygwin.bat in your installation directory to access the command-line and change the directory to the root folder of ImageTarget project and run this:

    ndk-build
    

    If it successfully builds the native codes, you should see a lib folder added to your project in Eclipse. Now, you may build your APK and run it on your device.

    Alternatively, you can set an automatic NDK build in Eclipse that runs before every time you build your project. So you you don't need to do it manually. See Setting up Automatic NDK Builds in Eclipse.