pardom-zz / Ollie

Compile-time active record ORM for Android
Apache License 2.0
417 stars 38 forks source link

Android Gradle Annotations not found #43

Open skoenen opened 9 years ago

skoenen commented 9 years ago

Do i miss something?

Project build.gradle

buildscript {
    repositories {
        jcenter()
        mavenCentral()
    }

    dependencies {
        classpath 'com.android.tools.build:gradle:1.0.0'
        classpath 'com.neenbedankt.gradle.plugins:android-apt:1.4'
    }
}

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

Module build.gradle

apply plugin: 'com.android.application'
apply plugin: 'com.neenbedankt.android-apt'

android {
    compileSdkVersion 21
    buildToolsVersion "21.1.2"

    defaultConfig {
        applicationId "com.example.android.chat"
        minSdkVersion 21
        targetSdkVersion 21
        versionCode 1
        versionName "1.0"
    }

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

    lintOptions {
        abortOnError false
    }
}

apt {
    arguments {
        androidManifestFile variant.outputs[0].processResources.manifestFile
        resourcePackageName 'com.example.android.chat'
    }
}

dependencies {
    compile 'com.android.support:support-v4:21.0.3'
    compile 'com.joanzapata.android:android-iconify:1.0.8'
    compile 'com.jakewharton:butterknife:6.0.0'

    compile 'com.michaelpardo:ollie:0.3.1'
    apt 'com.michaelpardo:ollie-compiler:0.3.1'

    compile fileTree(dir: 'libs', include: ['*.jar'])
}

I tried it also with:

dependencies {
    compile 'com.android.support:support-v4:21.0.3'
    compile 'com.joanzapata.android:android-iconify:1.0.8'
    compile 'com.jakewharton:butterknife:6.0.0'

    compile 'com.michaelpardo:ollie:0.3.1'
    provided 'com.michaelpardo:ollie-compiler:0.3.1'

    compile fileTree(dir: 'libs', include: ['*.jar'])
}

But both versions result in the error Error:(5, 30) Gradle: error: cannot find symbol class Model

SDK-Version: 24.0.2 Gradle: 2.2.1 IDE: IntelliJ CE 14

skoenen commented 9 years ago

Forgot to mention that @Table Annotations are also not found.

pardom-zz commented 9 years ago

Can you post your model or a sample project?

skoenen commented 9 years ago

The project was newly created and the dependencies added. But today i created a new one and added the dependencies => this time works. I have to check the differences between those.

At the moment i would close this and post my findings later on?

skoenen commented 9 years ago

I found a hint: If you define your project as an android library, ollie.Model and ollie.annotation.Table is not available.