Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Crash with cordovaSettingForKey selector #727

Open
3 tasks done
mithun-grmtech opened this issue Sep 27, 2019 · 7 comments
Open
3 tasks done

Crash with cordovaSettingForKey selector #727

mithun-grmtech opened this issue Sep 27, 2019 · 7 comments
Labels
info-needed Further information is requested

Comments

@mithun-grmtech
Copy link

Bug Report

I've got an error while compiling (Release/Debug)

Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[__NSDictionaryM cordovaSettingForKey:]: unrecognized selector sent to instance 0x600003ea6ae0'

Problem

After build successfully myProject. I was open my project in Xcode and click the run button on Xcode. the project build successfully and display the lunch screen in simulator device. After that stuff I get an error in main.m

Screenshot 2019-09-27 at 12 14 13 PM

What is expected to happen?

I tried to run with debug and release modes and always the same error.

What does actually happen?

the project build successfully and display the lunch screen in simulator device. After that stuff I get an error in main.m and not display home page in the simulator device.

Information

This is what I see in console of Xcode:

2019-09-27 15:19:14.943154+0530 myApp[3086:93649] DiskCookieStorage changing policy from 2 to 0, cookie file: file:///Users/mk/Library/Developer/CoreSimulator/Devices/EC5630C3-373A-45AD-A404-5628B1B329B9/data/Containers/Data/Application/06D2441B-F5B5-47B8-B6A7-68AEA36BB0D6/Library/Cookies/com.test.my-app.binarycookies
2019-09-27 15:19:14.954425+0530 myApp[3086:93649] Apache Cordova native platform version 5.0.1 is starting.
2019-09-27 15:19:14.954596+0530 myApp[3086:93649] Multi-tasking -> Device: YES, App: YES
2019-09-27 15:19:14.972439+0530 myApp[3086:93649] -[__NSDictionaryM cordovaSettingForKey:]: unrecognized selector sent to instance 0x6000011cc900
2019-09-27 15:19:14.981981+0530 myApp[3086:93649] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[__NSDictionaryM cordovaSettingForKey:]: unrecognized selector sent to instance 0x6000011cc900'
*** First throw call stack:
(
	0   CoreFoundation                      0x00007fff23b98bde __exceptionPreprocess + 350
	1   libobjc.A.dylib                     0x00007fff503b5b20 objc_exception_throw + 48
	2   CoreFoundation                      0x00007fff23bb9704 -[NSObject(NSObject) doesNotRecognizeSelector:] + 132
	3   CoreFoundation                      0x00007fff23b9d7bc ___forwarding___ + 1436
	4   CoreFoundation                      0x00007fff23b9f6c8 _CF_forwarding_prep_0 + 120
	5   myApp                               0x000000010a028723 -[CDVViewController viewDidLoad] + 227
	6   myApp                               0x000000010a004433 -[MainViewController viewDidLoad] + 51
	7   UIKitCore                           0x00007fff46af87c2 -[UIViewController _sendViewDidLoadWithAppearanceProxyObjectTaggingEnabled] + 83
	8   UIKitCore                           0x00007fff46afd6d3 -[UIViewController loadViewIfRequired] + 1084
	9   UIKitCore                           0x00007fff46afdaf0 -[UIViewController view] + 27
	10  UIKitCore                           0x00007fff47199b55 -[UIWindow addRootViewControllerViewIfPossible] + 150
	11  UIKitCore                           0x00007fff4719920b -[UIWindow _updateLayerOrderingAndSetLayerHidden:actionBlock:] + 232
	12  UIKitCore                           0x00007fff4719a2c9 -[UIWindow _setHidden:forced:] + 362
	13  UIKitCore                           0x00007fff471ad46d -[UIWindow _mainQueue_makeKeyAndVisible] + 42
	14  myApp                               0x000000010a01ef3f -[CDVAppDelegate application:didFinishLaunchingWithOptions:] + 703
	15  myApp                               0x000000010a0041ab -[AppDelegate application:didFinishLaunchingWithOptions:] + 187
	16  UIKitCore                           0x00007fff4715994f -[UIApplication _handleDelegateCallbacksWithOptions:isSuspended:restoreState:] + 232
	17  UIKitCore                           0x00007fff4715b2e7 -[UIApplication _callInitializationDelegatesWithActions:forCanvas:payload:fromOriginatingProcess:] + 3980
	18  UIKitCore                           0x00007fff47160c05 -[UIApplication _runWithMainScene:transitionContext:completion:] + 1281
	19  UIKitCore                           0x00007fff468b58b1 -[_UISceneLifecycleMultiplexer completeApplicationLaunchWithFBSScene:transitionContext:] + 122
	20  UIKitCore                           0x00007fff46d96cd5 _UIScenePerformActionsWithLifecycleActionMask + 83
	21  UIKitCore                           0x00007fff468b63c3 __101-[_UISceneLifecycleMultiplexer _evalTransitionToSettings:fromSettings:forceExit:withTransitionStore:]_block_invoke + 198
	22  UIKitCore                           0x00007fff468b5e84 -[_UISceneLifecycleMultiplexer _performBlock:withApplicationOfDeactivationReasons:fromReasons:] + 474
	23  UIKitCore                           0x00007fff468b61f3 -[_UISceneLifecycleMultiplexer _evalTransitionToSettings:fromSettings:forceExit:withTransitionStore:] + 821
	24  UIKitCore                           0x00007fff468b5a85 -[_UISceneLifecycleMultiplexer uiScene:transitionedFromState:withTransitionContext:] + 345
	25  UIKitCore                           0x00007fff468b9e70 __186-[_UIWindowSceneFBSSceneTransitionContextDrivenLifecycleSettingsDiffAction _performActionsForUIScene:withUpdatedFBSScene:settingsDiff:fromSettings:transitionContext:lifecycleActionType:]_block_invoke_2 + 159
	26  UIKitCore                           0x00007fff46cbdf8b +[BSAnimationSettings(UIKit) tryAnimatingWithSettings:actions:completion:] + 865
	27  UIKitCore                           0x00007fff46db51cf _UISceneSettingsDiffActionPerformChangesWithTransitionContext + 240
	28  UIKitCore                           0x00007fff468b9b9e __186-[_UIWindowSceneFBSSceneTransitionContextDrivenLifecycleSettingsDiffAction _performActionsForUIScene:withUpdatedFBSScene:settingsDiff:fromSettings:transitionContext:lifecycleActionType:]_block_invoke + 153
	29  UIKitCore                           0x00007fff46db50d2 _UISceneSettingsDiffActionPerformActionsWithDelayForTransitionContext + 84
	30  UIKitCore                           0x00007fff468b9a0c -[_UIWindowSceneFBSSceneTransitionContextDrivenLifecycleSettingsDiffAction _performActionsForUIScene:withUpdatedFBSScene:settingsDiff:fromSettings:transitionContext:lifecycleActionType:] + 381
	31  UIKitCore                           0x00007fff46717c96 __64-[UIScene scene:didUpdateWithDiff:transitionContext:completion:]_block_invoke + 657
	32  UIKitCore                           0x00007fff4671681b -[UIScene _emitSceneSettingsUpdateResponseForCompletion:afterSceneUpdateWork:] + 248
	33  UIKitCore                           0x00007fff467179c0 -[UIScene scene:didUpdateWithDiff:transitionContext:completion:] + 210
	34  UIKitCore                           0x00007fff4715f262 -[UIApplication workspace:didCreateScene:withTransitionContext:completion:] + 535
	35  UIKitCore                           0x00007fff46cdf774 -[UIApplicationSceneClientAgent scene:didInitializeWithEvent:completion:] + 361
	36  FrontBoardServices                  0x00007fff362e1d43 -[FBSSceneImpl _callOutQueue_agent_didCreateWithTransitionContext:completion:] + 442
	37  FrontBoardServices                  0x00007fff3630a00c __86-[FBSWorkspaceScenesClient sceneID:createWithParameters:transitionContext:completion:]_block_invoke.154 + 102
	38  FrontBoardServices                  0x00007fff362ecd21 -[FBSWorkspace _calloutQueue_executeCalloutFromSource:withBlock:] + 220
	39  FrontBoardServices                  0x00007fff36309c9d __86-[FBSWorkspaceScenesClient sceneID:createWithParameters:transitionContext:completion:]_block_invoke + 355
	40  libdispatch.dylib                   0x000000010a387d64 _dispatch_client_callout + 8
	41  libdispatch.dylib                   0x000000010a38acd5 _dispatch_block_invoke_direct + 300
	42  FrontBoardServices                  0x00007fff3633108a __FBSSERIALQUEUE_IS_CALLING_OUT_TO_A_BLOCK__ + 30
	43  FrontBoardServices                  0x00007fff36330d78 -[FBSSerialQueue _queue_performNextIfPossible] + 441
	44  FrontBoardServices                  0x00007fff36331287 -[FBSSerialQueue _performNextFromRunLoopSource] + 22
	45  CoreFoundation                      0x00007fff23afbac1 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 17
	46  CoreFoundation                      0x00007fff23afb9ec __CFRunLoopDoSource0 + 76
	47  CoreFoundation                      0x00007fff23afb1c4 __CFRunLoopDoSources0 + 180
	48  CoreFoundation                      0x00007fff23af5ecf __CFRunLoopRun + 1263
	49  CoreFoundation                      0x00007fff23af56b6 CFRunLoopRunSpecific + 438
	50  GraphicsServices                    0x00007fff3815cbb0 GSEventRunModal + 65
	51  UIKitCore                           0x00007fff47162a67 UIApplicationMain + 1621
	52  myApp                               0x000000010a0040d1 main + 65
	53  libdyld.dylib                       0x00007fff5123bcf5 start + 1
	54  ???                                 0x0000000000000001 0x0 + 1
)
libc++abi.dylib: terminating with uncaught exception of type NSException
(lldb) 

Command or Code

I have no code to show because is terminating with uncaught exception error.

Environment, Platform, Device

Environment: Production or development
Platform: IOS
Device: Simulator (iPad Pro 10.5)

Version information

Ionic:

Ionic CLI : 5.4.1 (/usr/local/lib/node_modules/ionic)
Ionic Framework : ionic-angular 2.0.0-rc.4
@ionic/app-scripts : 3.2.4

Cordova:

Cordova CLI : 9.0.0 (cordova-lib@9.0.1)
Cordova Platforms : ios 5.0.1
Cordova Plugins : cordova-plugin-ionic-keyboard 2.1.3, cordova-plugin-ionic-webview 2.3.2, (and 11 other plugins)

Utility:

cordova-res : not installed
native-run : not installed

System:

ios-sim : 8.0.2
NodeJS : v10.16.3 (/usr/local/bin/node)
npm : 6.11.3
OS : macOS Mojave
Xcode : Xcode 11.0 Build version 11A420a

Checklist

  • I searched for existing GitHub issues
  • I updated all Cordova tooling to most recent version
  • I included all the necessary information above
@raphinesse raphinesse transferred this issue from apache/cordova Nov 26, 2019
@jcesarmobile
Copy link
Member

Looks like your confit.xml is not properly formatted and the app is crashing when it reads the preferences.
Can you provide your config.xml?

@jcesarmobile jcesarmobile added the info-needed Further information is requested label Nov 28, 2019
@brodybits
Copy link
Contributor

I would like to get this closed if the requested information is not provided.

In general, there is not much we can do to help without a minimal, reproducible example ([1]).

[1] https://stackoverflow.com/help/minimal-reproducible-example

@NikhilGangurde
Copy link

I am also facing a similar issue.
Here is my config.xml

<?xml version='1.0' encoding='utf-8'?>
<widget id="com.softwebitech.carpool" version="0.0.1" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">
    <name>Carpool</name>
    <description>An awesome Ionic/Cordova app.</description>
    <author email="hi@ionicframework.com" href="http://ionicframework.com/">Ionic Framework Team</author>
    <content src="index.html" />
    <access origin="*" />
    <allow-intent href="http://*/*" />
    <allow-intent href="https://*/*" />
    <allow-intent href="tel:*" />
    <allow-intent href="sms:*" />
    <allow-intent href="mailto:*" />
    <allow-intent href="geo:*" />
    <preference name="ScrollEnabled" value="false" />
    <preference name="BackupWebStorage" value="none" />
    <preference name="SplashMaintainAspectRatio" value="true" />
    <preference name="FadeSplashScreenDuration" value="300" />
    <preference name="SplashShowOnlyFirstTime" value="false" />
    <preference name="SplashScreen" value="screen" />
    <preference name="SplashScreenDelay" value="3000" />
    <platform name="android">
        <edit-config file="app/src/main/AndroidManifest.xml" mode="merge" target="/manifest/application" xmlns:android="http://schemas.android.com/apk/res/android">
            <application android:networkSecurityConfig="@xml/network_security_config" />
        </edit-config>
        <resource-file src="resources/android/xml/network_security_config.xml" target="app/src/main/res/xml/network_security_config.xml" />
        <allow-intent href="market:*" />
        <icon density="ldpi" src="resources/android/icon/drawable-ldpi-icon.png" />
        <icon density="mdpi" src="resources/android/icon/drawable-mdpi-icon.png" />
        <icon density="hdpi" src="resources/android/icon/drawable-hdpi-icon.png" />
        <icon density="xhdpi" src="resources/android/icon/drawable-xhdpi-icon.png" />
        <icon density="xxhdpi" src="resources/android/icon/drawable-xxhdpi-icon.png" />
        <icon density="xxxhdpi" src="resources/android/icon/drawable-xxxhdpi-icon.png" />
        <splash density="land-ldpi" src="resources/android/splash/drawable-land-ldpi-screen.png" />
        <splash density="land-mdpi" src="resources/android/splash/drawable-land-mdpi-screen.png" />
        <splash density="land-hdpi" src="resources/android/splash/drawable-land-hdpi-screen.png" />
        <splash density="land-xhdpi" src="resources/android/splash/drawable-land-xhdpi-screen.png" />
        <splash density="land-xxhdpi" src="resources/android/splash/drawable-land-xxhdpi-screen.png" />
        <splash density="land-xxxhdpi" src="resources/android/splash/drawable-land-xxxhdpi-screen.png" />
        <splash density="port-ldpi" src="resources/android/splash/drawable-port-ldpi-screen.png" />
        <splash density="port-mdpi" src="resources/android/splash/drawable-port-mdpi-screen.png" />
        <splash density="port-hdpi" src="resources/android/splash/drawable-port-hdpi-screen.png" />
        <splash density="port-xhdpi" src="resources/android/splash/drawable-port-xhdpi-screen.png" />
        <splash density="port-xxhdpi" src="resources/android/splash/drawable-port-xxhdpi-screen.png" />
        <splash density="port-xxxhdpi" src="resources/android/splash/drawable-port-xxxhdpi-screen.png" />
    </platform>
    <platform name="ios">
        <allow-intent href="itms:*" />
        <allow-intent href="itms-apps:*" />
        <icon height="57" src="resources/ios/icon/icon.png" width="57" />
        <icon height="114" src="resources/ios/icon/icon@2x.png" width="114" />
        <icon height="29" src="resources/ios/icon/icon-small.png" width="29" />
        <icon height="58" src="resources/ios/icon/icon-small@2x.png" width="58" />
        <icon height="87" src="resources/ios/icon/icon-small@3x.png" width="87" />
        <icon height="20" src="resources/ios/icon/icon-20.png" width="20" />
        <icon height="40" src="resources/ios/icon/icon-20@2x.png" width="40" />
        <icon height="60" src="resources/ios/icon/icon-20@3x.png" width="60" />
        <icon height="48" src="resources/ios/icon/icon-24@2x.png" width="48" />
        <icon height="55" src="resources/ios/icon/icon-27.5@2x.png" width="55" />
        <icon height="29" src="resources/ios/icon/icon-29.png" width="29" />
        <icon height="58" src="resources/ios/icon/icon-29@2x.png" width="58" />
        <icon height="87" src="resources/ios/icon/icon-29@3x.png" width="87" />
        <icon height="40" src="resources/ios/icon/icon-40.png" width="40" />
        <icon height="80" src="resources/ios/icon/icon-40@2x.png" width="80" />
        <icon height="120" src="resources/ios/icon/icon-40@3x.png" width="120" />
        <icon height="88" src="resources/ios/icon/icon-44@2x.png" width="88" />
        <icon height="50" src="resources/ios/icon/icon-50.png" width="50" />
        <icon height="100" src="resources/ios/icon/icon-50@2x.png" width="100" />
        <icon height="60" src="resources/ios/icon/icon-60.png" width="60" />
        <icon height="120" src="resources/ios/icon/icon-60@2x.png" width="120" />
        <icon height="180" src="resources/ios/icon/icon-60@3x.png" width="180" />
        <icon height="72" src="resources/ios/icon/icon-72.png" width="72" />
        <icon height="144" src="resources/ios/icon/icon-72@2x.png" width="144" />
        <icon height="76" src="resources/ios/icon/icon-76.png" width="76" />
        <icon height="152" src="resources/ios/icon/icon-76@2x.png" width="152" />
        <icon height="167" src="resources/ios/icon/icon-83.5@2x.png" width="167" />
        <icon height="172" src="resources/ios/icon/icon-86@2x.png" width="172" />
        <icon height="196" src="resources/ios/icon/icon-98@2x.png" width="196" />
        <icon height="1024" src="resources/ios/icon/icon-1024.png" width="1024" />
        <splash height="480" src="resources/ios/splash/Default~iphone.png" width="320" />
        <splash height="960" src="resources/ios/splash/Default@2x~iphone.png" width="640" />
        <splash height="1024" src="resources/ios/splash/Default-Portrait~ipad.png" width="768" />
        <splash height="768" src="resources/ios/splash/Default-Landscape~ipad.png" width="1024" />
        <splash height="1125" src="resources/ios/splash/Default-Landscape-2436h.png" width="2436" />
        <splash height="1242" src="resources/ios/splash/Default-Landscape-736h.png" width="2208" />
        <splash height="2048" src="resources/ios/splash/Default-Portrait@2x~ipad.png" width="1536" />
        <splash height="1536" src="resources/ios/splash/Default-Landscape@2x~ipad.png" width="2048" />
        <splash height="2732" src="resources/ios/splash/Default-Portrait@~ipadpro.png" width="2048" />
        <splash height="2048" src="resources/ios/splash/Default-Landscape@~ipadpro.png" width="2732" />
        <splash height="1136" src="resources/ios/splash/Default-568h@2x~iphone.png" width="640" />
        <splash height="1334" src="resources/ios/splash/Default-667h.png" width="750" />
        <splash height="2208" src="resources/ios/splash/Default-736h.png" width="1242" />
        <splash height="2436" src="resources/ios/splash/Default-2436h.png" width="1125" />
        <splash height="2732" src="resources/ios/splash/Default@2x~universal~anyany.png" width="2732" />
        <icon height="216" src="resources/ios/icon/icon-108@2x.png" width="216" />
        <splash height="2688" src="resources/ios/splash/Default-2688h~iphone.png" width="1242" />
        <splash height="1242" src="resources/ios/splash/Default-Landscape-2688h~iphone.png" width="2688" />
        <splash height="1792" src="resources/ios/splash/Default-1792h~iphone.png" width="828" />
        <splash height="828" src="resources/ios/splash/Default-Landscape-1792h~iphone.png" width="1792" />
    </platform>
    <plugin name="cordova-plugin-whitelist" spec="1.3.3" />
    <plugin name="cordova-plugin-statusbar" spec="2.4.2" />
    <plugin name="cordova-plugin-device" spec="2.0.2" />
    <plugin name="cordova-plugin-splashscreen" spec="5.0.2" />
    <plugin name="cordova-plugin-ionic-webview" spec="^4.0.0" />
    <plugin name="cordova-plugin-ionic-keyboard" spec="^2.0.5" />
</widget>

@brodybits
Copy link
Contributor

I would recommend raising a new issue with a minimal, reproducible example ([1]). We generally do not provide support for closed issues.

[1] https://stackoverflow.com/help/minimal-reproducible-example

@NikhilGangurde
Copy link

this is the same exact issue that's why I posted my data over here.
So even if you need then I can raise a new issue.

@brodybits brodybits changed the title Error Terminating app due to uncaught exception 'NSInvalidArgumentException' Crash with cordovaSettingForKey selector Aug 31, 2020
@brodybits brodybits reopened this Aug 31, 2020
@brodybits brodybits pinned this issue Aug 31, 2020
@brodybits
Copy link
Contributor

I am now reopening this issue with an updated title. I did find a few cases of problems with cordovaSettingForKey from Google.

This looks like a case of Cordova not able to read the configuration from config.xml. I suspect this is an issue in your app, but I think that Cordova should print some information rather than just crashing.

A reproduction would definitely help us reproduce the issue and avoid it in the future.

@gultyayev
Copy link

Still no news?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
info-needed Further information is requested
Projects
None yet
Development

No branches or pull requests

5 participants