简体   繁体   中英

Publish different APKs with the same project with Eclipse?

I have a base project and I want to create multiple Apps from it. Is a project that load data depending on a variable on the Strings.xml.

I just want to publish the same application like three different, the first one has a certain value, the second another, etc...

I'm trying to use the base project as a Library and use it into other three projects but I'm not being able to run the app.

This is what I did until now...:

Added the Library in the App Path.

Added the 'use' in the Manifest.

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

Added the main activity of the library to the project.

<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>

and I'm getting:

Installation error: INSTALL_FAILED_MISSING_SHARED_LIBRARY

but I don't have any error on the Problems tab... what can I do? I'm lost.

EDIT1:

I've removed the and now I can install the APP, but I'm getting this error now:

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

This happens when I'm calling to a function that is out of the 'com.example.dioniso' package but it's into the project.

It seems that your library project does not get exported into the APK file.

try to removed it from the Java build path and added is an Android library via "Properties -> Android -> Add..."

For the Library Project ,you have to go to Properties->Android and Select Is Library as shown below:

在此处输入图片说明

Now for the projects that are using your library ,add the library to it Properties->Android->Add.See the Image below 在此处输入图片说明

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM