Ladessa
Ladessa

Reputation: 1003

AndroidAnnotation with 2 productFlavors

I have 2 productFlavors in my project pone and ptwo like below:

flavorDimensions "version"
productFlavors {
    pone {
        applicationId android.defaultConfig.applicationId
    }
    ptwo {
        applicationId android.defaultConfig.applicationId + “.ptwo”
    }
}
sourceSets {
    pone {
        manifest.srcFile 'app/src/pone/AndroidManifest.xml'
    }

    ptwo {
        manifest.srcFile 'app/src/ptwo/AndroidManifest.xml'
    }
}


kapt {
    generateStubs = true
    arguments {
        arg( "resourcePackageName", android.defaultConfig.applicationId)
    }

}

Then I have two folders structs: app/src/ptwo/ and app/src/pone/

And in pone and ptwo there is SplashActivity.java and in ptwo there's LoginStoreActivity.java too.

The problem is that when I run ptwo I got

e: error: Could not generate source file for .LoginStoreActivity_ due to error: Illegal name .LoginStoreActivity_

and

e: error: Could not generate source file for .SplashActivity_ due to error: Illegal name .SplashActivity_

The flavor pone runs without erros.

I noticed that the problem is with Android Annotation because when I remove @EActivity from SplashActivity and LoginStoreActivity there's no error. But I would like to continue using AndroidAnnotation. How could I solve the error above?

Upvotes: 0

Views: 67

Answers (1)

Ladessa
Ladessa

Reputation: 1003

I finally noticed that my flavorone and flavor two folders are wrongs. It was flavorone->java->SplashActvity.java and LoginStore.java. I was missing the package obviously. My bad :D

Thanks

Upvotes: 0

Related Questions