安装了两个具有相同程序包名称的应用

时间:2019-06-12 08:24:30

标签: android

我在android studio中有一个项目,其中我只有1个软件包,并且在生成签名的apk或调试应用程序时,它会安装2个apk文件,两者都打开同一个apk。我不确定问题出在哪里。我可以得到一些建议吗?

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
package="com.example.myapplication">
<uses-permission
    android:name="android.permission.INSTALL_LOCATION_PROVIDER"
    tools:ignore="ProtectedPermissions" />
<application
    android:name="androidx.multidex.MultiDexApplication"
    android:allowBackup="true"
    android:icon="@mipmap/ic_launcher"
    android:label="@string/app_name"
    android:hardwareAccelerated="true"
    android:screenOrientation="portrait"
    android:supportsRtl="true"
    android:testOnly="false"
    android:theme="@style/AppTheme"
    android:usesCleartextTraffic="true"
    tools:ignore="GoogleAppIndexingWarning,HardcodedDebugMode"
    tools:targetApi="m">
    <activity android:name="com.example.myapplication.Activity.ImageViewer" />
    <activity
        android:name="com.example.myapplication.Fragments.LeadManagement.ProcessingLeadUpdate"
        android:theme="@style/AppTheme.NoActionBar" >
    </activity>
    <activity
        android:name="com.example.myapplication.Activity.Splash"
        android:configChanges="orientation|screenSize|keyboardHidden"
        android:noHistory="false"
        android:theme="@style/AppTheme.NoActionBar"
        android:usesCleartextTraffic="true">
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />
            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
    </activity>
    <activity
        android:name="com.example.myapplication.Activity.MainActivity"
        android:configChanges="orientation|screenSize|keyboardHidden"
        android:label="@string/app_name"
        android:noHistory="false"
        android:theme="@style/AppTheme.NoActionBar"
        android:usesCleartextTraffic="true"
        android:windowSoftInputMode="adjustResize" />
    <activity
        android:name="com.schibstedspain.leku.LocationPickerActivity"
        android:label="@string/leku_title_activity_location_picker"
        android:theme="@style/Theme.AppCompat.Light.NoActionBar"
        android:windowSoftInputMode="adjustPan">
        <meta-data
            android:name="android.app.searchable"
            android:resource="@xml/leku_searchable" />
    </activity>
</application>

我认为问题出在清单文件中,因此我在此处发布清单文件。 应用级别的build.gradle文件

apply plugin: 'com.android.application'

android {
compileSdkVersion 28

configurations {
    all {
        exclude module: 'httpclient'
        exclude module: 'json'
        exclude group: 'org.apache.httpcomponents'
    }
}
defaultConfig {
    applicationId "com.example.myapplication"
    minSdkVersion 17
    targetSdkVersion 28
    multiDexEnabled true
    versionCode 1
    versionName "1.0"
    testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"

}

buildTypes {
    release {
        proguardFiles getDefaultProguardFile('proguard-android- 
optimize.txt'), 'proguard-rules.pro'
        debuggable false
    }
}
compileOptions {
    sourceCompatibility = '1.8'
    targetCompatibility = '1.8'
}

}

dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'androidx.multidex:multidex:2.0.1'
implementation 'androidx.cardview:cardview:1.0.0'
implementation 'androidx.recyclerview:recyclerview:1.1.0-alpha05'
implementation 'androidx.appcompat:appcompat:1.1.0-alpha05'
implementation 'androidx.constraintlayout:constraintlayout:2.0.0-beta1'
implementation 'androidx.legacy:legacy-preference-v14:1.0.0'
implementation 'com.google.android.material:material:1.1.0-alpha06'
implementation 'com.fasterxml.jackson.core:jackson-core:2.9.8'
implementation 'com.fasterxml.jackson.core:jackson-annotations:2.9.8'
implementation 'com.fasterxml.jackson.core:jackson-databind:2.9.8'
implementation 'com.squareup.okhttp3:okhttp:3.14.0'
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
testImplementation 'junit:junit:4.12'
implementation 'com.goebl:david-webb:1.3.0'
implementation 'com.squareup.retrofit2:retrofit:2.5.0'
implementation 'com.squareup.retrofit2:converter-gson:2.5.0'
implementation 'de.hdodenhof:circleimageview:3.0.0'
implementation 'com.google.code.gson:gson:2.8.5'
implementation 'com.android.volley:volley:1.1.1'
implementation 'com.airbnb.android:lottie:3.0.0'
implementation 'com.github.aliumujib:Nibo:2.0'
implementation 'com.google.guava:guava:27.1-android'
implementation 'androidx.fragment:fragment:1.0.0'
implementation('com.schibstedspain.android:leku:6.1.1') {
    exclude group: 'com.google.android.gms'
    exclude group: 'androidx.appcompat'
}
implementation 'com.google.android.gms:play-services-location:16.0.0'
implementation 'com.google.android.gms:play-services-places:16.1.0'
implementation 'com.google.android.gms:play-services-maps:16.1.0'
implementation 'com.google.maps.android:android-maps-utils:0.5'
implementation 'com.github.prabhat1707:EasyWayLocation:1.0'
implementation 'com.ryanjeffreybrooks:indefinitepagerindicator:1.0.10'
implementation 'androidx.viewpager:viewpager:1.0.0'
implementation 'com.github.sharish:ShimmerRecyclerView:v1.3'
implementation 'com.facebook.shimmer:shimmer:0.4.0'
implementation 'com.github.developer-shivam:Crescento:1.2.1'
implementation 'io.reactivex.rxjava2:rxandroid:2.1.0'
implementation 'com.camerakit:camerakit:1.0.0-beta3.11'
implementation 'com.camerakit:jpegkit:0.1.0'
implementation 'org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.3.31'
implementation 'com.github.PauloLinhares09:RetroPicker:1.2.3-Beta1'
implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-android:1.0.0'
implementation 'com.jsibbold:zoomage:1.2.0'
implementation 'id.zelory:compressor:2.1.0'
compile 'com.github.hkk595:Resizer:v1.5'

}

1 个答案:

答案 0 :(得分:4)

感觉您的应用程序正在从某个库中获取活动。

  1. 打开AndroidManifest文件。单击Merged Manifest标签(在IDE底部)。
  2. 搜索具有Activity个意图过滤器的LAUNCHER
  3. 如果您之外还有LAUNCHER Activity,那就是罪魁祸首。
  4. 您可以修改或更新库AndroidManifest文件,并从启动器中删除活动。如果该库不是您自己的库,并且您无法更新AndroidManifest文件,则应尝试其他库。

在这里,现在创建您已签名的构建或调试,您将只有一个启动器图标。