iOS发布版在更新GoogleMaps和GooglePlaces pods后崩溃

5

我有一个使用 GoogleMapsGooglePlaces pods 的 Objective-C 应用程序,目前版本为2.7.0

由于最近的弃用,Google 要求升级到v3.0.0

https://developers.google.com/places/ios-sdk/client-migration

问题

当我将应用程序编辑为使用版本 3.0.0 时,它会在启动画面后立即崩溃,无法调用委托的 didFinishLaunchingWithOptions 方法。

这种情况仅限于发布配置,并且仅限于物理设备

#0  0x00000001014d5290 in std::__1::vector<int, std::__1::allocator<int> >::vector(std::__1::vector<int, std::__1::allocator<int> > const&) ()
#1  0x0000000101633178 in std::__1::vector<unsigned int, std::__1::allocator<unsigned int> >::vector(unsigned long) ()
#2  0x0000000101683494 in GMSx_absl::base_internal::InitGetTID() ()
#3  0x000000010167ae38 in void GMSx_absl::base_internal::CallOnceImpl<void (&)()>(std::__1::atomic<unsigned int>*, GMSx_absl::base_internal::SchedulingMode, void (&&&)()) ()
#4  0x00000001016833c4 in GMSx_absl::base_internal::GetTID() ()
#5  0x00000001016566a0 in GMSx_base_logging::LogMessage::Flush() ()
#6  0x00000001016564d4 in GMSx_base_logging::LogMessage::~LogMessage() ()
#7  0x0000000101655290 in (anonymous namespace)::AddFlagValidator(void const*, bool (*)()) ()
#8  0x00000001016841d0 in _GLOBAL__sub_I_vlog_is_on.cc ()
#9  0x0000000102649504 in ImageLoaderMachO::doModInitFunctions(ImageLoader::LinkContext const&) ()
#10 0x0000000102649738 in ImageLoaderMachO::doInitialization(ImageLoader::LinkContext const&) ()
#11 0x0000000102644768 in ImageLoader::recursiveInitialization(ImageLoader::LinkContext const&, unsigned int, char const*, ImageLoader::InitializerTimingList&, ImageLoader::UninitedUpwards&) ()
#12 0x0000000102643798 in ImageLoader::processInitializers(ImageLoader::LinkContext const&, unsigned int, ImageLoader::InitializerTimingList&, ImageLoader::UninitedUpwards&) ()
#13 0x0000000102643854 in ImageLoader::runInitializers(ImageLoader::LinkContext const&, ImageLoader::InitializerTimingList&) ()
#14 0x00000001026326a4 in dyld::initializeMainExecutable() ()
#15 0x0000000102637468 in dyld::_main(macho_header const*, unsigned long, int, char const**, char const**, char const**, unsigned long*) ()
#16 0x0000000102631044 in _dyld_start ()

符号转储

<_NSCallStackArray 0x104f67740>(
0   ???                                 0x00000001050f890c 0x0 + 4379871500,
1   MyApp                              0x00000001010416e0 main + 0,
2   MyApp                              0x0000000101683494 _ZN9GMSx_absl13base_internalL10InitGetTIDEv + 116,
3   MyApp                              0x000000010167ae38 _ZN9GMSx_absl13base_internal12CallOnceImplIRFvvEJEEEvPNSt3__16atomicIjEENS0_14SchedulingModeEOT_DpOT0_ + 88,
4   MyApp                              0x00000001016833c4 _ZN9GMSx_absl13base_internal6GetTIDEv + 420,
5   MyApp                              0x00000001016566a0 _ZN17GMSx_base_logging10LogMessage5FlushEv + 280,
6   MyApp                              0x00000001016564d4 _ZN17GMSx_base_logging10LogMessageD2Ev + 20,
7   MyApp                              0x0000000101655290 _ZN12_GLOBAL__N_116AddFlagValidatorEPKvPFbvE + 316,
8   MyApp                              0x00000001016841d0 _GLOBAL__sub_I_vlog_is_on.cc + 56,
9   ???                                 0x0000000102649504 0x0 + 4335113476,
10  ???                                 0x0000000102649738 0x0 + 4335114040,
11  ???                                 0x0000000102644768 0x0 + 4335093608,
12  ???                                 0x0000000102643798 0x0 + 4335089560,
13  ???                                 0x0000000102643854 0x0 + 4335089748,
14  ???                                 0x00000001026326a4 0x0 + 4335019684,
15  ???                                 0x0000000102637468 0x0 + 4335039592,
16  ???                                 0x0000000102631044 0x0 + 4335013956
)

我所尝试的

只是为了确保它不是一个“虚假错误”:

  • 清除构建文件夹
  • 删除派生数据
  • 删除Pods文件夹和工作区,并使用pod install重新创建所有内容
  • 多次重启Xcode和Mac

但我也尝试了这些解决方法:

  • 禁用位码
  • 将Swift编译设置为无(从最快的一个)

上述任何一项都不能解决或跳过崩溃。 将版本恢复到2.7.0可以使应用程序重新正常工作!

有人用GoogleMaps和GooglePaces库遇到类似问题吗? 还有别的方式可以研究这个问题吗?

解决方案

Pods的版本3.0.3解决了这个错误。


1
“When I edit the app to use the versions 3.0.0” 是什么意思?最新版本的GoogleMaps不是3.0.0。 - El Tomato
谢谢@ElTomato,你给了我正确的建议。Cocoapods无法更新规格,并且没有看到版本3.0.3。我修复了Cocoapods,现在可以使用该版本。 - Luca Corradi
谢谢,@LucaCorradi,你的解决方案对我有用。 - PiyushRathi
如何将GooglePlaces更新到最新版本(3.3.0)?我使用pod update或install,但我的版本始终是2.7.0。谢谢! - Eric
如果你需要精确的 3.3.0 版本,你需要在 Podfile 中设置特定版本 --> pod 'GoogleMaps','3.3.0'。然后如果你运行 pod update,CocoaPods 将强制从存储库获取该版本。如果你仍然看到旧版本被使用,可能是你的 CocoaPods 版本出了问题,你可以尝试升级它。 - Luca Corradi
1个回答

0
Cocoapods 如果版本不匹配会失败,解决方法是:
打开终端并且;
  sudo gem install cocoapods

添加 --pre 以获取最新的预发布版本:

  sudo gem install cocoapods --pre

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接