【问题标题】:'GooglePlaces/GooglePlaces.h' file not found - undeclared kGMSAutocompleteMatchAttribute未找到“GooglePlaces/GooglePlaces.h”文件 - 未声明的 kGMSAutocompleteMatchAttribute
【发布时间】:2019-08-05 03:44:01
【问题描述】:

我正在尝试从几年前构建一个当时运行良好的应用程序,但现在由于未找到 GooglePlaces.h 而出现错误。

如果没有,我会得到一些未声明的标识符,例如 [突出显示的 enumerateAttribute:kGMSAutocompleteMatchA

我已尝试安装/更新 pod。 我检查了路径

尝试了通常的方法,但没有运气。我希望下面的内容可以帮助有人帮助我....

#import "XLFormGooglePlacesAutoCompletePickerViewController.h"
#import <GoogleMaps/GoogleMaps.h>
#import <GooglePlaces/GooglePlaces.h>

@interface AddressModal : NSObject
@property(retain,nonatomic) NSAttributedString* text;
@end

@implementation AddressModal
+addressModalWithTitle: (NSAttributedString*)title
{
AddressModal* modal = [[self alloc] init];
if(modal){
    NSMutableAttributedString *highlighted = [title mutableCopy];
    [highlighted enumerateAttribute:kGMSAutocompleteMatchAttribute
                       inRange:NSMakeRange(0, highlighted.length)
                       options:0
                    usingBlock:^(id value, NSRange range, BOOL *stop) {
                        if(value){
                            [highlighted addAttribute:NSBackgroundColorAttributeName value:[UIColor colorWithRed:1.0 green:0.9778 blue:0.5437 alpha:1.0] range:range];
                        }
                    }];
    modal.text = highlighted;
}
return modal;
}
@end

部署目标 12.2

XCode 10.3

pod 'UIActionSheet-Blocks'
pod 'GooglePlaces'
pod 'GoogleMaps'
pod 'GooglePlacePicker'
pod 'XLFormGooglePlacesAutoCompletePicker', :path => 'XLFormGooglePlacesAutoCompletePicker'
pod 'QRCodeReaderViewController'

【问题讨论】:

    标签: ios objective-c google-maps


    【解决方案1】:
    1. 从以下链接下载最新版本的 GooglePlaces 和 GoogleMaps:“https://dl.google.com/dl/cpdc/8a8ad90cc90f312f/GooglePlaces-3.3.0.tar.gz”“https://dl.google.com/dl/cpdc/97fb1c4023fbdb2b/GoogleMaps-3.3.0.tar.gz
    2. 将 GoogleMapsBase.framework 和 GooglePlaces.framework 拖入您的项目文件夹
    3. 将框架添加到您的目标中

    【讨论】:

    • 澄清一下,我目前将这些设置如下(GooglePlaces 广告示例); [项目根目录] > Pods > GooglePlaces > Pods > Frameworks > GooglePlaces.framework 你是说应该是相当的; [项目根目录] >GooglePlaces.framework 干杯
    • @MarkAnderson 如果是这种情况,它应该可以在不更改任何内容的情况下工作。也许您的框架的位置与组无关?
    猜你喜欢
    • 2012-03-08
    • 1970-01-01
    • 1970-01-01
    • 2016-04-21
    • 2018-03-02
    • 2019-04-24
    • 2014-09-12
    • 2018-01-09
    • 1970-01-01
    相关资源
    最近更新 更多