Skip to content

Android resource contribution parsing fails if using automatic AndroidManifest generation #196

@RBusarow

Description

@RBusarow

Parsing is hard-coded to check $projectDir/src/main/AndroidManifest.xml for the root package name. This is necessary in order to determine the generated R file's fully qualified name. The R file's FqName is necessary in order to determine contributions for a module's resources, such as

com.example.R.string.app_name

The Auto-Manifest plugin automatically generates simple manifests for Android library modules based upon the module's path. This plugin always uses the path $buildDir/generated/auto-manifest/AndroidManifest.xml.

If the file isn't in the normal spot, it doesn't get parsed, and the module's contributed resources aren't counted.

The quick fix would be to hard-code this additional path and check it if there's no file in the conventional spot. Problem is, there could easily be other plugins which put the file in a different spot, or home-made internal solutions. None of these would be supported by simply hard-coding the path.

The better option is to grab the manifest file's path from TestedExtension and depend upon the process__Manifest tasks of every Android module. This will ensure that the manifest file has been generated if necessary. Bonus points for only using dependsOn in modules where the file is missing.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions