Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>I was able to solve the problem. After looking a little closer at the <strong>-info</strong> 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).</p> <p>Here is the log:</p> <pre><code>:MyCompany:compileProDebug ....\src\main\java\com\MyCompany\MyApp\Activities\activityMain.java:14: error: cannot find symbol import com.MyCompany.MyApp.Notifications.NotificationSetupActivity_; ^ symbol: class NotificationSetupActivity_ location: package com.MyCompany.MyApp.Notifications ....\src\main\java\com\MyCompany\MyApp\Activities\activityMain.java:24: error: cannot find symbol import com.MyCompany.MyApp.FantasyScores.ActivityScores_; ^ symbol: class ActivityScores_ location: package com.MyCompany.MyApp.Scores ....\src\main\java\com\MyCompany\MyApp\Activities\activityMain.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: ....\build\manifests\pro\debug\AndroidManifest.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], ....\src\main\java\com\MyCompany\MyApp\Activities\activityMain.java:14: error: cannot find symbol import com.MyCompany.MyApp.Notifications.NotificationSetupActivity_; </code></pre> <p>The important lines are these:</p> <p><strong>Note: Starting AndroidAnnotations annotation processing</strong></p> <p>Note: AndroidManifest.xml file found: ....\build\manifests\pro\debug\AndroidManifest.xml</p> <p><strong>error: The generated com.MyCompany.MyAppPro.R class cannot be found</strong></p> <p>These <em>should have been first</em> 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??)</p> <p>At any rate, the third line where it can't find the <code>com.MyCompany.MyAppPro.R</code> is the key. The resources are actually in <code>com.MyCompany.MyApp.R</code> (no Pro). After digging a bit, I found <a href="https://github.com/excilys/androidannotations/issues/690">this post</a> which indicates this is a known issue with AndroidAnnotations. </p> <p>I was able to resolve that problem by adding the <code>'-AresourcePackageName=MyBasePackageName',</code> parameter to the build script. <strong>NOTE:</strong> this only works if you are using the 3.0 snapshot. The latest released version of AndroidAnnotations does not support the <em>-AresourcePackageName</em> option. </p> <p>After adding the parameter, all variants build correctly.</p> <p>The compilerArgs section of the build script now looks like this:</p> <pre><code>variant.javaCompile.options.compilerArgs += [ '-processorpath', configurations.apt.getAsPath(), '-AandroidManifestFile=' + variant.processResources.manifestFile, '-AresourcePackageName=MyBasePackageName', '-s', aptOutput ] </code></pre> <p>Hopefully this will help others avoid this problem in the future.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload