Jelajahi Sumber

ionic build 说明文件

warrior 3 bulan lalu
induk
melakukan
71902449fa
6 mengubah file dengan 58 tambahan dan 92 penghapusan
  1. 2 27
      README.md
  2. 22 0
      android/app/capacitor.build.gradle
  3. 15 0
      android/capacitor.settings.gradle
  4. 9 4
      build.android.md
  5. 5 53
      package-lock.json
  6. 5 8
      package.json

+ 2 - 27
README.md

@@ -1,36 +1,11 @@
-# NovaLive
-
-This project was generated with [Angular CLI](https://github.com/angular/angular-cli) version 18.0.4.
-
-## Development server
-
-Run `ng serve` for a dev server. Navigate to `http://localhost:4200/`. The application will automatically reload if you change any of the source files.
-
-## Code scaffolding
-
-Run `ng generate component component-name` to generate a new component. You can also use `ng generate directive|pipe|service|class|guard|interface|enum|module`.
-
-## Build
-
-Run `ng build` to build the project. The build artifacts will be stored in the `dist/` directory.
-
-## Running unit tests
-
-Run `ng test` to execute the unit tests via [Karma](https://karma-runner.github.io).
-
-## Running end-to-end tests
-
-Run `ng e2e` to execute the end-to-end tests via a platform of your choice. To use this command, you need to first add a package that implements end-to-end testing capabilities.
-
-## Further help
-
-To get more help on the Angular CLI use `ng help` or go check out the [Angular CLI Overview and Command Reference](https://angular.dev/tools/cli) page.
 
 
 - 安装配置
 ``` bash
 # 安装
 npm install i
+or
+npm install --force 或略版本兼容问题
 ```
 
 # 打包发布

+ 22 - 0
android/app/capacitor.build.gradle

@@ -0,0 +1,22 @@
+// DO NOT EDIT THIS FILE! IT IS GENERATED EACH TIME "capacitor update" IS RUN
+
+android {
+  compileOptions {
+      sourceCompatibility JavaVersion.VERSION_17
+      targetCompatibility JavaVersion.VERSION_17
+  }
+}
+
+apply from: "../capacitor-cordova-android-plugins/cordova.variables.gradle"
+dependencies {
+    implementation project(':capacitor-app')
+    implementation project(':capacitor-haptics')
+    implementation project(':capacitor-keyboard')
+    implementation project(':capacitor-status-bar')
+
+}
+
+
+if (hasProperty('postBuildExtras')) {
+  postBuildExtras()
+}

+ 15 - 0
android/capacitor.settings.gradle

@@ -0,0 +1,15 @@
+// DO NOT EDIT THIS FILE! IT IS GENERATED EACH TIME "capacitor update" IS RUN
+include ':capacitor-android'
+project(':capacitor-android').projectDir = new File('../node_modules/@capacitor/android/capacitor')
+
+include ':capacitor-app'
+project(':capacitor-app').projectDir = new File('../node_modules/@capacitor/app/android')
+
+include ':capacitor-haptics'
+project(':capacitor-haptics').projectDir = new File('../node_modules/@capacitor/haptics/android')
+
+include ':capacitor-keyboard'
+project(':capacitor-keyboard').projectDir = new File('../node_modules/@capacitor/keyboard/android')
+
+include ':capacitor-status-bar'
+project(':capacitor-status-bar').projectDir = new File('../node_modules/@capacitor/status-bar/android')

+ 9 - 4
build.android.md

@@ -1,11 +1,16 @@
-#安装
+# 安装
 
 
-#打包
-  ### ionic build --project=live-app//默认打包
+# 打包
+  ### ionic build --project=live-app//默认打包 或者 ng build live-app --output-path=www/live-app
 
-#参考资料
+# 参考资料
 - 打包 
   - https://blog.csdn.net/weixin_46318413/article/details/126129576
   - https://blog.csdn.net/qq_18948359/article/details/139874286
   - https://www.jianshu.com/p/be517d9a0567
+
+# Question:
+  - npx cap sync android  添加 Android 平台(如果尚未添加)
+    - 打开 Android 项目(可选): npx cap open android
+  - npx cap build android 构建 Android 应用

+ 5 - 53
package-lock.json

@@ -17,11 +17,11 @@
         "@angular/platform-browser-dynamic": "^18.0.0",
         "@angular/router": "^18.0.0",
         "@capacitor/android": "6.2.0",
-        "@capacitor/app": "6.0.2",
+        "@capacitor/app": "^6.0.2",
         "@capacitor/core": "6.2.0",
-        "@capacitor/haptics": "6.0.2",
-        "@capacitor/keyboard": "6.0.3",
-        "@capacitor/status-bar": "6.0.2",
+        "@capacitor/haptics": "^6.0.2",
+        "@capacitor/keyboard": "^6.0.3",
+        "@capacitor/status-bar": "^6.0.2",
         "@ionic/angular": "^8.4.0",
         "@ionic/angular-server": "^8.4.0",
         "@ionic/angular-toolkit": "^11.0.1",
@@ -40,13 +40,10 @@
         "@angular-devkit/build-angular": "^18.0.4",
         "@angular/cli": "^18.0.4",
         "@angular/compiler-cli": "^18.0.0",
-        "@capacitor/cli": "6.2.0",
+        "@capacitor/cli": "^6.2.0",
         "@types/jasmine": "~5.1.0",
         "@types/parse": "^3.0.9",
         "cordova-plugin-device": "2.0.2",
-        "cordova-plugin-ionic-keyboard": "^2.0.5",
-        "cordova-plugin-ionic-webview": "^5.0.0",
-        "cordova-plugin-splashscreen": "5.0.2",
         "cordova-plugin-statusbar": "2.4.2",
         "jasmine-core": "~5.1.0",
         "karma": "~6.4.0",
@@ -6304,51 +6301,6 @@
         }
       }
     },
-    "node_modules/cordova-plugin-ionic-keyboard": {
-      "version": "2.2.0",
-      "resolved": "https://registry.npmmirror.com/cordova-plugin-ionic-keyboard/-/cordova-plugin-ionic-keyboard-2.2.0.tgz",
-      "integrity": "sha512-yDUG+9ieKVRitq5mGlNxjaZh/MgEhFFIgTIPhqSbUaQ8UuZbawy5mhJAVClqY97q8/rcQtL6dCDa7x2sEtCLcA==",
-      "dev": true
-    },
-    "node_modules/cordova-plugin-ionic-webview": {
-      "version": "5.0.1",
-      "resolved": "https://registry.npmmirror.com/cordova-plugin-ionic-webview/-/cordova-plugin-ionic-webview-5.0.1.tgz",
-      "integrity": "sha512-dF3x7ee8s7ITPImz8WG5HFMnzMW1LaCve+Pdm5WzonKxcwkmMsPrW2zoWuIFBTWjXvFyNoxprzRn6aq/WotvKg==",
-      "dev": true,
-      "engines": {
-        "cordovaDependencies": {
-          "2.0.0": {
-            "cordova-android": ">=6.4.0",
-            "cordova-ios": ">=4.0.0-dev"
-          },
-          "3.1.0": {
-            "cordova": ">=7.1.0",
-            "cordova-android": ">=6.4.0",
-            "cordova-ios": ">=4.0.0-dev"
-          }
-        }
-      }
-    },
-    "node_modules/cordova-plugin-splashscreen": {
-      "version": "5.0.2",
-      "resolved": "https://registry.npmmirror.com/cordova-plugin-splashscreen/-/cordova-plugin-splashscreen-5.0.2.tgz",
-      "integrity": "sha512-zc4HOECJb+5Gz1rZh5QvdIm6DREom57yXOuEmMRSqu0pJRMXTrJPlemsE1gQ+9v9gGhAyXIREibBXHHRG7eFQQ==",
-      "dev": true,
-      "engines": {
-        "cordovaDependencies": {
-          "2.0.0": {
-            "cordova-android": ">=3.6.0"
-          },
-          "4.0.0": {
-            "cordova-android": ">=3.6.0",
-            "cordova-windows": ">=4.4.0"
-          },
-          "6.0.0": {
-            "cordova": ">100"
-          }
-        }
-      }
-    },
     "node_modules/cordova-plugin-statusbar": {
       "version": "2.4.2",
       "resolved": "https://registry.npmmirror.com/cordova-plugin-statusbar/-/cordova-plugin-statusbar-2.4.2.tgz",

+ 5 - 8
package.json

@@ -19,11 +19,11 @@
     "@angular/platform-browser-dynamic": "^18.0.0",
     "@angular/router": "^18.0.0",
     "@capacitor/android": "6.2.0",
-    "@capacitor/app": "6.0.2",
+    "@capacitor/app": "^6.0.2",
     "@capacitor/core": "6.2.0",
-    "@capacitor/haptics": "6.0.2",
-    "@capacitor/keyboard": "6.0.3",
-    "@capacitor/status-bar": "6.0.2",
+    "@capacitor/haptics": "^6.0.2",
+    "@capacitor/keyboard": "^6.0.3",
+    "@capacitor/status-bar": "^6.0.2",
     "@ionic/angular": "^8.4.0",
     "@ionic/angular-server": "^8.4.0",
     "@ionic/angular-toolkit": "^11.0.1",
@@ -42,13 +42,10 @@
     "@angular-devkit/build-angular": "^18.0.4",
     "@angular/cli": "^18.0.4",
     "@angular/compiler-cli": "^18.0.0",
-    "@capacitor/cli": "6.2.0",
+    "@capacitor/cli": "^6.2.0",
     "@types/jasmine": "~5.1.0",
     "@types/parse": "^3.0.9",
     "cordova-plugin-device": "2.0.2",
-    "cordova-plugin-ionic-keyboard": "^2.0.5",
-    "cordova-plugin-ionic-webview": "^5.0.0",
-    "cordova-plugin-splashscreen": "5.0.2",
     "cordova-plugin-statusbar": "2.4.2",
     "jasmine-core": "~5.1.0",
     "karma": "~6.4.0",