Android-аннотации: ошибка: не удается найти символ - PullRequest
0 голосов
/ 02 июля 2019

в app / build.gradle:

def AAVersion = '4.5.2'

dependencies {
    annotationProcessor "org.androidannotations:androidannotations:$AAVersion"
implementation "org.androidannotations:androidannotations-api:$AAVersion"  
implementation "com.googlecode.androidannotations:androidannotations-api:2.7.1"

в gradle.properties:

android.enableSeparateAnnotationProcessing=true

и в моем фрагменте:

import com.google.android.gms.common.ConnectionResult;
import com.google.android.gms.common.GooglePlayServicesUtil;
import com.googlecode.androidannotations.annotations.Background;
import com.googlecode.androidannotations.annotations.EFragment;
import com.googlecode.androidannotations.annotations.UiThread;

@EFragment
public class SelectAgentMainFragment extends WZRootFragment
        implements FragmentPagerPageSelectedListener, Serializable, LocationAware {
public static final String IS_HIDE_MAP_TAB = SelectAgentMainFragment_.class.getName() + "_IS_HIDE_MAP_TAB";

Но я получаю ошибку компиляции:

   > Task :mymodule1:compileDebugJavaWithJavac FAILED
Gradle may disable incremental compilation as the following annotation processors are not incremental: androidannotations-4.5.2.jar (org.androidannotations:androidannotations:4.5.2).
Consider setting the experimental feature flag android.enableSeparateAnnotationProcessing=true in the gradle.properties file to run annotation processing in a separate task and make compilation incremental.
mymodule1\src\main\java\android\agents\SelectAgentMainFragment.java:57: error: cannot find symbol
    public static final String IS_HIDE_MAP_TAB = SelectAgentMainFragment_.class.getName() + "_IS_HIDE_MAP_TAB";


                                                 ^
  symbol:   class SelectAgentMainFragment_
  location: class SelectAgentMainFragment

приписка

WARNING: The option setting 'android.enableSeparateAnnotationProcessing=true' is experimental and unsupported.
The current default is 'false'.

1 Ответ

0 голосов
/ 02 июля 2019

Этот код выглядит как проблема.

public static final String IS_HIDE_MAP_TAB = SelectAgentMainFragment_.class.getName() + "_IS_HIDE_MAP_TAB";

Измените его на

public static final String IS_HIDE_MAP_TAB = SelectAgentMainFragment.class.getName() + "_IS_HIDE_MAP_TAB";
...