pod 'Google-Maps-iOS-SDK', '~> 1.0.2' GMSServices.provideAPIKey("YOUR_API_KEY")app_delegate.rb:6:in `application:didFinishLaunchingWithOptions:': uninitialized constant AppDelegate::GMSServices (NameError)<class name='GMSServices'>
<method class_method='true' selector='SDKVersion'>
<retval type='@' declared_type='NSString*'/>
</method>
<method class_method='true' selector='openSourceLicenseInfo'>
<retval type='@' declared_type='NSString*'/>
</method>
<method class_method='true' selector='provideAPIKey:'>
<arg index='0' type='@' name='APIKey' declared_type='NSString*'/>
<retval type='B' declared_type='BOOL'/>
</method>
</class>
$
app_delegate.rb (I got error on line 20 GMSServices.provideAPIKey(GOOGLE_MAP_API_KEY) that tells (NameError) could not find reference of GMSServices...)
GOOGLE_MAP_API_KEY = "MY_API_KEY"
class GoogleMapsController < UIViewController
def loadView
camera = GMSCameraPosition.cameraWithLatitude(35.689466, longitude: 139.700196, zoom: 15)
@map_view = GMSMapView.mapWithFrame(CGRectZero, camera: camera)
@map_view.myLocationEnabled = true
self.view = @map_view
marker = GMSMarker.alloc.init
marker.position = CLLocationCoordinate2DMake(35.689466, 139.700196)
marker.title = "Shinjuku"
marker.snippet = "Japan"
marker.map = @map_view
end
end
class AppDelegate
def application(application, didFinishLaunchingWithOptions:launchOptions)
GMSServices.provideAPIKey(GOOGLE_MAP_API_KEY)
@window = UIWindow.alloc.initWithFrame(UIScreen.mainScreen.bounds)
@window.rootViewController = GoogleMapsController.new
@window.makeKeyAndVisible
true
end
end
app.vendor_project('vendor/GoogleMaps.framework',
:static,
:products => %w{GoogleMaps},
:headers_dir => 'Headers')
app.resources_dirs << 'vendor/GoogleMaps.framework/Resources'
app.frameworks += %w{AVFoundation CoreData CoreLocation CoreText GLKit ImageIO OpenGLES QuartzCore SystemConfiguration}
app.libs += %w{/usr/lib/libicucore.dylib /usr/lib/libc++.dylib /usr/lib/libz.dylib}
# -*- coding: utf-8 -*-
$:.unshift("/Library/RubyMotion/lib")
require 'motion/project/template/ios'
require 'rubygems'
require 'motion-cocoapods'
Motion::Project::App.setup do |app|
# Use `rake config' to see complete project settings.
app.name = 'VeliQuest'
app.archs['iPhoneOS'] = ['armv7']
app.pods do
pod 'Google-Maps-iOS-SDK'
end
end
app.resources_dirs << 'vendor/GoogleMaps.framework/Resources'
app.frameworks += %w{AVFoundation CoreData CoreLocation CoreText GLKit ImageIO OpenGLES QuartzCore SystemConfiguration}
app.libs += %w{/usr/lib/libicucore.dylib /usr/lib/libc++.dylib /usr/lib/libz.dylib}
<method class_method='true' selector='cameraWithLatitude:longitude:zoom:'>
<arg index='0' name='latitude' declared_type='CLLocationDegrees' type='d'/>
<arg index='1' name='longitude' declared_type='CLLocationDegrees' type='d'/>
-<arg index='2' name='zoom' declared_type='id' type='@'/>
+<arg index='2' name='zoom' declared_type='CGFloat' type='f'/>
<retval declared_type='GMSCameraPosition*' type='@'/>
</method>
<method class_method='true' selector='cameraWithLatitude:longitude:zoom:bearing:viewingAngle:'>
<arg index='0' name='latitude' declared_type='CLLocationDegrees' type='d'/>
<arg index='1' name='longitude' declared_type='CLLocationDegrees' type='d'/>
-<arg index='2' name='zoom' declared_type='id' type='@'/>
+<arg index='2' name='zoom' declared_type='CGFloat' type='f'/>
<arg index='3' name='bearing' declared_type='CLLocationDirection' type='d'/>
<arg index='4' name='viewingAngle' declared_type='double' type='d'/>
<retval declared_type='GMSCameraPosition*' type='@'/>
</method>
<method class_method='true' selector='cameraWithTarget:zoom:'>
<arg index='0' name='target' declared_type='CLLocationCoordinate2D' type='{_CLLocationCoordinate2D=dd}'/>
-<arg index='1' name='zoom' declared_type='id' type='@'/>
+<arg index='1' name='zoom' declared_type='CGFloat' type='f'/>
<retval declared_type='GMSCameraPosition*' type='@'/>
</method>
<method class_method='true' selector='cameraWithTarget:zoom:bearing:viewingAngle:'>
<arg index='0' name='target' declared_type='CLLocationCoordinate2D' type='{_CLLocationCoordinate2D=dd}'/>
-<arg index='1' name='zoom' declared_type='id' type='@'/>
+<arg index='1' name='zoom' declared_type='CGFloat' type='f'/>
<arg index='2' name='bearing' declared_type='CLLocationDirection' type='d'/>
<arg index='3' name='viewingAngle' declared_type='double' type='d'/>
<retval declared_type='GMSCameraPosition*' type='@'/>
</method>
<method selector='initWithTarget:zoom:bearing:viewingAngle:'>
<arg index='0' name='target' declared_type='CLLocationCoordinate2D' type='{_CLLocationCoordinate2D=dd}'/>
-<arg index='1' name='zoom' declared_type='id' type='@'/>
+<arg index='1' name='zoom' declared_type='CGFloat' type='f'/>
<arg index='2' name='bearing' declared_type='CLLocationDirection' type='d'/>
<arg index='3' name='viewingAngle' declared_type='double' type='d'/>
# -*- coding: utf-8 -*-$:.unshift("/Library/RubyMotion/lib")require 'motion/project/template/ios'require 'rubygems'require 'motion-cocoapods'
Motion::Project::App.setup do |app| # Use `rake config' to see complete project settings. app.name = 'VeliQuest' app.archs['iPhoneOS'] = ['armv7'] app.pods do pod 'Google-Maps-iOS-SDK' end app.vendor_project('vendor/Pods/Google-Maps-iOS-SDK/GoogleMaps.framework', :static, :products => %w{GoogleMaps}, :headers_dir => 'Headers') app.resources_dirs << 'vendor/Pods/Google-Maps-iOS-SDK/GoogleMaps.framework/Resources' app.frameworks += %w{AVFoundation CoreData CoreLocation CoreText GLKit ImageIO OpenGLES QuartzCore SystemConfiguration} app.libs += %w{/usr/lib/libicucore.dylib /usr/lib/libc++.dylib /usr/lib/libz.dylib}endGOOGLE_MAP_API_KEY = "YOUR_GOOGLE_API_KEY"
class GoogleMapsController < UIViewController def loadView camera = GMSCameraPosition.cameraWithLatitude(35.689466, longitude: 139.700196, zoom: 15) @map_view = GMSMapView.mapWithFrame(CGRectZero, camera: camera) @map_view.myLocationEnabled = true self.view = @map_view
marker = GMSMarker.alloc.init marker.position = CLLocationCoordinate2DMake(35.689466, 139.700196) marker.title = "Shinjuku" marker.snippet = "Japan" marker.map = @map_view endend
class AppDelegate def application(application, didFinishLaunchingWithOptions:launchOptions) GMSServices.provideAPIKey(GOOGLE_MAP_API_KEY) @window = UIWindow.alloc.initWithFrame(UIScreen.mainScreen.bounds) @window.rootViewController = GoogleMapsController.new @window.makeKeyAndVisible true endend