首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Android:无法加载系统库

Android:无法加载系统库
EN

Stack Overflow用户
提问于 2017-02-28 10:44:59
回答 1查看 926关注 0票数 1

我正在为Android机箱开发一个专有的应用程序,它读取HDMI输入,并在屏幕的一部分显示它。为此,我们使用了R9迷你安卓电视盒(链接)。供应商提供了示例应用程序的源代码来读取HDMI输入,但该应用程序未能启动抛出错误弹出(不幸的是,SourceIn已经停止)。

以下是异常堆栈跟踪:

代码语言:javascript
复制
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文件。下面是引发上述错误的代码:

代码语言:javascript
复制
static {
    System.loadLibrary("realtek_runtime");
}

我在/system/lib/文件夹中看到了.so文件,发现librealtek_runtime.so存在,所以我无法理解为什么loadLibrary会失败。

以下是有关守则:

RTKSourceInActivity:

代码语言:javascript
复制
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:

代码语言:javascript
复制
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 (realtek- .class )中的一个.class。

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

代码语言:javascript
复制
static {
    System.loadLibrary("realtek_runtime");
}

任何指向解决办法的方向都会有很大帮助。

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2017-03-01 10:11:28

2种解决办法:

  1. 我不得不使用android:sharedUserId="android.uid.system"并与相应的pempk8文件一起签名应用程序。
  2. 安装应用程序,使用adb命令将app移动到/system/目录。不是一个系统应用程序。您现在可以共享所有系统资源了。
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/42506579

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档