2017-02-28 488 views
1

我正在开发一款专用Android应用程序的应用程序,它可以读取HDMI输入并将其显示在屏幕的一部分中。为此我们使用R9迷你Android TV盒(link)。供应商提供了示例应用程序的源代码以读取HDMI输入,但该应用程序未能启动抛出错误弹出窗口(不幸的是,SourceIn已停止)。Android:无法加载系统库

以下是异常堆栈跟踪:

02-28 15:38:36.988 3232-3232/rtk.com.RealtekSourceIn W/art: Method processed more than once: void android.app.Instrumentation.callActivityOnResume(android.app.Activity) 
02-28 15:38:37.090 3232-3232/rtk.com.RealtekSourceIn A/art: art/runtime/barrier.cc:90] Check failed: count_ == 0 (count_=-1, 0=0) Attempted to destroy barrier with non zero count 
02-28 15:38:37.090 3232-3232/rtk.com.RealtekSourceIn A/art: art/runtime/runtime.cc:366] Runtime aborting --- recursively, so no thread-specific detail! 
02-28 15:38:37.090 3232-3232/rtk.com.RealtekSourceIn A/art: art/runtime/runtime.cc:366] 
02-28 15:38:37.090 3232-3232/rtk.com.RealtekSourceIn A/libc: Fatal signal 6 (SIGABRT), code -6 in tid 3232 (RealtekSourceIn) 

的崩溃是从库的依赖中的代码开始。调试反编译的.class文件。以下是其中被抛出上述错误代码:

static { 
    System.loadLibrary("realtek_runtime"); 
} 

我已经看到/系统/ lib目录/文件夹中的.so文件,发现librealtek_runtime.so在场,所以我无法理解为什么调用LoadLibrary失败。

以下是相关的代码:

RTKSourceInActivity:

public class RTKSourceInActivity extends Activity { 

    private String TAG="HDMIRxActivity"; 
    private ViewGroup m_Root; 
    private HDMIRxPlayer m_HDMIRxPlayer = null; 
    private final Handler mHandler = new Handler(); 
    private byte[] mCapture; 
    private static final long SCREENSHOT_SLOT = 200; 
    private boolean mIsFullScreen = true; 

    private File mRecordFile; 
    private boolean mRecordOn = false; 

    @Override 
    public void onResume() { 
     Log.d(TAG,"onResume"); 
     super.onResume(); 
     if(hasRtkMusicPlaybackService()) { 
      Intent i = new Intent("com.android.music.musicservicecommand"); 
      i.putExtra("command", "stop"); 
      sendBroadcast(i); 
     } 
     m_Root = (ViewGroup) findViewById(R.id.root); 
     m_HDMIRxPlayer = new HDMIRxPlayer(this, m_Root, 1920, 1080); 
    } 

... 
} 

HDMIRxPlayer:

public HDMIRxPlayer(Context context, ViewGroup parent, int width, int height) 
{ 
    mContext = context; 
    mSurfaceView = new SurfaceView(context); 
    mSurfaceHolder = mSurfaceView.getHolder(); 
    mSurfaceHolder.addCallback(HDMIRXCallback); 
    mSurfaceHolder.setFixedSize(width, height); 
    parent.addView(mSurfaceView); 

    mHDMIRX = new RtkHDMIRxManager(); // Exception here 

    IntentFilter hdmiRxFilter = new IntentFilter(HDMIRxStatus.ACTION_HDMIRX_PLUGGED); 
    mContext.registerReceiver(hdmiRxHotPlugReceiver, hdmiRxFilter); 
} 

RtkHDMIRxManager是由供应商提供的相关性JAR(瑞昱类)内一个.class 。

当我放置RtkHDMIRxManager反编译的版本中调试点,我发现异常的:

static { 
    System.loadLibrary("realtek_runtime"); 
} 

任何朝着解决方法的将有很大的帮助的方向。

回答

0

2种方式解决:

  1. 我不得不使用android:sharedUserId="android.uid.system"并与相应的pempk8文件签名的应用程序。

  2. 安装该应用程序,使用adb命令将应用程序移动到/ system /目录中。不是它是一个系统应用程序。您现在可以共享所有系统资源。