diff --git a/packages/uni-uts-v1/src/kotlin.ts b/packages/uni-uts-v1/src/kotlin.ts index f954910fc1fe02b2e5c6501bd2ce1ef2a5f3a7d9..9771a08418ec39ced19726fe573104309cde656f 100644 --- a/packages/uni-uts-v1/src/kotlin.ts +++ b/packages/uni-uts-v1/src/kotlin.ts @@ -482,7 +482,6 @@ const DEFAULT_IMPORTS = [ 'io.dcloud.uts.UTSAndroid', 'io.dcloud.uts.*', 'io.dcloud.uniapp.*', - 'io.dcloud.uniapp.extapi.*', ] const DEFAULT_IMPORTS_X = [ @@ -527,6 +526,9 @@ export async function compile( true ) + '.*' ) + } else { + // 本地 provider 的时候,不要引入 io.dcloud.uniapp.extapi.*,因为里边包含了相同的类型定义 + imports.push('io.dcloud.uniapp.extapi.*') } const componentsCode = genComponentsCode(filename, components, isX) const { package: pluginPackage, id: pluginId } = parseKotlinPackage(filename)