I am using GoogleMaps iOS SDK (version 2.1.1) and I am using GMSMapView to display a map. On application:didFinishLaunchingWithOptions: the GMS api is initialized by calling:
GMSServices.provideAPIKey("key")
where:
key is the key from https://console.developers.google.com
the Google Maps SDK for iOS is enabled on https://console.developers.google.com
When I run the app from Xcode the map is displayed fine and all map related functionality (including showing map tiles) works as expected (on both simulator and device). However, once the Xcode debug session is terminated the map tiles are not visible (the GMSMapView is empty).
I tried configuring the key (Key restriction) with different values (e.g.
None, iOS APPS (specified app's bundle id) but nothing makes a difference. The map tiles are displayed fine while in xcode debug session but they are not displayed once the debug session is terminated.
My team experienced a similar issue using a data presentation framework we wrote wrapping the Google Maps SDK.
Initially we were linking our CoreApplication, our CoreLibrary, and our MapFramework against Google maps like this:
For reference, here is our original broken Podfile:
# Global platform for the project.
platform :ios, '8.0'
use_frameworks!
source 'https://github.com/CocoaPods/Specs.git'
workspace 'Comprehensive.xcworkspace'
target 'OurApplication' do
pod 'Alamofire', '~> 3.5.1'
pod 'GoogleMaps', '~> 1.13.2'
#other pods
project '../some/path/OurApplication.xcodeproj'
end
target 'CoreFramework' do
pod 'GoogleMaps', '~> 1.13.2'
#other pods
project '../some/path/CoreFramework.xcodeproj'
end
target 'MapFramework' do
pod 'GoogleMaps', '~> 1.13.2'
project '../some/path/MapFramework.xcodeproj'
end
We also spent a lot of time trying a variety of things related to keys, code signing, and even altering the way we instantiated the GMSMapView.
The solution for us was to simply not link our CoreFramework against GoogleMaps.
Our updated working Podfile:
# Global platform for the project.
platform :ios, '8.0'
use_frameworks!
source 'https://github.com/CocoaPods/Specs.git'
workspace 'Comprehensive.xcworkspace'
target 'OurApplication' do
pod 'Alamofire', '~> 3.5.1'
pod 'GoogleMaps', '~> 1.13.2'
#other pods
project '../some/path/OurApplication.xcodeproj'
end
target 'CoreFramework' do
#other pods
project '../some/path/CoreFramework.xcodeproj'
end
target 'MapFramework' do
pod 'GoogleMaps', '~> 1.13.2'
project '../some/path/MapFramework.xcodeproj'
end
Related
In my app I'm using google maps. Now, I realized that you have a build google maps key and release google maps key. When I launch my signed apk into the app store for testing the google maps screen goes grey. And i have to keep signing a new apk and loading it into play store and then test it.
How do I test a release build? Please provide very simple and easy step by step instructions or if you know how to solve the problem with google maps that would be helpful.
Here is a screen shot of how i set up my google maps api in the console for my release one.
Test a release build
open Build Variants
set debug to release
Build and Run
For gray screen
Once you have got the release SHA set in dev console
This is main reason that I forget most of the time
You have two google_maps_api.xml files
One in this folder:
app/src/debug/res/values
Other in this folder:
app/src/release/res/values
But only the debug one contains your API key probably.
You can use gradle tasks to run a release build on emulator.
Default task name is installRelease
just start emulator and fire below command from terminal
./gradlew installRelease
this will install release build into emulator.
I am trying to incorporate Google Drive API into my Objective-C app. I'm using this link. I setup the quickstart example and that works fine. For my app, I added the API using CocoaPods as directed. When I run the app, I get linker errors not finding GTMOAuth2, GTMSessionFetcher and GoogleAPIClient. Here is one example.
ld: warning: directory not found for option '-L/Users/k/Library/Developer/Xcode/DerivedData/DA/dntvfajcuzknsddygndaenxbqsii/Build/Products/Debug-iphonesimulator/GTMOAuth2'
Under Target->Build settings -> other linker flags
-ObjC -l"GTMOAuth2" -l"GTMSessionFetcher" -l"GoogleAPIClient" -framework "Security" -framework "SystemConfiguration" -lz
for run path search paths, I have #executable/Frameworks
Can some provide info on how to probably setup Xcode so it finds GTMOAuth2, GTMSessionFetcher and GoogleAPIClient that are setup by the CocoaPods.
You may want to try the installation process as discussed in Install a Google SDK using CocoaPods or in Google APIs for iOS which gives the following steps in adding a Google SDK to your iOS app:
CocoaPods is used to install and manage dependencies in existing Xcode projects.
Create an Xcode project, and save it to your local machine.
Create a file named Podfile in your project directory. This file defines your project's dependencies, and is commonly referred to as a Podspec.
Open Podfile, and add your dependencies.
Save the file.
Open a terminal and cd to the directory containing the Podfile.
Run the pod install command. This will install the SDKs specified in the Podspec, along with any dependencies they may have.
Open your app's .xcworkspace file to launch Xcode. Use this file for all development on your app.
Please also check the list of CocoaPods published by Google.
Furthermore, you may want to continue the setup using the approaches to add the library to your project as discussed in this GitHub post such as using GTM OAuth2 or Google Sign-In SDK and adding the framework to an Xcode project.
Lastly, to help you troubleshoot problems during installation, you may visit this guide.
Happy that the Android .apk file I built using "ionic build android" worked on a Samsung Note phone.
I would like to try the same app but on a different hardware which is my Nokia Lumia Windows Phone 8.
So I added the platform wp8 first and it went well.
$ ionic platform add wp8
Updated the hooks directory to have execute permissions
WARNING: Applications for platform wp8 can not be built on this OS - darwin.
Adding wp8 project...
Running command: /Users/user01/.cordova/lib/npm_cache/cordova-wp8/3.8.2/package/bin/create /Users/user01/repos/myTabs/platforms/wp8 com.ionicframework.mytabs754813 myTabs
Creating Cordova Windows Project:
App Name : myTabs
Namespace : com.ionicframework.mytabs754813
Path : /Users/user01/repos/myTabs/platforms/wp8
Copying necessary files to /Users/user01/repos/myTabs/platforms/wp8
Updating project files
Running command: /Users/user01/repos/myTabs/hooks/after_prepare/010_add_platform_class.js /Users/user01/repos/myTabs
add to body class: platform-wp8
Installing "cordova-plugin-console" for wp8
Installing "cordova-plugin-device" for wp8
Installing "cordova-plugin-splashscreen" for wp8
Installing "cordova-plugin-statusbar" for wp8
Installing "cordova-plugin-whitelist" for wp8
This plugin is only applicable for versions of cordova-android greater than 4.0. If you have a previous platform version, you do *not* need this plugin since the whitelist will be built in.
Installing "ionic-plugin-keyboard" for wp8
Saving platform to package.json file
A platform already exists - now updating the entry: android platform=android, version=undefined, locator=wp8
However, I got an error when I ran "ionic build wp8".
$ ionic build wp8
Running command: /Users/user01/repos/myTabs/hooks/after_prepare/010_add_platform_class.js /Users/user01/repos/myTabs
add to body class: platform-wp8
Running command: /Users/user01/repos/myTabs/platforms/wp8/cordova/build
ERROR: MSBuild tools not found
ERROR building one of the platforms: Error: /Users/user01/repos/myTabs/platforms/wp8/cordova/build: Command failed with exit code 2
You may not have the required environment or OS to build this project
Error: /Users/user01/repos/myTabs/platforms/wp8/cordova/build: Command failed with exit code 2
Take a closer look at the logs:
WARNING: Applications for platform wp8 can not be built on this OS - darwin.
It is only possible to build wp8 apps on Windows. Of course, you could use Bootcamp, Parallels or any other virtual machine.
For some odd reason after adding an unrelated pod I have been receiving an error message during the build process that indicates FBSDKCorekit.h, FBSDKCopying.h and FBSDKButton.h files are not found. I have followed countless suggestions changing properties in the projects build settings based on suggestions I've found on stackoverflow; however, none seem to work.
I am using Cocoapods so I attempted to uninstall and reinstall it as well as the pre-release version. I cleared the pod cache as well as removed the actual pods folder and podfile.lock and the xcworkspace and re-installed the pod into the project; however, I still recieve the error.
I also removed the project cache and rebuilt it...
Any assistance would be appreciated
Podfile
# define a global platform for your project
platform :ios, '8.4'
# using Swift
use_frameworks!
#
source 'https://github.com/CocoaPods/Specs.git'
# disable bitcode in every sub-target
post_install do |installer|
installer.pods_project.targets.each do |target|
target.build_configurations.each do |config|
config.build_settings['ENABLE_BITCODE'] = 'NO'
end
end
end
target 'MyApp' do
# other pods
pod ...
# Facebook
pod 'FBSDKCoreKit' , '4.9.0-beta2'//4.8 gives same issue
pod 'FBSDKLoginKit', '4.9.0-beta2'
pod 'FBSDKShareKit', '4.9.0-beta2'
# Uber(New pod added)
pod 'UberRides' //actually just realized it's just a wrapper for very simple calls
# ==============================================================
# Sets the inheritance mode for the tests target inheriting
# only the search paths
target 'MyAppTests' do
inherit! :search_paths
end
end
Happened with me after update to cocoapods 1.0.0.beta.6
Next helped to me:
Xcode -> Product -> Clean
Xcode -> Product -> ⌥ + Clean
close Xcode
rm -rf ~/Library/Developer/Xcode/DerivedData
open Xcode and build (was no need to reinstall pods)
There seems to be some bug in cocoapods 1.0.0 Beta versions.
Falling back to v0.39.0 fixes the error.
You might need to remove cocoapods latest beta you have that installed, this question should help.
You don't need to fallback to v0.39.0.
I have currently the following versions:
1. cocoapods-0.38.2
2. cocoapods-0.39.0
3. cocoapods-1.0.0.beta.2
4. cocoapods-1.0.0.beta.3
For me this issue appeared only in beta.5.
So if you want 1.0 go for beta.3.
Xcode 12.5 and Cocoapods 1.10.1 here.
I had this issue when cocoapods updated FBSDKCoreKit to 11.0
I downgraded to 9.3 and it worked again.
pod 'FBSDKCoreKit', '~> 9.3'
I am getting this warning multiple times when i goto a view using google maps.This started as soon as i migrated to swift 2.0 and xcode 7 for my exising project .Im using google maps in my project. See the console log below
I have gone through some links but was not helpful
https://code.google.com/p/gmaps-api-issues/issues/detail?id=8459
https://forums.developer.apple.com/thread/14157
In my case I needed doing 1) update cocoa pod, 2) setup again, and 3) update pods.
1) $ gem update cocoapods
2) $ pod setup
3) $ pod update
As indicated in your console log, this is caused by an issue in the Google Maps SDK. The issue has been fixed in the latest Google Maps SDK release, so if you update it, it should work like before.
If you're using CocoaPods, just add pod 'GoogleMaps' in your podfile and run $ pod install.