I am integrating YouTube in my app in which I have to login the user for authentication.I got a sample code that is working fine.When I started integrating that code in my app then I am getting some issues.

First:-

When I run the same code in a sample app I made then its telling GTLYouTube.h file missing.I am unable to know how that sample is working even though it does not have that file.

Second:-

Subsequently I added the downloaded file from svn checkout svn checkout http://google-api-objectivec-client.googlecode.com/svn/trunk/ google-api-objectivec-client-read-only and added the files in my app.

Then although the GTLYouTubeConstants.m is present as I can see in Services->Youtube->Generated I am getting error that GTLYouTubeConstants.m file not found.

I am unable to find while compiler is unable to find the file.Is there anything wrong in my implementation?

有帮助吗?

解决方案

Finally I came up with the solution.I need to make a lot of changes in the code which I will write in steps so that it can be helpful for others.

The main problem I got in GTLYouTube_Sources.m,GTLCommon_Sources.m and GTLNetworking_Sources.m.When I used these files from the Sample App the files were missing and I was getting message like GTLYouTubeConstants.m file not found in GTLYouTube_Sources.m file.From the comments of developer in the GTLYouTube_Sources.m I came to know that I can't directly use these files.

* Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0

So I downloaded the files from svn checkout http://google-api-objectivec-client.googlecode.com/svn/trunk/google-api-objectivec-client-read-only and added the files in my app.Then again I got that error but when I removed the GTLYouTube_Sources.m,GTLCommon_Sources.m and GTLNetworking_Sources.m files form the project then the error gone(since I have already added the needed files).

Then again I got the duplicate symbol _OBJC_METACLASS_$ (linker error).Then I had to remove the GTLYouTube_Sources.m from Services->YouTube->Generated folder and the error gone.

I had made some other changes along with this:

I changed my header search path to same that used in Sample App.Also I changed my framework search path to $(SDKROOT)/Developer/Library/Frameworks $(inherited) $(DEVELOPER_FRAMEWORKS_DIR) and I removed all the test files and didn't use any test framework as we can see in the downloaded files.

May be my solution is not proper but it let the code running so please suggest me any improvement needed.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top