HI guys, trying to use Google Docs with my unity3d application, the problem is that it just don’t work in iOS! It works on standalone, inside the editor and even works in the iOS Simulator, but if you build it and test on the device, it’ll not work.
The output of the error showed when you try to “login” is the following:
ExecutionEngineException: Attempting to JIT compile method '(wrapper managed-to-native) System.Threading.Interlocked:CompareExchange (Google.GData.Client.ServiceEventHandler,Google.GData.Client.ServiceEventHandler,Google.GData.Client.ServiceEventHandler)' while running with --aot-only.
at Google.GData.Client.Service.add_NewFeed (Google.GData.Client.ServiceEventHandler value) [0x00000] in <filename unknown>:0
at Google.GData.Spreadsheets.SpreadsheetsService..ctor (System.String applicationName) [0x00000] in <filename unknown>:0
at FirstTest.SetUp (System.String email, System.String password) [0x00000] in <filename unknown>:0
at FirstTest.OnGUI () [0x00000] in <filename unknown>:0
(Filename: Line: -1)
Here is the complete link to the project(9.5mb)
http://www.mediafire.com/?7388mm9oiq7ki23
The complete code:
using UnityEngine;
using System.Collections;
using System.Collections.Generic;
using Google.GData.Client;
using Google.GData.Extensions;
using Google.GData.Spreadsheets;
public class FirstTest : MonoBehaviour {
public List<string> slist = new List<string>();
public string mail = "";
public string pass = "";
void OnGUI()
{
GUILayout.BeginHorizontal();
GUILayout.Label("email: ");
mail = GUILayout.TextArea(mail, GUILayout.Width(300));
GUILayout.EndHorizontal();
GUILayout.Space(30);
GUILayout.BeginHorizontal();
GUILayout.Label("pass: ");
pass = GUILayout.TextArea(pass, GUILayout.Width(300));
GUILayout.EndHorizontal();
if(GUILayout.Button("Login"))
{
SetUp (mail, pass);
}
// Draw all spreadsheets
PrintAllSpreadSheets();
}
public void SetUp(string email, string password)
{
// Connect to GDocs
SpreadsheetsService myService = new SpreadsheetsService("exampleCo-exampleApp-1");
myService.setUserCredentials(email, password);
Debug.Log("Should be Connected");
// Query for spreadsheets
SpreadsheetQuery query = new SpreadsheetQuery();
SpreadsheetFeed feed = myService.Query(query);
Debug.Log("Your spreadsheets:");
foreach (SpreadsheetEntry entry in feed.Entries)
{
Debug.Log(entry.Title.Text);
slist.Add(entry.Title.Text);
}
}
public void PrintAllSpreadSheets()
{
GUILayout.BeginVertical();
foreach (string item in slist)
{
GUILayout.Label(item);
}
GUILayout.EndVertical();
}
}