2

I use Android Annotations in some other projects too. But in this it won't generate my files.

I try to migrate from Eclipse to Android Studio.
I'm also updating my libraries.
In Eclipse everything was working fine.

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.

here the gradle files:
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')
}

off-question: are there gradle projects for the last four compile requests?

rala
  • 895
  • 2
  • 18
  • 43
  • Could you paste the build stack trace? – WonderCsabo Aug 19 '15 at 18:29
  • there is none / how do I get it? – rala Aug 19 '15 at 18:31
  • Pass the - - stacktrace flag to the gradle command – WonderCsabo Aug 22 '15 at 17:48
  • At the top of android studio do the following: Build -> Clean project, then Build -> Rebuild project – smac89 Aug 24 '15 at 01:48
  • @Smac89 didn't help... – rala Aug 24 '15 at 08:25
  • 1
    A couple more suggestions, in android studio click File -> Invalidate Caches / Restart -> Invalidate and Restart. After that try what I suggested above again. If that still doesn't work, go to the project directory and run the command `android update project --path . --target 3`. Try my above suggestion again. Just saw this, change the line `apply plugin: 'android-apt'` to `apply plugin: 'com.neenbedankt.android-apt'` – smac89 Aug 24 '15 at 08:30

2 Answers2

0

I had the same problem I switched from repositories to be wrapped in allprojects block. That made it work.

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
}
Juan Mendez
  • 2,658
  • 1
  • 27
  • 23
-2

I'll try to remove specific section apt... See my last question, may you find something useful.

I'm answer without computer in front ;)

accreativos
  • 161
  • 2
  • 9