I am using android ndk in eclipse. I got my project compiled but am facing errors at run time. I have the libcrytpoNative.so
and libsslNative.so
files but I am getting this error about libcrypto.so.1.0.0
not found error. How should I fix this?
This is the output of ndk-build V=1
Android NDK: WARNING: APP_PLATFORM android-21 is larger than android:minSdkVersion 14 in ./AndroidManifest.xml
rm -f ./libs/arm64-v8a/lib*.so ./libs/armeabi/lib*.so ./libs/armeabi-v7a/lib*.so ./libs/armeabi-v7a-hard/lib*.so ./libs/mips/lib*.so ./libs/mips64/lib*.so ./libs/x86/lib*.so ./libs/x86_64/lib*.so
rm -f ./libs/arm64-v8a/gdbserver ./libs/armeabi/gdbserver ./libs/armeabi-v7a/gdbserver ./libs/armeabi-v7a-hard/gdbserver ./libs/mips/gdbserver ./libs/mips64/gdbserver ./libs/x86/gdbserver ./libs/x86_64/gdbserver
rm -f ./libs/arm64-v8a/gdb.setup ./libs/armeabi/gdb.setup ./libs/armeabi-v7a/gdb.setup ./libs/armeabi-v7a-hard/gdb.setup ./libs/mips/gdb.setup ./libs/mips64/gdb.setup ./libs/x86/gdb.setup ./libs/x86_64/gdb.setup
[armeabi-v7a] Install : libcpabe.so => libs/armeabi-v7a/libcpabe.so
install -p ./obj/local/armeabi-v7a/libcpabe.so ./libs/armeabi-v7a/libcpabe.so
/home/yogi/android-ndk/toolchains/arm-linux-androideabi-4.8/prebuilt/linux-x86_64/bin/arm-linux-androideabi-strip --strip-unneeded ./libs/armeabi-v7a/libcpabe.so
[armeabi-v7a] Install : libcryptoNative.so => libs/armeabi-v7a/libcryptoNative.so
install -p ./obj/local/armeabi-v7a/libcryptoNative.so ./libs/armeabi-v7a/libcryptoNative.so
/home/yogi/android-ndk/toolchains/arm-linux-androideabi-4.8/prebuilt/linux-x86_64/bin/arm-linux-androideabi-strip --strip-unneeded ./libs/armeabi-v7a/libcryptoNative.so
[armeabi-v7a] Install : libglib.so => libs/armeabi-v7a/libglib.so
install -p ./obj/local/armeabi-v7a/libglib.so ./libs/armeabi-v7a/libglib.so
/home/yogi/android-ndk/toolchains/arm-linux-androideabi-4.8/prebuilt/linux-x86_64/bin/arm-linux-androideabi-strip --strip-unneeded ./libs/armeabi-v7a/libglib.so
[armeabi-v7a] Install : libgmp.so => libs/armeabi-v7a/libgmp.so
install -p ./obj/local/armeabi-v7a/libgmp.so ./libs/armeabi-v7a/libgmp.so
/home/yogi/android-ndk/toolchains/arm-linux-androideabi-4.8/prebuilt/linux-x86_64/bin/arm-linux-androideabi-strip --strip-unneeded ./libs/armeabi-v7a/libgmp.so
[armeabi-v7a] Install : libpbc.so => libs/armeabi-v7a/libpbc.so
install -p ./obj/local/armeabi-v7a/libpbc.so ./libs/armeabi-v7a/libpbc.so
/home/yogi/android-ndk/toolchains/arm-linux-androideabi-4.8/prebuilt/linux-x86_64/bin/arm-linux-androideabi-strip --strip-unneeded ./libs/armeabi-v7a/libpbc.so
[armeabi-v7a] Install : libsslNative.so => libs/armeabi-v7a/libsslNative.so
install -p ./obj/local/armeabi-v7a/libsslNative.so ./libs/armeabi-v7a/libsslNative.so
/home/yogi/android-ndk/toolchains/arm-linux-androideabi-4.8/prebuilt/linux-x86_64/bin/arm-linux-androideabi-strip --strip-unneeded ./libs/armeabi-v7a/libsslNative.so
This is the MainActivity.java that loads libs:
package com.example.myproject;
import android.app.Activity;
import android.os.Bundle;
import android.view.Menu;
import android.view.MenuItem;
import android.widget.TextView;
public class MainActivity extends Activity {
static {
System.loadLibrary("gmp");
// System.loadLibrary("ssl");
// System.loadLibrary("crypto");
System.loadLibrary("glib");
System.loadLibrary("pbc");
System.loadLibrary("sslNative");
System.loadLibrary("cryptoNative");
System.loadLibrary("cpabe");
}
//System.loadLibrary("ssl_static");
public static native void InitMainActivityjni();
public native String cpabeNative();
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
//setContentView(R.layout.activity_main);
TextView tv = new TextView(this);
tv.setText(cpabeNative());
setContentView(tv);
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
// Inflate the menu; this adds items to the action bar if it is present.
getMenuInflater().inflate(R.menu.main, menu);
return true;
}
@Override
public boolean onOptionsItemSelected(MenuItem item) {
// Handle action bar item clicks here. The action bar will
// automatically handle clicks on the Home/Up button, so long
// as you specify a parent activity in AndroidManifest.xml.
int id = item.getItemId();
if (id == R.id.action_settings) {
return true;
}
return super.onOptionsItemSelected(item);
}
}
Thanks
System.loadLibray(libname)
. – soniclibcrytpo.so
andlibssl.so
. – jwwndk-build V=1
by hand. Then, post the results to Pastebin. (Does Stack Overflow have a Pastebin like-service?) – jww