googlesamples / ios-nearby

69 stars 30 forks source link

my app icon goes blank after pod installing #30

Open bj97301 opened 6 years ago

bj97301 commented 6 years ago

Any idea why?

bj97301 commented 6 years ago

Seems like an issue related to ios 11. If this was open source I could fix it for you...

bj97301 commented 6 years ago

Is anyone else experiencing this?

bj97301 commented 6 years ago

I really dont want to pay for support from google to get them to fix their own stuff =/

dan-webb commented 6 years ago

Sorry about the trouble you're having with your app icon. There has apparently been a lot of investigation into this issue by other iOS developers over the last several months. It looks like the problem started occurring in Xcode 9.1, and is seen on projects that don't use CocoaPods. I've been unable to find a definitive cause and solution, but some developers have found workarounds that have worked for their apps.

Here's a possible solution that you can quickly look into: https://stackoverflow.com/questions/46759313/ios11-iphone-app-icon-is-missing-on-ipad/48209677#48209677

And here are some other discussions with possible workarounds. https://stackoverflow.com/questions/46421066/app-icon-missing-ios-11 https://github.com/CocoaPods/CocoaPods/issues/7003#issuecomment-328045681 https://forums.developer.apple.com/thread/91752

As a pod developer, I don't see any solution I can offer from my end. If the root cause is found to be malformed resources in our pod, we'll fix it. Since it started with Xcode 9.1, I'm hoping Apple will release an update that will fix the problem. If you have any ideas for a fix in the Nearby pod, please let me know!

bj97301 commented 6 years ago

Strange. There were only two things that fixed my issue. One was uninstalling the nearby pod and the other was adding this to the bottom of my pod file:

post_install do |installer|
    installer.aggregate_targets.each do |target|
        copy_pods_resources_path = "Pods/Target Support Files/#{target.name}/#{target.name}-resources.sh"
        string_to_replace = '--compile "${BUILT_PRODUCTS_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}"'
        assets_compile_with_app_icon_arguments = '--compile "${BUILT_PRODUCTS_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" --app-icon "${ASSETCATALOG_COMPILER_APPICON_NAME}" --output-partial-info-plist "${BUILD_DIR}/assetcatalog_generated_info.plist"'
        text = File.read(copy_pods_resources_path)
        new_contents = text.gsub(string_to_replace, assets_compile_with_app_icon_arguments)
        File.open(copy_pods_resources_path, "w") {|file| file.puts new_contents }
    end
end
bj97301 commented 6 years ago

Thank you for your reply btwz. I sent many emails to google's api support thing and got no help at all.