Skip to content

Fix generated activity class name (namespace) - #12

Merged
friederbluemle merged 1 commit into
fbluemle:masterfrom
friederbluemle:fix-namespace
Nov 14, 2025
Merged

friederbluemle merged 1 commit into
fbluemle:masterfrom
friederbluemle:fix-namespace

Conversation

@friederbluemle

@friederbluemle friederbluemle commented Nov 14, 2025

Copy link
Copy Markdown
Contributor

Fixes incorrect activity component name generation when using applicationIdSuffix in build types. Previously, the plugin incorrectly prefixed activities with the suffixed applicationId instead of the actual package namespace where the code lives.

Problem

When an app uses applicationIdSuffix (e.g., .debug), the plugin was generating incorrect component names:

  • App ID: com.example.debug (with suffix)
  • Activity class: com.example.MainActivity (actual location)
  • Before: -n com.example.debug/com.example.debug.MainActivity
  • After: -n com.example.debug/com.example.MainActivity

Changes

  • Use getNamespace() instead of getApplicationId() for constructing activity class names when activity starts with "."
  • The -n flag now correctly uses: applicationId (with suffix) + activityClassName (using namespace)
  • Added comprehensive unit and functional tests validating:
    • Activity name construction logic with namespace vs applicationId
    • Extension configuration and defaults
    • Both relative (.MainActivity) and fully qualified activity names

@friederbluemle
friederbluemle merged commit 6932601 into fbluemle:master Nov 14, 2025
1 check passed
@friederbluemle
friederbluemle deleted the fix-namespace branch November 14, 2025 04:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant