我最近将TypeScript的版本从2.3.4升级到2.4.0,希望使用字符串枚举.然而,令我沮丧的是,我收到了错误消息:
Run Code Online (Sandbox Code Playgroud)Severity Code Description Project File Line Suppression State Error TS2322 Type '"E"' is not assignable to type 'StepType'. ClientApp (tsconfig project) Z:\SMART\Smart\Smart\ClientApp\app\models\process.model.ts 17 Active Error TS2322 Type '"S"' is not assignable to type 'StepType'. ClientApp (tsconfig project) Z:\SMART\Smart\Smart\ClientApp\app\models\process.model.ts 14 Active Error TS2322 Type '"A"' is not assignable to type 'StepType'. ClientApp (tsconfig project) Z:\SMART\Smart\Smart\ClientApp\app\models\process.model.ts 15 Active Error TS2322 Type '"D"' is not assignable to type 'StepType'. ClientApp (tsconfig project) Z:\SMART\Smart\Smart\ClientApp\app\models\process.model.ts 16 Active
错误消息适用于以下代码段(带行号):
13. export enum StepType …Run Code Online (Sandbox Code Playgroud) 我看过本指南,了解如何为每个ABI构建拆分的APK。
但是我的应用程序嵌入了许多本机可执行文件作为资产。是否可以根据ABI过滤它们?
相关部分build.gradle:
android {
...
splits {
abi {
enable true
}
}
externalNativeBuild {
cmake {
path "CMakeLists.txt"
// builds assets and places them in src/main/assets
}
}
sourceSets {
main {
assets.srcDirs = ['src/main/assets']
}
}
}
Run Code Online (Sandbox Code Playgroud)
使用CMake构建本机可执行文件后,示例应用程序树:
src
+ main
+ assets
+ x86
| + native-x86.bin
+ x86_64
| + native-x86_64.bin
+ armeabi-v7a
| + native-arm.bin
+ arm64-v8a
+ native-aarch64.bin
Run Code Online (Sandbox Code Playgroud)
每个ABI目录都包含本机二进制文件
我希望每个拆分的APK仅包含特定于ABI的资产目录,并过滤其他目录。例如,对于arm64 APK:
assets
+ arm64-v8a
+ native-aarch64.bin
Run Code Online (Sandbox Code Playgroud) 我在AndroidStudio 3.2中运行我的项目,但是有一个错误
FAILURE: Build failed with an exception.
* What went wrong:
Circular dependency between the following tasks:
:app:checkManifestChangesDebug
\--- :app:instantRunMainApkResourcesDebug
\--- :app:transformClassesAndDexWithShrinkResForDebug
\--- :app:transformDexArchiveWithDexMergerForDebug
+--- :app:preColdswapDebug
| \--- :app:incrementalDebugTasks
| +--- :app:transformClassesAndClassesEnhancedWithInstantReloadDexForDebug
| | \--- :app:transformClassesWithInstantRunForDebug
| | \--- :app:checkManifestChangesDebug (*)
| \--- :app:transformClassesWithInstantRunForDebug (*)
\--- :app:transformClassesWithDexBuilderForDebug
+--- :app:preColdswapDebug (*)
\--- :app:transformClassesWithInstantRunForDebug (*)
(*) - details omitted (listed previously)
Run Code Online (Sandbox Code Playgroud)
我仍然可以手动生成APK,但"运行"按钮不起作用.
我该如何解决这个问题?