Cocoa Pods and Google Maps SDK - google-maps-sdk-ios

When using CocoaPods to get the Google Maps SDK for iOS, I'm having troubles importing the sdk header file (#import <GoogleMaps/GoogleMaps.h>).
I'm new to CocoaPods but I think I have everything working fine with the other libraries that I use (RestKit, AFNetworking...).
For these APIs I still need to import the lib like this #import <AFNetworking/AFNetworking.h> instead of just #import "AFNetworking". But it works fine.
For Google Maps SDK I need to import it like this #import <Google-Maps-iOS-SDK/GoogleMaps/GoogleMaps.h> which leads to a compilation error because in the GoogleMaps.h header the other files are imported like this:
#import <GoogleMaps/GMSCameraPosition.h>
#import <GoogleMaps/GMSCameraUpdate.h>
#import <GoogleMaps/GMSCircle.h>
...
Did I miss something?

You should not have to import anything linked with CocoaPods using < and >. It should simply be #import "Foo.h". In the case of Google Maps based on my test project I just had to use #import "GoogleMaps.h" and it imported correctly. Make sure you're installing with the newest version of CocoaPods (pod --version currently 0.21.0) otherwise you may need to update it ([sudo] gem update). Also make sure you're opening the created xcworkspace file instead of the xcodeproject

I ran into the same issue(and am using cocoapods), specifically where the error "GoogleMaps.h" file not found. My solution(if the above fails to work), is that your Pods' Target Support Files fail to include the correct header path for "GoogleMaps.h".
Step #1
If you examine your project directory in Finder, click on Pods directory, then Public directory, then GoogleMaps directory, you'll notice that there is a second GoogleMaps directory. Inside that second GoogleMaps directory contains the header files pertaining to the GoogleMaps pod. Now time to check that Pods target support files have this path as the header path for GoogleMaps.
Step #2
Close Xcode Project. Go to the parent directory of your project. For me, it's my home directory, which can be reached at cd ~. Traverse into your Pods' Target support files:
cd ~/{your_project_name}/Pods/Target Support Files/Pods
Then open up your Pods.debug.xcconfig file in your favorite editor:
vi Pods.debug.xcconfig
Edit the line
HEADER_SEARCH_PATHS = $(inherited) "${PODS_ROOT}/Headers/Public" "${PODS_ROOT}/Headers/Public/GoogleMaps"
with the new header path
HEADER_SEARCH_PATHS = $(inherited) "${PODS_ROOT}/Headers/Public" "${PODS_ROOT}/Headers/Public/GoogleMaps/GoogleMaps"
Leave the rest of the Pods.debug.xcconfig untouched. Follow this same process for Pods.release.xcconfig.
Step #3
Re-open your .xcworkspace file. Clean your project(cmd-shift-k) and then re-build(cmd-b).

Related

How to configure JupyterLab to look the same when opened?

I'm developing a small application using JupyterLab that I will distribute around the world. I would like to configure JupyterLab so that when my users download my code, move into the directory, and execute jupyter-lab, they will always start with the same view.
For example, I want JupyterLab to open up with the README.md file shown rendered as markdown. I don't want Python or Jupyter Notebook files opened (initially).
Is there a way to configure JupyterLab in this way?*
You can use jupyterlab-workspace.json file to specify layout. Here are some examples:
Dask: jupyterlab-workspace.json binder
Pangeo: jupyterlab-workspace.json binder
Ian's demo (possibly outdated)
They work by executing the following command before starting up JupyterLab:
jupyter lab workspaces import jupyterlab-workspace.json
Do NOT try to create the JSON file manually (do not use them as a reference). Instead create a new workspace, arrange tabs/files as you wish and then use:
jupyter lab workspaces export workspace_name > jupyterlab-workspace.json
See the workspaces documentation for more details. There is also a relevant topic on discourse.
For your particular use case I would just create a file with a script that your users would use instead of executing jupyter-lab, e.g. a simple two-liner like:
jupyter-lab workspaces import jupyterlab-workspace.json
jupyter-lab
But if you just want one single file to be shown you may as well just create a wrapper that asks for that file to be opened like:
jupyter-lab README.md
Please note that there was a bug that meant that above did not work some time ago (it is working well if you have the latest versions of jupyterlab-server, jupyter-server, jupyterlab; while updating remember to update nbclassic - if installed - as well).

BigCommerce stencil bundle theme validating issues in schema.json file

Hello developers out here!
I struggle with stencil bundle and stencil push issues.
I get error at "Validating theme..."
Error: Your theme's schema.json has errors:
schema[1].settings[28].options[0].value should be string,number
schema[1].settings[28].options[1].value should be string,number
...
It seems that I get this issue after try to test latest cornerstone (5.4.5) theme version, and update stencil-cli and now I can't use oldest version (1.10.0) schema.json file -> https://github.com/bigcommerce/cornerstone/blob/1.10.0/schema.json
Now it only works with these two files:
schema.json -> https://github.com/bigcommerce/cornerstone/blob/4.5.4/schema.json
schemaTranslations.json -> https://github.com/bigcommerce/cornerstone/blob/4.5.4/schemaTranslations.json
But I am not sure how it would impact live site work if I use different schema files.
It is possible to work again with old schema.json file?
Previously all worked...
I tried to:
delete all node_modules
reinstall #bigcommerce/stencil-cli
and node modules (npm install)
These look similar to errors when the schema.json or schemaTranslations.json file have been removed or modified, could you add any relevant schema code in your post? Since Stencil CLI 2.0, part of the bundle process now validates a schemaTranlsations.json file which has been included since Cornerstone 4.5.4. This change can be found on the GitHub repo here as well as on our DevCenter Changelog.
Hello #dakterits and #kyle-obrien
The error which you mentioned means that option number 0 and 1 in setting number 28 in the schema file has either empty value or different value. So, to fix this issue, you don't have downgrade the node or reinstall stencil or delete any file.
The Solution:
Download the original copy of the theme.
Edit the original theme schema file.
If you have any file compare software then compare edited theme schema with original theme schema.
Once you compare, you will definitely see any change in value in defined settings.

How to use docson widget with Sphinx on ReadTheDocs

I'm working on the documentation (https://global-coffee-data-standard.readthedocs.io) of my JSON schema (https://raw.githubusercontent.com/andrejellema/GlobalCoffeeDataStandard/master/schema/global-coffee-data-standard.schema.json)
The basics I have working (thanks to a lot of help from this forum) but now I would like to include the docson widget to show my code more beautiful (https://global-coffee-data-standard.readthedocs.io/en/latest/explanation.html#id13)
I've read this page https://threesixtygiving-standard.readthedocs.io/en/latest/_static/docson/README/ and I'm wondering how to install docson locally but more important on ReadTheDocs.
Do I need to run npm i docson localy? If so which files do I commit to my _static folder so ReadTheDocs can work with it as well?
Or can I put some magic in conf.py to let Sphinx handle it?
EDIT
I tried adding the docson files to my _static folder and it seems to work when I add this code to my ReST file:
<script src="_static/docson/js/widget.js" data-schema="https://raw.githubusercontent.com/andrejellema/GlobalCoffeeDataStandard/master/schema/global-unique-id.json"></script>
But only when I add just one docson widget. When I add more I get this error in the console:
only one instance of babel-polyfill is allowed.
So I'm assuming this is not the correct workflow.
What is the correct workflow to add multiple docson widgets to my page.

Unable to update file in appDataFolder using Google Drive REST API V3 on Android

This is the code i'm using to update the file.
File metadata = generateFileMetadata(fileId, thumbnail, properties);
return mService.files().update(fileId, metadata, generateFileContents())
.setFields("id, name, appProperties")
.execute();
This code generates a
java.lang.IllegalArgumentException.
at com.google.api.client.repackaged.com.google.common.base.Preconditions.checkArgument(Preconditions.java:111)
at com.google.api.client.util.Preconditions.checkArgument(Preconditions.java:37)
at com.google.api.client.googleapis.media.MediaHttpUploader.setInitiationRequestMethod(MediaHttpUploader.java:872)
at com.google.api.client.googleapis.services.AbstractGoogleClientRequest.initializeMediaUpload(AbstractGoogleClientRequest.java:237)
at com.google.api.services.drive.Drive$Files$Update.<init>(Drive.java:3163)
at com.google.api.services.drive.Drive$Files.update(Drive.java:3113)
Using breakpoints I could see that the String passed to the setInitiationRequestMethod is PATCH (not POST or PUT):
public MediaHttpUploader setInitiationRequestMethod(String initiationRequestMethod) {
Preconditions.checkArgument(initiationRequestMethod.equals(HttpMethods.POST)
|| initiationRequestMethod.equals(HttpMethods.PUT));
this.initiationRequestMethod = initiationRequestMethod;
return this;
}
this is what i have in my build.gradle
compile 'com.google.android.gms:play-services-identity:8.4.0'
compile('com.google.api-client:google-api-client-android:1.21.0') {
exclude group: 'org.apache.httpcomponents'
}
compile('com.google.apis:google-api-services-drive:v3-rev11-1.21.0') {
exclude group: 'org.apache.httpcomponents'
}
if I remove the file content (generateFileContents()) I'm able to update the metadata just fine.
How do I solve this?
I ran into this bug while writing a Drive REST API integration for an Android app (with Android Studio/Gradle). Since I'm not particularly experienced with Android's build system, resolving the issue cost me a few hours. Maybe this helps somebody with the same problem:
Clone the google-api-java-client repo from GitHub https://github.com/google/google-api-java-client
Install Maven https://maven.apache.org/run-maven/ (e.g. brew install maven on OSX)
On the command line, change into the google-api-client sub dir of the repo you cloned above
Run mvn clean install
This will produce a subdir called target in the google-api-client directory
In there, find google-api-client-1.22.0-SNAPSHOT.jar, rename it to google-api-client-1.21.00.jar (the renaming is probably not needed)
Drop the .jar in the libs folder of your android project
Tell Gradle to ignore the google-api-client dependency of the libraries you use, in my case this was:
compile('com.google.api-client:google-api-client-android:1.21.0') {
exclude group: 'org.apache.httpcomponents'
exclude module: 'google-api-client'
}
compile('com.google.apis:google-api-services-drive:v3-rev14-1.21.0') {
exclude group: 'org.apache.httpcomponents'
exclude module: 'google-api-client'
}
Add the Jackson dependency again, in case you miss it now. Do the same with other google-api-java-client dependencies if you need them.
compile('com.google.http-client:google-http-client-jackson2:1.21.0'){
exclude group: 'org.apache.httpcomponents'
}
Build your project, update(...) should now work.
Make a note to scrap these changes once Google has updated the library.
Take a look at the current commit of the google-api-java-client.
Unfortunately the fix was not released yet (fix on 21 Nov 2015 vs release on 19 Nov 2015), so you may have to build locally the project (with maven for instance)
The MediaHttpUploader javadocs suggests that it will only be used for HttpMethods#POST, and HttpMethods#UPDATE. Using update, based on the Files resource, indicates its using a PATCH method - leading to the IllegalArgumentException.
The overridden update method should only be used if you're uploading media content.
I have the same exception in a Desktop application.
Instead, using the Drive Api V2, the update goes well.

ConfigurationBuilder Twitter4j class not found

Sorry, but it seems i cannot find any ConfigurationBuilder class in Twitter4j.
I'm using twitter4j version 3.0.3. I have already tried 3.0.2 android version too.
I have added the jar to build path like core, async, media, and stream.
I tried to :
- import twitter4j.*;
- import twitter4j.conf.*;
- import twitter4j.conf.ConfigurationBuilder;
But Eclipse says that :
Multiple markers at this line
- ConfigurationBuilder cannot be resolved to a
type
- ConfigurationBuilder cannot be resolved to a
type
What do i need?
I have already checked the source folders and there is a class named ConfigurationBuilder.java.
Thank you!
You have to make sure that Android Dependencies folder. To do that, you copy the twitter4j jar file to the libs folder and then right click to Configure Path and add the library.
After that's done, you will see that the library is also copied to the dependencies folder.
Right click on the project > Properties > Java Build Path > Libraries
Make sure that twitter4j-core-x.y.z.jar is really there
Go also to Order and Export tab in the same dialog
Make sure that the twitter4j-core-x.y.z.jar is selected (to get the jar distributed with the *.apk or else you will get something similar to the following at runtime: could not find class ConfigurationBuilder)
Project > Clean
Project > Build All