2015-08-28 62 views
0

我正在Facebook登錄,我很好地遵循了所有步驟,但配置了我的info.plist。我的xml代碼如下:iOS)我應該在哪裏複製和粘貼facebook XML片段?

<key>CFBundleURLTypes</key> 
<array> 
    <dict> 
     <key>CFBundleURLSchemes</key> 
     <array> 
      <string>fb12345678</string> 
     </array> 
    </dict> 
</array> 

<key>FacebookAppID</key> 
<string>12345678</string> 
<key>FacebookDisplayName</key> 
<string>AppName</string> 

我將此xml添加到'dict'的info.plist文件中,而不是我的projectTest。 所以最後,我完成了我的.plist XML文件

但我得到了一個錯誤

error: couldn't parse contents of '/Users/~/Desktop/app/app/myproject/Info.plist': The data couldn’t be read because it isn’t in the correct format. 

我該如何解決這個問題?

UPDATE

整個的.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>com.myproject.$(PRODUCT_NAME:rfc1034identifier)</string> 
<key>CFBundleInfoDictionaryVersion</key> 
<string>6.0</string> 
<key>CFBundleName</key> 
<string>$(PRODUCT_NAME)</string> 
<key>CFBundlePackageType</key> 
<string>APPL</string> 
<key>CFBundleShortVersionString</key> 
<string>1.0</string> 
<key>CFBundleSignature</key> 
<string>????</string> 
<key>CFBundleVersion</key> 
<string>1</string> 
<key>LSRequiresIPhoneOS</key> 
<true/> 
<key>UILaunchStoryboardName</key> 
<string>LaunchScreen</string> 
<key>UIMainStoryboardFile</key> 
<string>Main</string> 
<key>UIRequiredDeviceCapabilities</key> 

/*FACEBOOK XML IS JUST BELOW*/ 
<key>CFBundleURLTypes</key> 
<array> 
    <dict> 
     <key>CFBundleURLSchemes</key> 
     <array> 
      <string>fb12345678</string> 
     </array> 
    </dict> 
</array> 
<key>FacebookAppID</key> 
<string>12345678</string> 
<key>FacebookDisplayName</key> 
<string>AppName</string> 
/**/ 

<array> 
    <string>armv7</string> 
</array> 
<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> 

+0

後,您可以顯示所有的Info.plist文件的? – anhtu

+0

確保你沒有添加除以外的任何其他標籤,即不在任何打開的標籤之間 –

+0

@ AbdAl-rhmanTaherBadary我更新了我認爲我添加了之內的內容,而不是在任何打開的標籤之間... – LKM

回答

1

你加入在錯誤的位置的片段:

<key>UIRequiredDeviceCapabilities</key> <<----- this one should go with 

/*FACEBOOK XML IS JUST BELOW*/ 
<key>CFBundleURLTypes</key> 
<array> 
    <dict> 
     <key>CFBundleURLSchemes</key> 
     <array> 
      <string>fb12345678</string> 
     </array> 
    </dict> 
</array> 
<key>FacebookAppID</key> 
<string>12345678</string> 
<key>FacebookDisplayName</key> 
<string>AppName</string> 
/**/ 

<array>      << ------------- this one 
    <string>armv7</string> 
</array> 

之前加入FB片段3210 <key>UIRequiredDeviceCapabilities</key>

<array>      << ------------- this one 
     <string>armv7</string> 
    </array> 
+0

哇!感謝您的詳細信息,但是當我修復這個錯誤時,我對Facebook教程感到非常不友善......爲什麼位置發生錯誤? – LKM

+0

也許你理解了一些東西。您可以通過** Open As - > Property List **模式添加(而不是通過**源代碼***打開)。這很容易。 – anhtu

+0

出現此錯誤的原因是''標籤的值必須落後。這是' armv7 '在這種情況下。你打破了XML格式。 – anhtu