Application.onCreate() 未在调试版本中调用

Application.onCreate() not called in debug build

App.onCreate() 在调试版本中根本不被调用,但在发布版本中正常调用。我希望每次按下 Android Studio 的 "Run" 按钮时都会调用它。 如果我将日志放在 static{} 或 onCreate(){} 中,它们将不会出现在日志中。断点也不会命中。 Android Strudio 版本为 3.5.3,带有 gradle 插件 3.5.3。此版本没有 "Instant run" 功能。 问题在 Android Studio 3.5.1 中也可重现。 我不明白为什么会这样,因为几天前一切正常。 如何解决这个问题?它与构建系统或phone有关吗?

应用class:

public class App extends Application
{
    static
    {
        System.loadLibrary("some-library-lib");
        // Some logic
    }

    @Override
    public void onCreate()
    {
        super.onCreate();
        // Some logic
    }
}

AndroidManifest.xml

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

    <uses-permission android:name="android.permission.READ_CONTACTS" />
    <!-- Another permissions -->

    <application
        android:name=".App"
        android:allowBackup="true"
        android:icon="@mipmap/ic_launcher"
        android:label="@string/app_name"
        android:supportsRtl="true"
        android:theme="@style/AppTheme">
        <activity
            android:name=".StartupActivity"
            android:configChanges="orientation|keyboardHidden"
            android:screenOrientation="portrait"
            android:theme="@style/SplashTheme">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>

        <!-- Another activities -->

    </application>
</manifest>

我也尝试在清单中使用完整指定的 App class 名称,如:

<application
        android:name="com.my_secret.package.App"

但没有任何区别。

大约两周后问题消失了。我不知道原因 - 没有对 phone 或构建系统进行更改。
我用 release 版本工作了一段时间,然后突然安装了 debug 版本,它开始工作正常。我已经为我的所有项目安装了 debug 个版本并且它们正在运行。
也许 release/debug 交换有一些神奇的效果,但也许不是。