在 windows 环境中执行 "amplify init" 命令时 AWS CLI (Amplify) 出错(对于 android 工作室项目)
Error in AWS CLI (Amplify) when executing the "amplify init" command in windows environment (for an android studio project)
我是 AWS SDK 的新手,我正在尝试使用适用于移动设备的 AWS SDK 创建一个新的 android 工作室项目。
我的最终目标是让 AWS SDK 在我的 Android studio 项目上运行,我尝试添加对 Gradle 的依赖项,但它并不是我需要的所有包而且它对我没有帮助,因此我遵循了引导我使用 Amplify CLI 的官方 AWS 文档。
根据 AWS 官方文档 (this is the link to the documentation page I'm talking about) 的建议,我按照推荐的所有步骤进行操作,这一步的命令是:
$amplify init
这 returns 对我来说是以下错误:
init failed
{Error: D:\EDUCATION\Developer\Final_Year_Project\MusicAppAWS\D:\EDUCATION\Developer\Final_Year_Project\MusicAppAWS\app\src\main\res\raw contains invalid WIN32 path characters
at Object.mkdirsSync (C:\Users\eldho\AppData\Roaming\npm\node_modules\@aws-amplify\cli\node_modules\amplify-frontend-android\node_modules\fs-extra\lib\mkdirs\mkdirs-sync.js:18:22)
at generateAWSConfigFile (C:\Users\eldho\AppData\Roaming\npm\node_modules\@aws-amplify\cli\node_modules\amplify-frontend-android\lib\frontend-config-creator.js:110:6)
at createAWSConfig (C:\Users\eldho\AppData\Roaming\npm\node_modules\@aws-amplify\cli\node_modules\amplify-frontend-android\lib\frontend-config-creator.js:32:3)
at Object.createFrontendConfigs (C:\Users\eldho\AppData\Roaming\npm\node_modules\@aws-amplify\cli\node_modules\amplify-frontend-android\index.js:23:10)
at Object.onCategoryOutputsChange (C:\Users\eldho\AppData\Roaming\npm\node_modules\@aws-amplify\cli\src\extensions\amplify-helpers\on-category-outputs-change.js:22:33)
at initializeEnv (C:\Users\eldho\AppData\Roaming\npm\node_modules\@aws-amplify\cli\src\lib\initialize-env.js:79:27)
at process._tickCallback (internal/process/next_tick.js:68:7) code: 'EINVAL'}
============================================= ===========================
错误截图:
link to the screenshot of the error in Amplify CLI
我是 运行 在 windows 命令提示符下。
我记得在 github 中读过一个类似的问题,说它可能是一个错误,因为路径中有像 "amplify-frontend-android\index.js:23:10" 中的“:”这样的字符,而 windows 中不支持。我是编码初学者,不知道如何解决这个问题。
运行之后
$amplify init
Amplify CLI 会提示您几个问题,其中一个问题是:
? Where is your Res directory:
为此,您需要提供 Res 目录的相对路径,例如:
? Where is your Res directory:app\src\main\res
而不是像这样提供完整路径:
? Where is your Res directory: D:\EDUCATION\Final_Year_Project\Demo2\app\src\main\res
在撰写此答案时(2019 年 4 月 18 日),amplify CLI 并未优化以自行解决此问题。我们希望将此视为未来版本的增强功能,因此它应该会在未来版本中自行解决。
我是 AWS SDK 的新手,我正在尝试使用适用于移动设备的 AWS SDK 创建一个新的 android 工作室项目。 我的最终目标是让 AWS SDK 在我的 Android studio 项目上运行,我尝试添加对 Gradle 的依赖项,但它并不是我需要的所有包而且它对我没有帮助,因此我遵循了引导我使用 Amplify CLI 的官方 AWS 文档。
根据 AWS 官方文档 (this is the link to the documentation page I'm talking about) 的建议,我按照推荐的所有步骤进行操作,这一步的命令是:
$amplify init
这 returns 对我来说是以下错误:
init failed
{Error: D:\EDUCATION\Developer\Final_Year_Project\MusicAppAWS\D:\EDUCATION\Developer\Final_Year_Project\MusicAppAWS\app\src\main\res\raw contains invalid WIN32 path characters
at Object.mkdirsSync (C:\Users\eldho\AppData\Roaming\npm\node_modules\@aws-amplify\cli\node_modules\amplify-frontend-android\node_modules\fs-extra\lib\mkdirs\mkdirs-sync.js:18:22)
at generateAWSConfigFile (C:\Users\eldho\AppData\Roaming\npm\node_modules\@aws-amplify\cli\node_modules\amplify-frontend-android\lib\frontend-config-creator.js:110:6)
at createAWSConfig (C:\Users\eldho\AppData\Roaming\npm\node_modules\@aws-amplify\cli\node_modules\amplify-frontend-android\lib\frontend-config-creator.js:32:3)
at Object.createFrontendConfigs (C:\Users\eldho\AppData\Roaming\npm\node_modules\@aws-amplify\cli\node_modules\amplify-frontend-android\index.js:23:10)
at Object.onCategoryOutputsChange (C:\Users\eldho\AppData\Roaming\npm\node_modules\@aws-amplify\cli\src\extensions\amplify-helpers\on-category-outputs-change.js:22:33)
at initializeEnv (C:\Users\eldho\AppData\Roaming\npm\node_modules\@aws-amplify\cli\src\lib\initialize-env.js:79:27)
at process._tickCallback (internal/process/next_tick.js:68:7) code: 'EINVAL'}
============================================= =========================== 错误截图: link to the screenshot of the error in Amplify CLI
我是 运行 在 windows 命令提示符下。 我记得在 github 中读过一个类似的问题,说它可能是一个错误,因为路径中有像 "amplify-frontend-android\index.js:23:10" 中的“:”这样的字符,而 windows 中不支持。我是编码初学者,不知道如何解决这个问题。
运行之后
$amplify init
Amplify CLI 会提示您几个问题,其中一个问题是:
? Where is your Res directory:
为此,您需要提供 Res 目录的相对路径,例如:
? Where is your Res directory:app\src\main\res
而不是像这样提供完整路径:
? Where is your Res directory: D:\EDUCATION\Final_Year_Project\Demo2\app\src\main\res
在撰写此答案时(2019 年 4 月 18 日),amplify CLI 并未优化以自行解决此问题。我们希望将此视为未来版本的增强功能,因此它应该会在未来版本中自行解决。