我尝试编写一个类来管理SQLite数据库,但我有错误消息“期待顶级声明>任务:app:buildInfoGeneratorDebug”。
package com.xexxxwxxxxs.GMP
import android.database.sqlite.SQLiteDatabase
import android.database.sqlite.SQLiteOpenHelper
import android.content.Context
import android.content.ContentValues
class DBHandler(context: Context, name: String?, factory: SQLiteDatabase.CursorFactory?, version: Int) : SQLiteOpenHelper(context, DATABASE_NAME, factory, DATABASE_VERSION)
{
override fun onCreate(db: SQLiteDatabase)
{
}
override fun onUpgrade(db: SQLiteDatabase, oldVersion: Int, newVersion: Int)
{
}
companion object
{
private val DATABASE_VERSION = 1
private val DATABASE_NAME = "GMP.db"
}
}
你有什么想法?
提前致谢
我只是删除了最后一个大括号并再次写入。它的工作:)