I was able to solve the problem. After looking a little closer at the -info output of the gradle wrapper, I found that androidAnnotations was attempting to run. The error output was NOT in the correct order as the annotations processing message came AFTER the errors that were caused by referencing the non-existent code (that didn't exist because annotations processing failed).
Here is the log:
:MyCompany:compileProDebug
....srcmainjavacomMyCompanyMyAppActivitiesactivityMain.java:14: error: cannot find symbol
import com.MyCompany.MyApp.Notifications.NotificationSetupActivity_;
^
symbol: class NotificationSetupActivity_
location: package com.MyCompany.MyApp.Notifications
....srcmainjavacomMyCompanyMyAppActivitiesactivityMain.java:24: error: cannot find symbol
import com.MyCompany.MyApp.FantasyScores.ActivityScores_;
^
symbol: class ActivityScores_
location: package com.MyCompany.MyApp.Scores
....srcmainjavacomMyCompanyMyAppActivitiesactivityMain.java:32: error: cannot find symbol
import com.MyCompany.MyApp.Team.activityTeamSelect_;
^
symbol: class activityTeamSelect_
location: package com.MyCompany.MyApp.Team
Note: Starting AndroidAnnotations annotation processing
Note: AndroidManifest.xml file found: ....uildmanifestsprodebugAndroidManifest.xml
error: The generated com.MyCompany.MyAppPro.R class cannot be found
Note: Time measurements: [Whole Processing = 190 ms], [Extract Manifest = 129 ms], [Extract Annotations = 49 ms],
....srcmainjavacomMyCompanyMyAppActivitiesactivityMain.java:14: error: cannot find symbol
import com.MyCompany.MyApp.Notifications.NotificationSetupActivity_;
The important lines are these:
Note: Starting AndroidAnnotations annotation processing
Note: AndroidManifest.xml file found: ....uildmanifestsprodebugAndroidManifest.xml
error: The generated com.MyCompany.MyAppPro.R class cannot be found
These should have been first in the error log as the annotations processor runs before the full compile step, but for some reason they were buried deep (maybe a flush problem in the androidannotations processor??)
At any rate, the third line where it can't find the com.MyCompany.MyAppPro.R
is the key. The resources are actually in com.MyCompany.MyApp.R
(no Pro). After digging a bit, I found this post which indicates this is a known issue with AndroidAnnotations.
I was able to resolve that problem by adding the '-AresourcePackageName=MyBasePackageName',
parameter to the build script. NOTE: this only works if you are using the 3.0 snapshot. The latest released version of AndroidAnnotations does not support the -AresourcePackageName option.
After adding the parameter, all variants build correctly.
The compilerArgs section of the build script now looks like this:
variant.javaCompile.options.compilerArgs += [
'-processorpath', configurations.apt.getAsPath(),
'-AandroidManifestFile=' + variant.processResources.manifestFile,
'-AresourcePackageName=MyBasePackageName',
'-s', aptOutput
]
Hopefully this will help others avoid this problem in the future.