Android应用更新-从Google Play下载后无法打开

时间:2019-09-04 06:58:32

标签: android android-intent

我在Google Play商店中有一个应用,在我上次更新之前,它一直运行良好。现在,当用户从Google Play下载新的更新的应用程序时,它可以正确安装,但是在任何地方都找不到图标,因此无法启动该应用程序。同样在Google Play中,没有OPEN按钮,只有UNINSTALL。当我在设备上查看应用列表时,该应用已存在,但无法启动。

我唯一要做的就是-将清单添加到意图过滤器<data android:scheme="geo" />

    <?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="***">

    <uses-permission android:name="android.permission.INTERNET" />
    <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
    <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
    <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />

    <application
        android:allowBackup="false"
        android:supportsRtl="false"
        android:icon="@mipmap/ic_launcher"
        android:label="@string/app_name"
        android:roundIcon="@mipmap/ic_launcher"
        android:theme="@style/Theme.AppCompat.NoActionBar">

        <meta-data
            android:name="com.google.firebase.messaging.default_notification_icon"
            android:resource="@mipmap/ic_notify" />
        <meta-data
            android:name="com.google.firebase.messaging.default_notification_color"
            android:resource="@color/colorPrimaryDark" />
        <meta-data
            android:name="com.google.firebase.messaging.default_notification_channel_id"
            android:value="@string/default_notification_channel_id" />

        <activity
            android:name=".MainActivity"
            android:label="@string/app_name"
            android:screenOrientation="portrait">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <action android:name="android.intent.action.VIEW" />
                <data android:scheme="geo" />

                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
        <activity
            android:name=".Novinky"
            android:label="Novinky"
            android:parentActivityName=".MainActivity"
            android:screenOrientation="portrait"
            android:theme="@style/AppTheme" />
        <activity
            android:name=".Search"
            android:label="Search"
            android:screenOrientation="portrait"
            android:theme="@style/AppTheme" />
        <activity
            android:name=".Zoznam"
            android:label="Zoznam"
            android:screenOrientation="portrait"
            android:theme="@style/AppTheme" />
        <activity
            android:name=".Visited"
            android:label="Visited"
            android:screenOrientation="portrait"
            android:theme="@style/AppTheme" />
        <activity
            android:name=".Okoli"
            android:label="V okoli"

            android:parentActivityName=".MainActivity"
            android:screenOrientation="portrait"
            android:theme="@style/AppTheme" />
        <activity
            android:name=".SingleitemView"
            android:label="@string/app_name"
            android:screenOrientation="portrait"
            android:theme="@style/AppTheme" />

        <meta-data
            android:name="com.google.android.geo.API_KEY"
            android:value="@string/google_maps_key" />

        <activity
            android:name=".MapsActivity"
            android:label="Mapy"
            android:theme="@style/AppTheme" />
        <activity
            android:name=".AkcieActivity"
            android:label="Udalosti"
            android:screenOrientation="portrait"
            android:theme="@style/AppTheme" />
        <activity
            android:name=".InfoActivity"
            android:screenOrientation="portrait"
            android:theme="@style/AppTheme" />


        <!-- [START firebase_iid_service] -->
        <service
            android:name=".MyFirebaseMessagingService"
            android:exported="false">
            <intent-filter>
                <action android:name="com.google.firebase.MESSAGING_EVENT" />
            </intent-filter>
        </service> <!-- [END firebase_iid_service] -->
        <service
            android:name=".MyFirebaseInstanceIDService"
            android:exported="false">
            <intent-filter>
                <action android:name="com.google.firebase.INSTANCE_ID_EVENT" />
            </intent-filter>
        </service>
    </application>

</manifest>

第二件事是更新我的Gradle文件,以忽略对语言的拆分:

 apply plugin: 'com.android.application'
apply plugin: 'io.fabric'


android {
    compileSdkVersion 29
    defaultConfig {
        applicationId "***"
        minSdkVersion 23
        targetSdkVersion 29
        versionCode 11
        versionName "2.01"
        ndk.abiFilters 'armeabi-v7a','arm64-v8a','x86','x86_64'
        testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
    bundle {

        language {
            enableSplit = false
        }
    }
}


dependencies {
    implementation fileTree(dir: 'libs', include: ['*.jar'])
    implementation 'androidx.appcompat:appcompat:1.0.2'
    implementation "androidx.preference:preference:1.1.0-rc01"
    implementation 'androidx.legacy:legacy-support-v4:1.0.0'
    implementation 'com.google.android.gms:play-services-maps:17.0.0'
    testImplementation 'junit:junit:4.12'
    implementation 'com.google.firebase:firebase-core:17.1.0'
    implementation 'com.google.firebase:firebase-analytics:17.1.0'
    implementation 'com.crashlytics.sdk.android:crashlytics:2.10.1'
    implementation 'com.google.firebase:firebase-messaging:20.0.0'
    androidTestImplementation 'androidx.test:runner:1.2.0'
    androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
    implementation 'com.squareup.picasso:picasso:2.5.2'
    implementation 'com.google.android.material:material:1.0.0'


}
apply plugin: 'com.google.gms.google-services'

我怀疑,新添加到intent-filter的geo方案可能会导致此问题或enableSplit选项,但我不确定。当我通过Android Studio在设备上测试该应用程序时,它运行良好,该问题仅在发布后出现。

1 个答案:

答案 0 :(得分:1)

我不确定这是否行得通。但是,您可以尝试使用以下两种不同的Intent过滤器:-

<activity
            android:name=".MainActivity"
            android:label="@string/app_name"
            android:screenOrientation="portrait">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
 <intent-filter>
  <action android:name="android.intent.action.VIEW" />
                <data android:scheme="geo" />
 </intent-filter>
        </activity>

编辑:-我刚刚注意到@Trix也建议这样做。