【问题标题】:Facebook for Flutter App Crashes on IOS and works fine on AndroidFacebook for Flutter App 在 IOS 上崩溃,但在 Android 上运行良好
【发布时间】:2019-05-31 14:19:20
【问题描述】:

App for unknown Reasons 在按下 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 <…>
Lost connection to device.`

Info.plist

<?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)

【问题讨论】:

    标签: facebook dart flutter dart-packages


    【解决方案1】:

    好的,这是 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”被调用了两次,我应该合并它们

    【讨论】:

    • @ArneWolframm 很高兴听到这个消息^^。
    【解决方案2】:

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

    【讨论】:

    • 这很好,但在我的情况下,它已经是 FacebookAppID 没有错过拼写。
    猜你喜欢
    • 1970-01-01
    • 2020-07-15
    • 1970-01-01
    • 2011-04-05
    • 1970-01-01
    • 2018-07-13
    • 1970-01-01
    • 2021-07-27
    • 1970-01-01
    相关资源
    最近更新 更多