问题
I have an app that I've rebuilt using Xcode 7. This app has been using the GoogleMaps IOS SDK. At the same time (big mistake), that I was updating the code to Xcode 7 (for IOS 9 support), I decided to upgrade to the latest version of the GoogleMaps API. This version requires that the project use Podfiles.
I have multiple targets and getting Podfiles to work was a pain, but I got it to work. The app compiles and runs fine in the simulator. The problem comes when I archive the project and try to upload the app to the App Store. I get the following error:
I'm not sure what to do. I can't seem to find any information on this error. Here is a copy of my Podfile:
# Podfile
source 'https://github.com/CocoaPods/Specs.git'
platform :ios, ‘7.0’
# Common Pods
def common_pods
pod 'GoogleMaps'
end
# Target List
target 'app1' do
common_pods
end
target 'app2' do
common_pods
end
target 'app3' do
common_pods
end
Since I don't control the Google API, I can't change their Info.plist file. Am I missing something?
回答1:
After a lot of research, I've concluded that this is in fact a bug with the GoogleMaps API for IOS when compiled using Pods and Xcode 7.
The problem is that the info.plist file under 2 different packages has an illegal value. The solution is to remove that illegal value. This is a pain to do manually. I found a person that had a partial solution. I've expanded their solution to encompass both plist files.
The solution is to add the following code to the end of your Podfile:
# Patch GoogleMaps' bundle to avoid iTunes connect submission error
post_install do |installer|
`/usr/libexec/PlistBuddy -c "Delete :CFBundleSupportedPlatforms" ./Pods/GoogleMaps/Frameworks/GoogleMaps.framework/Resources/GoogleMaps.bundle/Info.plist`
`/usr/libexec/PlistBuddy -c "Delete :CFBundleSupportedPlatforms" ./Pods/GoogleMaps/Frameworks/GoogleMaps.framework/Resources/GoogleMaps.bundle/GMSCoreResources.bundle/Info.plist`
end
This code deletes the illegal values from the plist files and works in both the simulator and on physical devices. Once archived with this new script, the app can be submitted to iTunes without issue.
Hope this helps.
来源:https://stackoverflow.com/questions/32599840/cant-upload-ios-app-to-itunes-with-xcode-7-and-googlemaps-with-podfile