Gradle 为 sqldelight 生成构建失败,第 17:10 行 - 应为“{”,得到“:”Android Studio 版本 4.1.2
Gradle build for sqldelight Generation failed with line 17:10 - '{' expected, got ':' Android Studio version 4.1.2
我正在将工作中的 Android Studio 应用程序转换为 KMM 环境。至此,我有了一个非常简单的 KMM 框架。一旦我将 SQLDelight
添加到公共包中,我就开始在我的构建中收到以下错误。我已经检查了我能找到的每个例子,但看不出有什么问题。如果可以请帮忙?
这是错误信息:
Generation failed; see the generator error output for details Task :shared:generateAndroidDebugPicturesDBInterface FAILED
WARN: The registry key 'psi.track.invalidation' accessed, but not loaded yet
WARN: The registry key 'psi.incremental.reparse.depth.limit' accessed, but not loaded yet
WARN: The registry key 'ide.hide.excluded.files' accessed, but not loaded yet
C:/Users/pagel/AndroidStudioProjects/DailyNasa/shared/src/commonMain/sqldelight/com/pagetyler/shared/cache/Pictures.sq
line 17:10 - '{' expected, got ':' 17 :
**^**
Execution failed for task ':shared:generateAndroidDebugPicturesDBInterface'.
Generation failed; see the generator error output for details.
`
处理本应用于生成表和查询的 .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;
这里有一个不应该出现的花括号:
from "Daily_Pictures" dp;}
我正在将工作中的 Android Studio 应用程序转换为 KMM 环境。至此,我有了一个非常简单的 KMM 框架。一旦我将 SQLDelight
添加到公共包中,我就开始在我的构建中收到以下错误。我已经检查了我能找到的每个例子,但看不出有什么问题。如果可以请帮忙?
这是错误信息:
Generation failed; see the generator error output for details Task :shared:generateAndroidDebugPicturesDBInterface FAILED WARN: The registry key 'psi.track.invalidation' accessed, but not loaded yet
WARN: The registry key 'psi.incremental.reparse.depth.limit' accessed, but not loaded yet
WARN: The registry key 'ide.hide.excluded.files' accessed, but not loaded yet
C:/Users/pagel/AndroidStudioProjects/DailyNasa/shared/src/commonMain/sqldelight/com/pagetyler/shared/cache/Pictures.sq line 17:10 - '{' expected, got ':' 17 :
**^**
Execution failed for task ':shared:generateAndroidDebugPicturesDBInterface'. Generation failed; see the generator error output for details. `
处理本应用于生成表和查询的 .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;
这里有一个不应该出现的花括号:
from "Daily_Pictures" dp;}