Task :app:buildInfoGeneratorDebug"-6ren"> Task :app:buildInfoGeneratorDebug"-我尝试编写一个类来管理 SQLite 数据库,但出现错误消息“Expecting a top level declaration > Task :app:buildInfoGeneratorDebug-6ren">
gpt4 book ai didi

安卓/ Kotlin : Error: "Expecting a top level declaration > Task :app:buildInfoGeneratorDebug"

转载 作者:行者123 更新时间:2023-11-29 15:34:18 24 4
gpt4 key购买 nike

我尝试编写一个类来管理 SQLite 数据库,但出现错误消息“Expecting a top level declaration > Task :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"
}
}

你有什么想法吗?

提前致谢

最佳答案

我只是把最后一个花括号删掉,重新写一遍。它正在工作:)

关于安卓/ Kotlin : Error: "Expecting a top level declaration > Task :app:buildInfoGeneratorDebug",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55017476/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com