0

I have a project that dependents to another project for using it common classes. I refer the settings method from here: How to create a library project in Android Studio and an application project that uses the library project

After I complete the dependencies settings, the project structure becomes this: project structure The "app" is the main APP and "CH_BC_Lib" is the dependent project. But "CH_BC_Lib" project is a APP too, it has itself MainActivity. And when I build the .apk and install on a device, it comes out two icons with same icon picture and APP name:screenshot

Maybe I should modify more settings? Below is the AndroidManifest.xml of two project.

app:

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.kinpo.ch.lib_tester"
android:versionCode="1"
android:versionName="1.0" >

<uses-sdk
    android:minSdkVersion="18"
    android:targetSdkVersion="18" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>

<application
    android:allowBackup="true"
    android:icon="@drawable/f2_launcher"
    android:label="@string/app_name"
    android:theme="@style/AppTheme">
    <activity
        android:name=".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>
</application>

CH_BC_Lib:

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.ch_bc_lib"
android:versionCode="1"
android:versionName="1.0" >

<uses-sdk
    android:minSdkVersion="18"
    android:targetSdkVersion="21" />

<application
    android:allowBackup="true"
    android:label="@string/app_name"
    android:theme="@style/AppTheme" >
    <activity
        android:name="com.ch.general.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>
</application>

Community
  • 1
  • 1

0 Answers0