【问题标题】:Vitamio library doesn't link ? Could not find method io.vov.vitamio.LibsChecker.checkVitamioLibsVitamio 库没有链接?找不到方法 io.vov.vitamio.LibsChecker.checkVitamioLibs
【发布时间】:2014-12-09 17:52:14
【问题描述】:

我正在尝试在我的项目中使用 vitamio 库,从 https://github.com/yixia/VitamioBundle/tree/v3.0 并作为 Eclipse 库项目导入。

然后我创建了一个使用库(项目属性/ Androd / 添加库)的测试项目,一切似乎都是正确的,并且 vitamio 资源包含在测试项目树中,测试活动 xml 如下(从另一个 StOv 帖子):

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout android:id="@+id/LinearLayout01"
        android:layout_height="fill_parent"
         xmlns:android="http://schemas.android.com/apk/res/android"
        android:paddingLeft="2px" android:paddingRight="2px"
        android:paddingTop="2px" android:paddingBottom="2px"
        android:layout_width="fill_parent" android:orientation="vertical">

        <io.vov.vitamio.widget.VideoView
             android:layout_height="fill_parent"
             android:layout_width="fill_parent"   android:id="@+id/VideoView">               
        </io.vov.vitamio.widget.VideoView>
</LinearLayout>

及相关代码:

public class Test extends Activity{

io.vov.vitamio.widget.VideoView videoView;

private void test_2(){
    String httpLiveUrl = "rtsp://somevideostream";   
    videoView = (VideoView) findViewById(R.id.VideoView);
    videoView.setVideoURI(Uri.parse(httpLiveUrl));
    MediaController mediaController = new MediaController(this);
    videoView.setMediaController(mediaController);
    videoView.requestFocus();
    videoView.start();
}


public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.tv);
    if (!io.vov.vitamio.LibsChecker.checkVitamioLibs(this)) return;
    test_2();             
}     
}

在测试清单文件中,vitamio 库活动“InitActvity”正确输入如下

<activity
        android:name="io.vov.vitamio.activity.InitActivity"
        android:configChanges="orientation|keyboardHidden|navigation"
        android:launchMode="singleTop"
        android:theme="@android:style/Theme.NoTitleBar"
        android:windowSoftInputMode="stateAlwaysHidden" />  

一切看起来都很好,项目编译并构建,然后当我尝试运行代码(在模拟器和 arm7 设备上)时,我得到了:

找不到方法 io.vov.vitamio.LibsChecker.checkVitamioLibs 和 VFY: 无法解析静态方法 312: Lio/vov/vitamio/LibsChecker;.checkVitamioLibs (Landroid/app/Activity;)Z

解析 Lio/vov/vitamio/widget/VideoView$1 失败;接口 126 'Lio/vov/vitamio/MediaPlayer$OnVideoSizeChangedListener;' 测试应用显示一条对话框消息,说明它已强制关闭。

换句话说,在构建 apk 时,整个 Vitamio 库似乎还没有在项目中构建(链接),即使在 eclipse 树中 eve 似乎还可以。

有什么想法吗?

提前通知所有人。

【问题讨论】:

标签: eclipse libraries vitamio


【解决方案1】:

向 Eclipse 添加库:

从 GitHub 下载 VitamioBundle-master 后,打开根文件夹,您将拥有 2 个应用程序 1)维生素 2)维生素样品

现在打开 eclipse 并导入 2 个应用程序

1)右键单击 Vitamio Sample 选择 Properties 然后 Andriod,在库中 部分单击添加按钮,然后选择一个库项目,在我们的例子中(Vitamio App)最后 申请并点击确定。

2)你终于摆脱了编译时错误。

【讨论】:

    猜你喜欢
    • 2011-08-06
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多