应用程序未显示在 Laucher 列表中且无法打开

App doesn't show up in Laucher List and can't be opened

我制作了一个应用程序,直到昨天都运行良好。 不知何故我打破了它没有出现在启动器的应用程序列表中。我只能通过设置中的应用选项卡卸载。

因为我已经在 Play Store 上做了一个测试版,所以我试图在那里打开它,但那里只显示了 "Uninstall" 按钮。

我认为它必须与 Manifest 或 build.gradle 做一些事情。 所以他们在这里:

清单:

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

            <uses-permission android:name="android.permission.INTERNET" />

            <application
                android:allowBackup="true"
                android:icon="@mipmap/ic_launcher"
                android:label="@string/app_name"
                android:roundIcon="@mipmap/ic_launcher_round"
                android:supportsRtl="true"
                android:theme="@style/AppTheme">
                <activity android:name=".MainActivity">
                    <intent-filter>

                        <action android:name="android.intent.action.SEND"/>
                        <category android:name="android.intent.category.DEFAULT"/>
                        <data android:mimeType="text/*"/>

                        <action android:name="android.intent.action.MAIN" />
                        <category android:name="android.intent.category.LAUNCHER" />
                    </intent-filter>
                </activity>
                <activity android:name=".Information"></activity>
            </application>
        </manifest>

这里是 build.gradle(模块:App):

        apply plugin: 'com.android.application'
        android {
            lintOptions {
                checkReleaseBuilds false
                // Or, if you prefer, you can continue to check for errors in release builds,
                // but continue the build even when errors are found:
                abortOnError false
            }
            signingConfigs {
            }
            compileSdkVersion 27
            defaultConfig {
                applicationId "at.mrminemeet.reviewcheck"
                minSdkVersion 21
                targetSdkVersion 27
                versionCode 1
                versionName '0.1'
                testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
            }
            buildTypes {
                release {
                    minifyEnabled true
                    proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
                }
            }
            productFlavors {
            }
        }

        dependencies {
            implementation fileTree(include: ['*.jar'], dir: 'libs')
            implementation 'com.android.support:appcompat-v7:27.1.0'
            implementation 'com.android.support.constraint:constraint-layout:1.0.2'
            testImplementation 'junit:junit:4.12'
            androidTestImplementation 'com.android.support.test:runner:1.0.1'
            androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1'
            implementation 'com.android.support:gridlayout-v7:27.1.0'
            implementation 'com.android.support:recyclerview-v7:27.1.0'
            implementation 'com.android.support:design:27.1.0'
            implementation 'com.google.android.gms:play-services-ads:12.0.0'
        }

如果您需要其他文件,请对其进行评论。

如果你想使用多个 category 那么你需要创建另一个 intent-filter

像这样

<activity android:name=".MainActivity">
            <intent-filter>
                <action android:name="android.intent.action.SEND"/>
                <category android:name="android.intent.category.DEFAULT"/>
                <data android:mimeType="text/*"/>
             </intent-filter>

             <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
 </activity>

Link 到文档 https://developer.android.com/guide/components/intents-filters.html#ExampleFilters