代码之家  ›  专栏  ›  技术社区  ›  raj kavadia

android stdio为1个packege安装2个apk

  •  0
  • raj kavadia  · 技术社区  · 6 年前

    我在android studio有一个项目,其中我只有一个包,在生成签名的apk或调试应用程序时,它安装了两个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'
    
    }
    
    0 回复  |  直到 6 年前
        1
  •  4
  •   DeË£    6 年前

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

    1. 打开 AndroidManifest 文件。点击 Merged Manifest 选项卡(在IDE的底部)。
    2. 搜索 Activity LAUNCHER 意向过滤器。
    3. 如果有的话 发射器 活动 除了你之外,那是罪魁祸首。
    4. 可以修改或更新库 仙女座舱单 归档并从启动程序中删除活动。如果该库不是您自己的,并且您无法更新 仙女座舱单 文件,您应该尝试其他库。

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