Activity 未列入白名单

Activity not whitelisted

我最近在 google play 上启动了一个应用程序。它在我的调试版本上运行良好,但当我从 google play 下载发布版本时它开始崩溃。我现在尝试安装通过 android studio 生成的 app-release.apk(虽然我上传了 app.abb 包,但我不知道如何从中获取 apk),它给了我以下日志:

2019-08-27 05:46:09.978 819-852/? E/ANDR-PERF-MPCTL: Invalid profile no. 0, total profiles 0 only
2019-08-27 05:46:09.982 1449-8273/? E/ANDR-PERF-JNI: Iop tryGetService failed
2019-08-27 05:46:09.998 1449-8273/? E/ActivityTrigger: activityStartTrigger: not whiteListedin.curioustools.water_reminder/in.curioustools.water_reminder.ui.StartActivity/1
2019-08-27 05:46:09.998 1449-8273/? E/ActivityTrigger: activityResumeTrigger: not whiteListedin.curioustools.water_reminder/in.curioustools.water_reminder.ui.StartActivity/1
2019-08-27 05:46:10.008 1449-10327/? E/ActivityTrigger: activityResumeTrigger: not whiteListedin.curioustools.water_reminder/in.curioustools.water_reminder.ui.StartActivity/1
2019-08-27 05:46:10.041 23961-23961/? E/.water_reminde: Not starting debugger since process cannot load the jdwp agent.
...

完整日志为 here。我做错了什么?为什么我的 activity 没有被列入白名单?这是我的 activity 和清单:

//manifest

<?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="in.curioustools.water_reminder">

    <application
        android:allowBackup="true"
        android:fullBackupContent="true"
        android:icon="@mipmap/ic_launcher"
        android:label="@string/app_name"
        android:roundIcon="@mipmap/ic_launcher_round"
        android:supportsRtl="true"
        android:theme="@style/AppTheme"
        tools:ignore="GoogleAppIndexingWarning">
        <activity
            android:name=".ui.screen_dashboard.DashBoardActivity"
            android:configChanges="orientation|keyboardHidden"
            android:screenOrientation="portrait"
            />

        <activity
            android:name=".ui.screen_intro.IntroInfoActivity"
            android:configChanges="orientation|keyboardHidden"
            android:screenOrientation="portrait"
            />
        <activity android:name=".ui.StartActivity"
            android:configChanges="orientation|keyboardHidden"
            android:screenOrientation="portrait"
            >
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>

        <receiver android:name=".broadcast_recievers.NotificationActionReceiver" />
    </application>

</manifest>

和:

//StartActivitty.java
package in.curioustools.water_reminder.ui;

        import android.content.Intent;
        import android.content.SharedPreferences;
        import android.os.Bundle;

        import androidx.appcompat.app.AppCompatActivity;

        import in.curioustools.water_reminder.R;
        import in.curioustools.water_reminder.services.ServicesHandler;
        import in.curioustools.water_reminder.ui.screen_intro.IntroInfoActivity;
        import in.curioustools.water_reminder.ui.screen_dashboard.DashBoardActivity;

        import static in.curioustools.water_reminder.db.pref.PrefUserDetails.*;

public class StartActivity extends AppCompatActivity {

    //private static final String TAG = "startActivity";
    Class classToBeLaunched;


    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_start);

        ServicesHandler.updateServices(this);

        SharedPreferences pref= getSharedPreferences(PREF_NAME, MODE_PRIVATE);
        boolean shownOneTime=pref.getBoolean(KEYS.KEY_SHOWN_INFO_ACTIVITY, Defaults.HAS_SHOWN_INTRO_INFO_ACTIVITY);
        classToBeLaunched = shownOneTime ?DashBoardActivity.class:IntroInfoActivity.class;
        startActivity(new Intent(StartActivity.this, classToBeLaunched));
        finish();

    }

}

我在 gradle 中禁用了代码压缩,问题已解决

android {
    buildTypes {
        release {
            minifyEnabled false
        }
    }
}

minifyEnabled=false 默认情况下在您使用 Android Studio 创建的所有新项目上用于调试和发布配置。即使在这种情况下,您也可能会在 Logcat 中看到以下错误:

E/ActivityTrigger: activityStartTrigger: not whiteListe** E/ActivityTrigger: activityResumeTrigger: not whiteListe**

在我的案例中,它们前面是 android 调试消息

The activity in ApplicationInfo {********} is now in focus and seems to be in full-screen mode.

最后一个不正确,因为测试的应用程序不要求全屏模式。