1

I have a NativeActivity Application project in VisualStudio2015. It's using opengles 3.0, and I can build and install successfully on my phone. I want to add opencv, so I added Include header file and so file to my project properties. Build succeeds, but when installing on my phone an error occurs.

It's a NativeActivity Application project, so I added android:hasCode="false" in AndroidManifest.xml because there no Java code inside the project.

<!-- This is the platform API where NativeActivity was introduced. -->
<uses-sdk android:minSdkVersion="18" android:targetSdkVersion="19"/>

<!-- This .apk has no Java code itself, so set hasCode to false. -->
<application android:label="@string/app_name" android:hasCode="false">

    <!-- Our activity is the built-in NativeActivity framework class.
         This will take care of integrating with our NDK code. -->
    <activity android:name="android.app.NativeActivity" android:label="@string/app_name" android:screenOrientation="landscape" android:configChanges="orientation|keyboardHidden">
        <!-- Tell NativeActivity the name of our .so -->
        <meta-data android:name="android.app.lib_name" android:value="$(AndroidAppLibName)"/>
        <intent-filter>
            <action android:name="android.intent.action.MAIN"/>
            <category android:name="android.intent.category.LAUNCHER"/>
        </intent-filter>
    </activity>
</application>

Perhaps I should add

static { system.loadlibrary("opencv_java3")}

but how can I do that, when there's no Java code inside the project?

Entreco
  • 12,738
  • 8
  • 75
  • 95

0 Answers0