1

I have dowloaded an android app source code, and this is the only activity:

package net.itskewpie.freerdp;

import android.app.Activity;
import android.os.Bundle;

public class FreeRDPActivity extends Activity {
   /** Called when the activity is first created. */
   @Override
   public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);
        System.out.println("111111111111111111111");
        String b = test();
        System.out.println(b);

        }

   static{     
       System.loadLibrary("freerdp");
      }
   public native String test();

}

when I try to run it I get this:

08-13 14:15:34.307: W/dalvikvm(335): Exception Ljava/lang/UnsatisfiedLinkError; thrown  while initializing Lnet/itskewpie/freerdp/FreeRDPActivity;
08-13 14:15:34.317: W/dalvikvm(335): Class init failed in newInstance call (Lnet/itskewpie/freerdp/FreeRDPActivity;)
08-13 14:15:34.317: D/AndroidRuntime(335): Shutting down VM
08-13 14:15:34.317: W/dalvikvm(335): threadid=1: thread exiting with uncaught exception  (group=0x40015560)
08-13 14:15:34.357: E/AndroidRuntime(335): FATAL EXCEPTION: main
....

What's the problem?

5
  • 1
    Well it sounds like it can't find the freerdp native library... Commented Aug 13, 2013 at 14:25
  • and what can i do to solve this problem? i have to compile the native library with NDK? they are written in c Commented Aug 13, 2013 at 14:38
  • Add a System.out.println( System.getProperty("java.library.path") ) before the line System.loadLibrary("freerdp");. It will print the paths where java looks for native libraries. Make sure that freerdp (I think it would have a .so extension) resides in one of those places Commented Aug 13, 2013 at 14:44
  • 1
    I suggest you consult the freerdp documentation. I have no experience of linking native libraries on Android... Commented Aug 13, 2013 at 14:46
  • the path printed is: vendor/lib:system/lib Commented Aug 13, 2013 at 15:09

1 Answer 1

3

The exception ExceptionInInitializerError is a fatal error that is thrown when an unchecked exception is thrown (and not caught) during static initialization of a class.

The stacktrace indicates that the exception that is being thrown is UnsatisfiedLinkError. This is most likely being thrown because:

  • the runtime cannot find the native code library freerdp, or
  • the library is not defining a method implementation that matches the native method declaration FreeRDPActivity.text().
Sign up to request clarification or add additional context in comments.

5 Comments

in the folder "include->libfreerdp-core" there is freerdp.c.. i have to compile it before running the app?
@Butterfly89 - Of course you do! Did you read the freerdp build / installation instructions?
yes...excuse me,this is the first time i do this and i don't know how to move! i've read something from this page github.com/awakecoding/FreeRDP-Manuals/blob/master/Developer/… ..i've understood that i have to install NDK to do it, right?
I apologize again for the inconvenience!
Assuming that you are trying to cross-compile for Android, the instructions are here: github.com/awakecoding/FreeRDP-Manuals/blob/master/Developer/…. I can't help you further.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.