2017-02-28 58 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 /目錄中。不是它是一個系統應用程序。您現在可以共享所有系統資源。