4

未知原因的应用程序在按下 IOS 的 facebook 登录按钮时崩溃,但由于未知原因,它在 android 上运行良好,如果有人遇到此问题,请告诉您如何解决

这是错误

*** First throw call stack:
(
    0   CoreFoundation                      0x000000010ad5229b __exceptionPreprocess + 331
    1   libobjc.A.dylib                     0x000000010a2ee735 objc_exception_throw + 48
    2   FBSDKCoreKit                        0x0000000107cee01e +[FBSDKInternalUtility validateURLSchemes] + 398
    3   FBSDKLoginKit                       0x0000000107df490e -[FBSDKLoginManager logInParametersWithPermissions:serverConfiguration:] + 110
    4   FBSDKLoginKit                       0x0000000107df53d7 -[FBSDKLoginManager logInWithBehavior:] + 103
    5   FBSDKLoginKit                       0x0000000107df5157 -[FBSDKLoginManager logInWithPermissions:handler:] + 391
    6   FBSDKLoginKit                       0x0000000107df2deb -[FBSDKLoginManager logInWithReadPermissions:fromViewController:handler:] + 395
    7   flutter_facebook_login <…&gt;
Lost connection to device.`

信息列表

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
    <dict>
        <key>CFBundleDevelopmentRegion</key>
        <string>en</string>
        <key>CFBundleExecutable</key>
        <string>$(EXECUTABLE_NAME)</string>
        <key>CFBundleIdentifier</key>
        <string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
        <key>CFBundleInfoDictionaryVersion</key>
        <string>6.0</string>
        <key>CFBundleName</key>
        <string>fbTestingApp</string>
        <key>CFBundlePackageType</key>
        <string>APPL</string>
        <key>CFBundleShortVersionString</key>
        <string>$(FLUTTER_BUILD_NAME)</string>
        <key>CFBundleSignature</key>
        <string>????</string>
        <key>CFBundleVersion</key>
        <string>$(FLUTTER_BUILD_NUMBER)</string>
        <key>LSRequiresIPhoneOS</key>
        <true />
        <key>UILaunchStoryboardName</key>
        <string>LaunchScreen</string>
        <key>UIMainStoryboardFile</key>
        <string>Main</string>
        <key>UISupportedInterfaceOrientations</key>
        <array>
            <string>UIInterfaceOrientationPortrait</string>
            <string>UIInterfaceOrientationLandscapeLeft</string>
            <string>UIInterfaceOrientationLandscapeRight</string>
        </array>
        <key>UISupportedInterfaceOrientations~ipad</key>
        <array>
            <string>UIInterfaceOrientationPortrait</string>
            <string>UIInterfaceOrientationPortraitUpsideDown</string>
            <string>UIInterfaceOrientationLandscapeLeft</string>
            <string>UIInterfaceOrientationLandscapeRight</string>
        </array>
        <key>UIViewControllerBasedStatusBarAppearance</key>
        <false />

        <!-- Facebook Login configuration -->
        <key>CFBundleURLTypes</key>
        <array>
            <dict>
                <key>CFBundleURLSchemes</key>
                <array>
                    <string>fb2443122242373229</string>
                </array>
            </dict>
        </array>
        <key>FacebookAppID</key>
        <string>2443122242373229</string>
        <key>FacebookDisplayName</key>
        <string>fbTestingApp</string>

        <key>LSApplicationQueriesSchemes</key>
        <array>
            <string>fbapi</string>
            <string>fb-messenger-share-api</string>
            <string>fbauth2</string>
            <string>fbshareextension</string>
        </array>
        <!-- End of Facebook Login configuration -->

        <!-- Google Sign-in Section -->
        <key>CFBundleURLTypes</key>
        <array>
            <dict>
                <key>CFBundleTypeRole</key>
                <string>Editor</string>
                <key>CFBundleURLSchemes</key>
                <array>
                    <string>com.googleusercontent.apps.572121212121-axxxxp6vaaaadc06aaaaaacd4d7lbnc</string>
                </array>
            </dict>
        </array>
        <!-- End of the Google Sign-in Section -->
    </dict>
</plist>

有人遇到过类似的问题吗?!

Github 问题链接(https://github.com/roughike/flutter_facebook_login/issues/64

4

2 回答 2

17

好的,这是 pinfo 文件中的一个缺失,应该是:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
    <dict>
        <key>CFBundleDevelopmentRegion</key>
        <string>en</string>
        <key>CFBundleExecutable</key>
        <string>$(EXECUTABLE_NAME)</string>
        <key>CFBundleIdentifier</key>
        <string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
        <key>CFBundleInfoDictionaryVersion</key>
        <string>6.0</string>
        <key>CFBundleName</key>
        <string>fbTestingApp</string>
        <key>CFBundlePackageType</key>
        <string>APPL</string>
        <key>CFBundleShortVersionString</key>
        <string>$(FLUTTER_BUILD_NAME)</string>
        <key>CFBundleSignature</key>
        <string>????</string>
        <key>CFBundleVersion</key>
        <string>$(FLUTTER_BUILD_NUMBER)</string>
        <key>LSRequiresIPhoneOS</key>
        <true />
        <key>UILaunchStoryboardName</key>
        <string>LaunchScreen</string>
        <key>UIMainStoryboardFile</key>
        <string>Main</string>
        <key>UISupportedInterfaceOrientations</key>
        <array>
            <string>UIInterfaceOrientationPortrait</string>
            <string>UIInterfaceOrientationLandscapeLeft</string>
            <string>UIInterfaceOrientationLandscapeRight</string>
        </array>
        <key>UISupportedInterfaceOrientations~ipad</key>
        <array>
            <string>UIInterfaceOrientationPortrait</string>
            <string>UIInterfaceOrientationPortraitUpsideDown</string>
            <string>UIInterfaceOrientationLandscapeLeft</string>
            <string>UIInterfaceOrientationLandscapeRight</string>
        </array>
        <key>UIViewControllerBasedStatusBarAppearance</key>
        <false />

        <!-- FACEBOOK&GOOGLE CONFIG START HERE -->
        <key>CFBundleURLTypes</key>
        <array>
            <dict>
                <key>CFBundleURLSchemes</key>
                <array>
                    <string>fb2443122242373229</string>
                </array>
            </dict>

            <dict>
                <key>CFBundleTypeRole</key>
                <string>Editor</string>
                <key>CFBundleURLSchemes</key>
                <array>
                    <string>com.googleusercontent.apps.572121212121-axxxxp6vaaaadc06aaaaaacd4d7lbnc</string>
                </array>
            </dict>
        </array>

        <key>FacebookAppID</key>

        <string>2443122242373229</string>
        <key>FacebookDisplayName</key>

        <string>fbTestingApp</string>

        <key>LSApplicationQueriesSchemes</key>
        <array>
            <string>fbapi</string>
            <string>fb-messenger-share-api</string>
            <string>fbauth2</string>
            <string>fbshareextension</string>
        </array>
        <!-- FACEBOOK&GOOGLE CONFIG END HERE -->
    </dict>
</plist>

我发现“CFBundleURLTypes”被调用了两次,我应该合并它们

于 2019-01-07T15:10:23.530 回答
1

我收到此错误是因为我将 plist 条目设置为FacebookAppId,但需要FacebookAppID。最后一个字母大写。

于 2020-01-03T19:51:00.677 回答