Tencent / wcdb

WCDB is a cross-platform database framework developed by WeChat.
Other
10.83k stars 1.41k forks source link

No addExtension method in com.tencent.wcdb.database.SQLiteDatabase class. #622

Closed neo1949 closed 4 years ago

neo1949 commented 5 years ago

The language of WCDB

Java

The version of WCDB

v1.0.8

The platform of WCDB

Android

The installation of WCDB

Maven

What's the issue?

No addExtension method in com.tencent.wcdb.database.SQLiteDatabase class.

Following the sample code in android/samples/sample-persistence, but can not find the addExtension method:

AppDatabase appDatabase = Room.databaseBuilder(getApplicationContext(), AppDatabase.class, "milk.db")
        .allowMainThreadQueries()
        .openHelperFactory(new WCDBOpenHelperFactory())
        .addCallback(new RoomDatabase.Callback() {
            @Override
                public void onCreate(@NonNull SupportSQLiteDatabase db) {
                    WCDBDatabase realDb = (WCDBDatabase) db;
                    com.tencent.wcdb.database.SQLiteDatabase innerDatabase = realDb.getInnerDatabase();
                    // no method found in SQLiteDatabase class
                    realDb.addExtension(MMFtsTokenizer.EXTENSION);
                }
        })
        .build();

app/build.gradle


apply plugin: 'com.android.application'

android { compileSdkVersion 29 buildToolsVersion "29.0.2" defaultConfig { applicationId "cn.neo.delivery" minSdkVersion 23 targetSdkVersion 29 versionCode 1 versionName "1.0" testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" } buildTypes { debug { minifyEnabled false } release { minifyEnabled true proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' } } sourceSets { main { jniLibs.srcDir 'libs' } } compileOptions { sourceCompatibility JavaVersion.VERSION_1_8 targetCompatibility JavaVersion.VERSION_1_8 } }

dependencies { implementation fileTree(dir: 'libs', include: ['*.jar']) implementation 'androidx.appcompat:appcompat:1.1.0' implementation 'androidx.constraintlayout:constraintlayout:1.1.3' implementation 'androidx.cardview:cardview:1.0.0' implementation 'androidx.preference:preference:1.1.0' implementation 'androidx.recyclerview:recyclerview:1.0.0' testImplementation 'junit:junit:4.12' androidTestImplementation 'androidx.test.ext:junit:1.1.1' androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0' implementation files('libs/BaiduLBS_Android.jar') // ButterKnife implementation 'com.jakewharton:butterknife:10.2.0' annotationProcessor 'com.jakewharton:butterknife-compiler:10.2.0' // Glide implementation('com.github.bumptech.glide:glide:4.10.0') { exclude group: "com.android.support" } implementation 'com.github.bumptech.glide:annotations:4.10.0' implementation 'com.github.bumptech.glide:okhttp3-integration:4.10.0' annotationProcessor 'com.github.bumptech.glide:compiler:4.10.0' // Room // def room_version = "2.2.1" // implementation "androidx.room:room-runtime:$room_version" // annotationProcessor "androidx.room:room-compiler:$room_version"

implementation 'com.tencent.wcdb:room:1.0.8'
implementation 'com.tencent.wcdb:wcdb-android:1.0.8'
implementation 'android.arch.persistence.room:runtime:1.1.1'
annotationProcessor 'android.arch.persistence.room:compiler:1.1.1'

implementation 'me.drakeet.multitype:multitype:3.5.0'

// https://mvnrepository.com/artifact/net.sourceforge.jexcelapi/jxl
implementation 'net.sourceforge.jexcelapi:jxl:2.6.12'

}


> project/build.gradle

// Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript { repositories { google() jcenter()

}
dependencies {
    classpath 'com.android.tools.build:gradle:3.5.1'

    // NOTE: Do not place your application dependencies here; they belong
    // in the individual module build.gradle files
}

}

allprojects { repositories { google() jcenter()

}

}

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

neo1949 commented 5 years ago

Find the reason, this method was added after the release of version v1.0.8 in f589b3f.

So, is there any plan for a new release for android?

John-He-928 commented 4 years ago

New release will be published soon on Github and binary release on JCenter.