gpt4 book ai didi

IOS 错误 : Terminating app due to uncaught exception 'NSUnknownKeyException' in ionic3?

转载 作者:行者123 更新时间:2023-11-29 11:27:05 25 4
gpt4 key购买 nike

在 iOS 9.0 上,我的应用程序在启动后立即终止,并在 xcode 中显示此消息

*** Terminating app due to uncaught exception 'NSUnknownKeyException', reason: '[ setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key view.'

我尝试了所有方法来解决上述错误,但没有任何效果。我正在使用后台模式插件在后台模式下获取位置。我尝试了以下解决方案:

尝试过的解决方案

第一种解决方案:

https://github.com/katzer/cordova-plugin-background-mode/issues/419

Removing lines APPBackgroundMode.m:266 & 267: [obj setValue:[NSNumber numberWithBool:YES] <--- remove! forKey:[APPBackgroundMode wkProperty]]; <--- remove!

第二种解决方案:

尝试在文件 src\ios\APPBackgroundMode.m 中替换以下行

+ (NSString*) wkProperty {
NSString* str = @"YWx3YXlzUnVuc0F0Rm9yZWdyb3VuZFByaW9yaXR5";
NSData* data = [[NSData alloc] initWithBase64EncodedString:str options:0];

return [[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding]; }

下面我们提到了config.xml文件

    <edit-config file="*-Info.plist" mode="merge" target="NSLocationWhenInUseUsageDescription">
<string>This App wants to track your location</string>
</edit-config>
<plugin name="cordova-sqlite-storage" spec="^2.6.0" />
<plugin name="cordova-plugin-splashscreen" spec="^4.0.3" />
<plugin name="cordova-plugin-whitelist" spec="^1.3.1" />
<plugin name="cordova-plugin-advanced-http" spec="^2.0.2" />
<plugin name="cordova-plugin-statusbar" spec="2.4.2" />
<plugin name="cordova-plugin-ionic-keyboard" spec="^2.0.5" />
<plugin name="cordova-plugin-filepath" spec="~1.5.1" />
<plugin name="cordova-plugin-actionsheet" spec="~2.3.3" />
<plugin name="cordova-plugin-document-viewer" spec="~0.9.10" />
<plugin name="cordova-plugin-inappbrowser" spec="~3.0.0" />
<plugin name="cordova-plugin-camera" spec="~4.0.3" />
<plugin name="cordova-plugin-file" spec="~6.0.1" />
<plugin name="cordova-plugin-datepicker" spec="~0.9.3" />
<plugin name="cordova-plugin-file-transfer" spec="~1.7.1" />
<plugin name="cordova-plugin-network-information" spec="~2.0.1" />
<plugin name="cordova-plugin-telerik-imagepicker" spec="~2.2.2">
<variable name="PHOTO_LIBRARY_USAGE_DESCRIPTION" value="your usage message" />
</plugin>
<plugin name="cordova-plugin-uniquedeviceid" spec="^1.3.2" />
<plugin name="cordova.plugins.diagnostic" spec="4.0.11" />
<plugin name="org.apache.cordova.geolocation" spec="^0.3.6" />
<plugin name="cordova-plugin-android-permissions" spec="^1.0.0" />
<plugin name="cordova-plugin-request-location-accuracy" spec="2.3.0">
<variable name="PLAY_SERVICES_LOCATION_VERSION" value="16.+" />
</plugin>
<plugin name="cordova-plugin-nativegeocoder" spec="3.2.2" />
<plugin name="cordova-plugin-fcm-with-dependecy-updated" spec="2.4.0" />
<plugin name="cordova-plugin-background-mode" spec="0.7.2" />
<plugin name="cordova-plugin-mauron85-background-geolocation" spec="2.3.6">
<variable name="GOOGLE_PLAY_SERVICES_VERSION" value="11+" />
<variable name="ANDROID_SUPPORT_LIBRARY_VERSION" value="23+" />
<variable name="ICON" value="@mipmap/icon" />
<variable name="SMALL_ICON" value="@mipmap/icon" />
<variable name="ACCOUNT_NAME" value="@string/app_name" />
<variable name="ACCOUNT_LABEL" value="@string/app_name" />
<variable name="ACCOUNT_TYPE" value="$PACKAGE_NAME.account" />
<variable name="CONTENT_AUTHORITY" value="$PACKAGE_NAME" />
<variable name="ALWAYS_USAGE_DESCRIPTION" value="This app always requires location tracking" />
</plugin>
<plugin name="cordova-plugin-local-notification" spec="0.9.0-beta.2" />
<plugin name="cordova-plugin-ionic-webview" spec="4.1.1">
<variable name="ANDROID_SUPPORT_ANNOTATIONS_VERSION" value="27.+" />
</plugin>

我尝试了所有解决方案,但对我没有任何效果,请团队帮助我解决问题?

最佳答案

最后我在禁用 WKWebView 并在 config.xml 中使用 UIWebView 后解决了上述问题(仅在 ionic 3 而非 ionic4 中测试)

 <preference name="CordovaWebViewEngine" value="CDVUIWebViewEngine" >

关于IOS 错误 : Terminating app due to uncaught exception 'NSUnknownKeyException' in ionic3?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57652584/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com