1

我正在将一个正常工作的 Android Studio 应用程序转换为 KMM 环境。至此,我有了一个非常简单的 KMM 框架。一旦我添加SQLDelight到公共包中,我开始在我的构建中收到以下错误。我检查了我能找到的每一个例子,但看不出有什么问题。如果可以的话请帮忙?

这是错误消息:

生成失败;有关详细信息,请参阅生成器错误输出任务:shared:generateAndroidDebugPicturesDBInterface FAILED WARN:已访问注册表项“psi.track.invalidation”,但尚未加载

警告:已访问注册表项“psi.incremental.reparse.depth.limit”,但尚未加载

警告:已访问注册表项“ide.hide.excluded.files”,但尚未加载

C:/Users/pagel/AndroidStudioProjects/DailyNasa/shared/src/commonMain/sqldelight/com/pagetyler/shared/cache/Pictures.sq 行 17:10 - '{' 预期,得到 ':' 17:

                           **^**

任务 ':shared:generateAndroidDebugPicturesDBInterface' 执行失败。生成失败;有关详细信息,请参阅生成器错误输出。`

它无法处理应该用来生成表和查询的 .sq 文件。当它在指定第一个查询标签后遇到文件中的第一个“:”时。这是 .sq 文件脚本。getAllPict:在指定的第一个查询标签之后构建失败。

这是 .sq 文件

CREATE TABLE Daily_Pictures (
    "date_loaded"       TEXT NOT NULL PRIMARY KEY,
    "copyright"         TEXT NOT NULL,
    "image_explanation" TEXT NOT NULL,
    "hd_url_string"     TEXT NOT NULL,
    "media_type"        TEXT NOT NULL,
    "service_version"   TEXT NOT NULL,
    "picture_title"     TEXT NOT NULL,
    "picture_url_string"    TEXT NOT NULL,
    "picture_file_reg"  TEXT NOT NULL,
    "picture_file_hd"   TEXT NOT NULL,
    "picture_On_DB" INTEGER AS Boolean DEFAULT NULL,
    "picture_Favorite"  INTEGER AS Boolean DEFAULT NULL,
    "storeDate" TEXT NOT NULL DEFAULT 0
);

getAllPict:
select  dp.date_loaded, dp.copyright, dp.hd_url_string, dp.image_explanation, dp.media_type, 
        dp.picture_Favorite, dp.picture_On_DB, dp.picture_file_hd, dp.picture_file_reg, 
        dp.picture_title, dp.picture_url_string, dp.service_version, dp.storeDate
  from  "Daily_Pictures" dp;}
    
insertPic:
INSERT OR REPLACE INTO Daily_Pictures(date_loaded, copyright, image_explanation, hd_url_string, 
           media_type, service_version, picture_title, picture_url_string, picture_file_reg, 
           picture_file_hd, picture_On_DB, picture_Favorite, storeDate)
    Values(?,?,?,?,?,?,?,?,?,?,?,?,?);
                            
updatePic:
INSERT OR REPLACE INTO Daily_Pictures(date_loaded, copyright, image_explanation, hd_url_string, 
          media_type, service_version, picture_title, picture_url_string, picture_file_reg, 
          picture_file_hd, picture_On_DB, picture_Favorite, storeDate)
    Values(?,?,?,?,?,?,?,?,?,?,?,?,?);
                            
getPicByKey:
    SELECT * from Daily_Pictures where date_loaded = ?;

delAllPict:
    DELETE FROM Daily_Pictures;

delPictByKey:
    DELETE FROM Daily_Pictures where date_loaded = ?;

cleanUpDB:
    delete from Daily_Pictures where storeDate < ? and (not picture_Favorite and not picture_On_DB);

cleanUpFavorites:
    delete from Daily_Pictures where storeDate < ? and (picture_Favorite);

直到第一个错误的新版本。更新 2020-3-5 相同的结果

    getAllPict:
    select  dp.date_loaded, dp.copyright, dp.hd_url_string,  dp.image_explanation, dp.media_type, dp.picture_Favorite, dp.picture_On_DB,
        dp.picture_file_hd, dp.picture_file_reg, dp.picture_title, dp.picture_url_string, dp.service_version, dp.storeDate
    from  "Daily_Pictures" dp;

4

1 回答 1

0

这里有一个不应该存在的花括号:

from "Daily_Pictures" dp;}

于 2021-03-05T02:05:15.133 回答