Absolutely new to android development and java so problem may be trivial, but I already confused about what to try or read or google next so please help. Trying to create an application that should be doing some batch processing on selected set of images. Found a library that perfectly suit my needs, connected it and wrote a simple test, that had to check out if everything works as it should:
if (requestCode == SELECT_PICTURE && resultCode == RESULT_OK && null != data) {
Uri selectedImageUri = data.getData();
m_ImagePath = getRealPathFromUri(selectedImageUri);
try {
m_MagickImage = new MagickImage(new ImageInfo(m_ImagePath));
m_EffectImage = m_MagickImage.rotateImage(90);
m_Bitmap = MagickBitmap.ToReducedBitmap(m_EffectImage, 1000);
} catch (MagickException e) {
Log.d(LOGTAG, e.toString());
}
ImageView imageview = (ImageView) findViewById(R.id.imageView);
imageview.setImageBitmap(m_Bitmap);
//imageview.setImageURI(selectedImageUri);
openFileButton.setVisibility(View.GONE);
}
Project builds completely fine with no warnings, but when I deployed it on real hardware and clicked button assigned to written test, I got the following error in logcat:
JNI DETECTED ERROR IN APPLICATION: GetStringUTFChars received NULL jstring
in call to GetStringUTFChars
from void magick.ImageInfo.setFileName(java.lang.String)
"main" prio=5 tid=1 Runnable
And 200 strings more of system information and warnings (don't think they are important but can provide everything needed on demand).
Also after that run i got plenty of red warnings like
cannot resolve corresponding jni function Java_magick_ImageInfo_setFileName
In almost every java file related to Android-Imagemagick.
Library was connected as .jar file, following instructions I found in this thread. Here's my setup:
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
compile 'com.android.support:appcompat-v7:25.0.0'
compile 'com.android.support:design:25.0.0'
testCompile 'junit:junit:4.12'
}
and
sourceSets {
main {
java.srcDirs = ['src/main/java']
}
}
In build.gradle.
armeabi.jar with .so files in 'libs' directory in root of project, 'fakeawt' and 'magick' folders with wrapper classes in 'src/main/java', and
static {
System.loadLibrary("imagemagick");
}
At the beginning of Main.java.
Any idea what might go wrong and how to fix it properly?