Skip to content

Build android app error when added productFlavors  #17541

Description

@adamnator92

Is this a bug report?

Yes,

Have you read the [Contributing Guidelines]

Yes,

Environment

Environment:
OS: macOS High Sierra 10.13.2
Node: 6.9.2
Yarn: 1.3.2
npm: 5.5.1
Watchman: 4.5.0
Xcode: Xcode 9.2 Build version 9C40b
Android Studio: 3.0 AI-171.4443003

Packages: (wanted => installed)
react: 16.0.0-alpha.12 => 16.0.0-alpha.12
react-native: ^0.48.3 => 0.48.3

Target Platform: iOS (10.3)

Steps to Reproduce

  1. create android with multiple productFlavors (demo, full and etc)
  2. build different flavor app on android device by running this command,
    react-native run-android --variant=demoDebug
    or
    react-native run-android --variant=fullDebug
flavorDimensions "app"
productFlavors { demo {
dimension "app"
applicationId "com.demo"
resValue "string", "app_name", "demo"
manifestPlaceholders = [
appIcon: "@mipmap/ic_launcher_demo"
]
versionCode 1
versionName "1.0"
}
full {
dimension "app"
applicationId "com.full"
resValue "string", "app_name", "full"
manifestPlaceholders = [
appIcon: "@mipmap/ic_launcher_full"
]
versionCode 1
versionName "1.0"
}
}

Expected Behavior

expect different flavors of app will build on android device,

Actual Behavior

the build failed and i, i get this error
Error: Activity class {com.todo/com.todo.MainActivity} does not exist,

but I'm able to build the app successfully if i remove the productFlavors {}

any advice will be appreciate.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Ran CommandsOne of our bots successfully processed a command.Resolution: LockedThis issue was locked by the bot.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions