使用Eclipse发布使用相同项目的不同APK?

时间:2016-06-27 09:36:47

标签: java android eclipse

我有一个基础项目,我想从中创建多个应用程序。是一个根据Strings.xml上的变量加载数据的项目。

我只想发布三个不同的相同应用程序,第一个有一定值,第二个等等......

我正在尝试将基础项目用作库并将其用于其他三个项目,但我无法运行该应用程序。

这是我到目前为止所做的......:

在App Path中添加了库。

在Manifest中添加了'use'。

 <uses-library 
        android:name="com.example.dioniso"
        android:required="true"/>

在项目中添加了库的主要活动。

<activity
        android:name="com.example.dioniso.MainActivity"
        android:label="@string/app_name" >
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />
            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
    </activity>

我得到了:

Installation error: INSTALL_FAILED_MISSING_SHARED_LIBRARY

但是我在“问题”选项卡上没有任何错误...我该怎么办?我输了。

EDIT1:

我已删除了,现在我可以安装APP,但我现在收到此错误:

java.lang.RuntimeException: Unable to start activity ComponentInfo{com.sime.baccuscartaelecminister/com.example.dioniso.MainActivity}: java.lang.NullPointerException

当我调用一个超出'com.example.dioniso'包的函数但它进入项目时会发生这种情况。

2 个答案:

答案 0 :(得分:0)

您的图书馆项目似乎未导出到APK文件中。

尝试从Java构建路径中删除它,并通过“属性 - &gt; Android - &gt;添加...”添加了一个Android库。

答案 1 :(得分:0)

对于图书馆计划,你必须转到Properties-&gt; Android和Select Is Library,如下所示:

this overload

现在,对于使用您的库的项目,将库添加到它Properties-&gt; Android-&gt; Add.See下面的图片enter image description here