vault backup: 2024-06-05 19:12:07

This commit is contained in:
2024-06-05 19:12:07 +08:00
parent ffb639c0f9
commit f95571279e

View File

@@ -1,3 +1,11 @@
---
tags:
aliases:
date: 2024-06-05
time: 19:06:00
description:
---
Ktor是由Kotlin提供的一個framwork。 Ktor是由Kotlin提供的一個framwork。
要在Android使用Ktor需要在build.gradle加入以下的dependency: 要在Android使用Ktor需要在build.gradle加入以下的dependency:
``` ```
@@ -6,7 +14,7 @@ implementation "io.ktor:ktor-server-netty:1.2.5"
implementation "io.ktor:ktor-gson:1.2.5" implementation "io.ktor:ktor-gson:1.2.5"
``` ```
`packagingOptions`裡,也需要加入以下的設定來必面編譯問題: `packagingOptions`裡,也需要加入以下的設定來必面編譯問題[[Ktor#^68d958 ]]
``` ```
packagingOptions { packagingOptions {
exclude 'META-INF/*' exclude 'META-INF/*'
@@ -52,4 +60,15 @@ Thread {
} }
}.start(wait = false) }.start(wait = false)
}.start() }.start()
```
# 參考來源
- 如果沒有這一段會產生如下錯誤 ^68d958
```
13 files found with path 'META-INF/INDEX.LIST'.
Adding a packagingOptions block may help, please refer to
https://developer.android.com/reference/tools/gradle-api/7.4/com/android/build/api/dsl/ResourcesPackagingOptions
for more information
``` ```