Tuesday 22 September 2020

Default Activity Not Found with two different dimensions

I needed to use two different dimensions in the project. But after this usage, whatever I do, Android Studio tells me "Default Activity Not Found". Actually there's no changes in the src folder because I don't need to modify any classes in the flavors.

flavorDimensions "device", "backend"

productFlavors {
    dev {
        buildConfigField "String", "API_VERSION", "\"1.1\""
        ...extra configs
        dimension "backend"
    }
    staging {
        buildConfigField "String", "API_VERSION", "\"1.1\""
        ...extra configs
        dimension "backend"
    }
    prod {
        buildConfigField "String", "API_VERSION", "\"1.1\""
        ...extra configs
        dimension "backend"
    }
    android {
        buildConfigField "String", "DEVICE_TYPE", "\"ANDROID\""
        dimension "device"
    }
    huawei {
        buildConfigField "String", "DEVICE_TYPE", "\"ANDROID_HW\""
        versionCode 10000 + defaultConfig.versionCode
        dimension "device"
    }
}

enter image description here enter image description here

main/AndroidManifest.xml:

<application
    android:name=".XApplication"
    ...

    <activity
        android:name=".ui.SplashActivity"
        android:theme="@style/SplashTheme">
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />
            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
    </activity>


from Default Activity Not Found with two different dimensions

No comments:

Post a Comment