为 android 构建 ionic/react - 无效的项目类型 "react"
Building ionic/react for android - Invalid project type "react"
我正在使用 @ionic/react
来构建 Android 应用程序。一切正常,但我似乎无法构建它的 android 版本。
命令
$ ionic build
$ ionic serve
$ ionic integrations enable capacitor
$ ionic cap add android
$ ionic cap open android
都给我报错信息:
[ERROR] Invalid project type: react (project config: .\ionic.config.json).
Project type must be one of: angular, ionic-angular, ionic1, custom
我对 @ionic/react
尚未完全支持的解释是否正确?
我很困惑,以为我之前为 android 构建了一个 @ionic/react
-app。
一直在关注此文档:https://ionicframework.com/docs/react/your-first-app
我的ionic.config.json
:
{
"name": "Prototype",
"integrations": {},
"type": "react"
}
来自 package.json
的重要依赖项:
"dependencies": {
"@ionic/react": "^4.11.0",
"@ionic/react-router": "^4.11.0",
"@react-google-maps/api": "1.7.12",
"@types/jest": "^24.0.18",
"@types/node": "^12.7.12",
"@types/react": "^16.9.5",
"@types/react-dom": "^16.9.1",
"@types/react-router": "^5.1.1",
"@types/react-router-dom": "^5.1.0",
"ionic": "4.12.0",
"ionicons": "^4.6.3",
"react": "^16.10.2",
"react-dom": "^16.10.2",
"react-router": "^5.1.0",
"react-router-dom": "^5.1.0",
"react-scripts": "3.2.0",
"typescript": "3.6.3"
},
我遇到了同样的问题,您必须将 ionic 更新到最新版本。
npm uninstall -g @ionic/cli
npm install -g @ionic/cli@latest
我正在使用 @ionic/react
来构建 Android 应用程序。一切正常,但我似乎无法构建它的 android 版本。
命令
$ ionic build
$ ionic serve
$ ionic integrations enable capacitor
$ ionic cap add android
$ ionic cap open android
都给我报错信息:
[ERROR] Invalid project type: react (project config: .\ionic.config.json).
Project type must be one of: angular, ionic-angular, ionic1, custom
我对 @ionic/react
尚未完全支持的解释是否正确?
我很困惑,以为我之前为 android 构建了一个 @ionic/react
-app。
一直在关注此文档:https://ionicframework.com/docs/react/your-first-app
我的ionic.config.json
:
{
"name": "Prototype",
"integrations": {},
"type": "react"
}
来自 package.json
的重要依赖项:
"dependencies": {
"@ionic/react": "^4.11.0",
"@ionic/react-router": "^4.11.0",
"@react-google-maps/api": "1.7.12",
"@types/jest": "^24.0.18",
"@types/node": "^12.7.12",
"@types/react": "^16.9.5",
"@types/react-dom": "^16.9.1",
"@types/react-router": "^5.1.1",
"@types/react-router-dom": "^5.1.0",
"ionic": "4.12.0",
"ionicons": "^4.6.3",
"react": "^16.10.2",
"react-dom": "^16.10.2",
"react-router": "^5.1.0",
"react-router-dom": "^5.1.0",
"react-scripts": "3.2.0",
"typescript": "3.6.3"
},
我遇到了同样的问题,您必须将 ionic 更新到最新版本。
npm uninstall -g @ionic/cli
npm install -g @ionic/cli@latest