Android Annotations没有生成我的类

时间:2015-08-19 09:11:24

标签: android android-studio gradle android-gradle android-annotations

我也在其他一些项目中使用Android Annotations。但在此,它不会生成我的文件。

我尝试从Eclipse迁移到Android Studio 我也在更新我的图书馆 在Eclipse中,一切正常。

Note: Resolve log file to C:\Users\Raphael\Documents\!!!PROG\Eclipse\ARBEIT\FlohmoAndroid\flohmoLI\build\generated\source\apt\androidannotations.log
Note: Initialize AndroidAnnotations 3.3.2 with options {androidManifestFile=C:\Users\Raphael\Documents\!!!PROG\Eclipse\ARBEIT\FlohmoAndroid\flohmoLI\build\intermediates\manifests\full\debug\AndroidManifest.xml, resourcePackageName=at.flohmo}
C:\Users\Raphael\Documents\!!!PROG\Eclipse\ARBEIT\FlohmoAndroid\flohmoLI\src\main\java\at\flohmo\push\PushIntentReceiver.java:14: error: cannot find symbol
import at.flohmo.AdvertDetailsActivity_;
             ^
  symbol:   class AdvertDetailsActivity_
  location: package at.flohmo
C:\Users\Raphael\Documents\!!!PROG\Eclipse\ARBEIT\FlohmoAndroid\flohmoLI\src\main\java\at\flohmo\push\PushIntentReceiver.java:15: error: cannot find symbol
import at.flohmo.AngeboteActivity_;
             ^
  symbol:   class AngeboteActivity_
  location: package at.flohmo
C:\Users\Raphael\Documents\!!!PROG\Eclipse\ARBEIT\FlohmoAndroid\flohmoLI\src\main\java\at\flohmo\push\PushIntentReceiver.java:16: error: cannot find symbol
import at.flohmo.ChatActivity_;
             ^
  symbol:   class ChatActivity_
  location: package at.flohmo
C:\Users\Raphael\Documents\!!!PROG\Eclipse\ARBEIT\FlohmoAndroid\flohmoLI\src\main\java\at\flohmo\push\PushIntentReceiver.java:17: error: cannot find symbol
import at.flohmo.MainActivity_;
             ^
  symbol:   class MainActivity_
  location: package at.flohmo
warning: The following options were not recognized by any processor: '[androidManifestFile, resourcePackageName]'
4 errors

 FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':flohmoLI:compileDebugJavaWithJavac'.
> Compilation failed; see the compiler error output for details.

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

这里是gradle文件:
project gradle

// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
    repositories {
       maven { url "http://dl.bintray.com/populov/maven" }
       jcenter()
       mavenCentral()
    }
    dependencies {
       classpath 'com.android.tools.build:gradle:1.2.3'
        classpath 'com.google.gms:google-services:1.3.0-beta1'
    }
}

allprojects {
    repositories {
       maven { url  "http://dl.bintray.com/urbanairship/android" }
       maven { url "http://dl.bintray.com/populov/maven" }
       jcenter()
       mavenCentral()
    }
}

app gradle

apply plugin: 'com.android.application'
apply plugin: 'com.google.gms.google-services'

apply plugin: 'android-apt'


buildscript {
    repositories {
       mavenCentral()
    }
    dependencies {
       // Since Android's Gradle plugin 0.11, you have to use android-apt >= 1.3
       classpath 'com.neenbedankt.gradle.plugins:android-apt:1.+'
    }
}


apt {
    arguments {
       androidManifestFile variant.outputs[0].processResources.manifestFile
       resourcePackageName 'at.flohmo'
    }
}

android {
    compileSdkVersion 22
    buildToolsVersion "22.0.1"

    defaultConfig {
       applicationId "at.flohmo"
       minSdkVersion 10
       targetSdkVersion 22
    }

    buildTypes {
       release {
          minifyEnabled false
          proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
       }
    }
}

def AAVersion = '3.3.2'

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    apt "org.androidannotations:androidannotations:$AAVersion"
    compile "org.androidannotations:androidannotations-api:$AAVersion"
    compile 'com.android.support:support-v4:22.0.0'
    compile 'com.android.support:appcompat-v7:22.0.0'
    compile 'com.google.code.gson:gson:2.3'
    compile 'com.google.android.gms:play-services:7.8.0'
    compile 'com.facebook.android:facebook-android-sdk:4.1.0'
    compile 'com.nhaarman.listviewanimations:lib-core:3.1.0@aar'
    compile 'com.nhaarman.listviewanimations:lib-manipulation:3.1.0@aar'
    compile 'com.nhaarman.listviewanimations:lib-core-slh:3.1.0@aar'
    compile 'com.nostra13.universalimageloader:universal-image-loader:1.9.4'
    compile 'com.squareup.picasso:picasso:2.5.2'
    compile 'com.squareup.retrofit:retrofit:1.9.0'
    compile 'com.urbanairship.android:urbanairship-sdk:6.1.+'
    compile 'com.viewpagerindicator:library:2.4.1@aar'
    compile project(':flohmosimplecropimagelib')
    compile project(':flohmoLibrarySlidingMenu')
    compile project(':flohmoPullToRefreshLibrary')
    compile files('libs/ADTECHMobileSDK.jar')
}

没有问题:是否有最后四次编译请求的gradle项目?

2 个答案:

答案 0 :(得分:0)

我遇到了同样的问题,我从存储库切换到包含在allprojects块中。这使它发挥作用。

buildscript {
repositories {
    jcenter()
}
dependencies {
    classpath 'com.android.tools.build:gradle:2.1.3'
    classpath 'com.neenbedankt.gradle.plugins:android-apt:1.8'
}

}

allprojects {
    repositories {
        jcenter()
        mavenCentral()
        mavenLocal()
    }
}

task clean(type: Delete) {
    delete rootProject.buildDir
}

答案 1 :(得分:-2)

我会尝试删除特定部分...请参阅我的上一个问题,您是否可以找到有用的内容。

我在前面没有电脑回答;)