I am doing every single step from video: https://www.youtube.com/watch?v=kFtxo7rr2HQ but no shared libraries are generated.
Here is a version, where android-studio should generate shared libraries on his own. However when I create apropraite Makefiles and execute ndk-build, shared libraries are not generated as well.
MainActivity.java:
public native String HelloJNI();
static
{
System.loadLibrary("HelloJNI");
}
Build->Make Project
[*@* main]$ javah -d jni -classpath {sdk_dir}/platforms/android-14/android.jar:../../build/intermediates/classes/debug com.example.ndker.ndkapp.MainActivity
Creating HelloJNI.c:
#include "com_example_ndker_ndkapp_MainActivity.h"
JNIEXPORT jstring JNICALL Java_com_example_ndker_ndkapp_MainActivity_HelloJNI
(JNIEnv *, jobject) {
return (*env)->NewStringUTF(env, "Hello from jni");
}
local.properties:
sdk.dir={sdk_dir}
ndk.dir={ndk_dir}
build.grandle:
apply plugin: 'com.android.application'
android {
compileSdkVersion 21
buildToolsVersion "21.1.2"
defaultConfig {
applicationId "com.example.ndker.ndkapp"
minSdkVersion 14
targetSdkVersion 21
versionCode 1
versionName "1.0"
ndk {
moduleName "HelloJNI"
}
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:21.0.3'
}
Thank You for replies.