Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings
This repository was archived by the owner on Feb 26, 2023. It is now read-only.
This repository was archived by the owner on Feb 26, 2023. It is now read-only.

Cannot pass resourcePackageName to new annotationProcessor #1964

Copy link
Copy link
@AleksanderMielczarek

Description

@AleksanderMielczarek
Issue body actions

Hi,

apt plugin is not compatible with Gradle build tools 2.3.0 so I've switched to annotationProcessor and used approach suggested here.

I have two different applicationId based on flavor. I cannot build flavor dev. AA is looking in wrong package (should use "com.my.app" but instead "com.my.app.debug" is used). Flavor prod, which has default applciationId works. This setup works with apt and 2.2.3 tools.

I think resourcePackageName is not passed properly to AA.

Log:

14:23:45.477 [Daemon worker Thread 23] ERROR o.a.i.r.ProjectRClassFinder:47 - The generated com.my.app.debug.R class cannot be found`

build.gradle:

apply plugin: 'com.android.application'

android {
 
    defaultConfig {
        applicationId "com.my.app"   
    }

    productFlavors {    
        dev {
            applicationId "com.my.app.debug"           
        }
        prod {
            applicationId "com.my.app"           
        }
    }
}

android.applicationVariants.all { variant ->
    variant.variantData.variantConfiguration.javaCompileOptions.annotationProcessorOptions.arguments =
            ['androidManifestFile': variant.outputs[0]?.processResources?.manifestFile?.absolutePath,
             'resourcePackageName': android.defaultConfig.applicationId]
}
Reactions are currently unavailable

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.