Jarvis
Jarvis

Reputation: 361

android-studio, cannot resolve symbol SQLiteOpenHelper,Context

I create an Android project dependency by the greenDAO greenDAO

and create a modual greendao-lib with greeenDAO ,but it's not work. see : enter image description here

and this is the build.gradle

apply plugin: 'java'
//apply plugin: 'com.android.library'
//apply plugin: 'com.android.application'


dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    // android core
    //compile 'com.android.support:appcompat-v7:23.2.0'
    //classpath 'com.android.tools.build:gradle:1.3.1'
    // green dao lib
    compile 'de.greenrobot:greendao:2.1.0'
    compile 'de.greenrobot:greendao-generator:2.1.0'
    // javax annotation
    compile 'org.glassfish:javax.annotation:10.0-b28'
    // lombok
    compile 'org.projectlombok:lombok:1.16.2'
    // guava
    compile 'com.google.guava:guava:18.0'
}

how to deal with this problem?

Upvotes: 1

Views: 6696

Answers (2)

tiny sunlight
tiny sunlight

Reputation: 6251

//apply plugin: 'java'
apply plugin: 'com.android.library'

Upvotes: 0

Jignesh Ansodariya
Jignesh Ansodariya

Reputation: 12685

kindly check your import section, it should be like as follows.

import android.content.Context;
import android.database.Cursor;
import android.database.SQLException;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteOpenHelper;

Upvotes: 2

Related Questions