dart Facebook的Flutter应用程序在iOS上崩溃,在Android上工作正常

oiopk7p5  于 2023-01-22  发布在  Flutter
关注(0)|答案(3)|浏览(143)

应用程序因未知原因崩溃按下Facebook登录按钮的IOS,但它的工作完美的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

hpcdzsge

hpcdzsge1#

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

vxqlmq5t

vxqlmq5t2#

我得到这个错误,因为我有plist条目为FacebookAppId,但需要FacebookAppID。大写最后一个字母。

q3qa4bjr

q3qa4bjr3#

此外,请确保您在Facebook应用ID之后添加了Facebook客户端令牌

...
<key>FacebookAppID</key>
<string>{your-app-id}</string>
<key>FacebookClientToken</key>
<string>CLIENT-TOKEN</string>
...

然后,将CLIENT-TOKEN替换为应用 Jmeter 板中设置〉高级〉客户端令牌下的值。

相关问题