Domanda

I recently updated ADT to point to Google APIs 18. The install went fine it seems and I'm able to point my Project Properties to Google APIs 18, however, Eclipse can't find the package com.google.cast. Anyone else having this problem?

È stato utile?

Soluzione

That's because com.google.cast is not part of Android.

Near as I can tell, you will need to download a ZIP file containing their library project, import it into your IDE, mark it as actually being a library project, then attach that library project to your app.

Actually using those APIs appears to require a whitelisting, and it is in violation of their license to actually distribute an app (or, near as I can tell, source code) without express written permission of Google.

Altri suggerimenti

CommonsWare is correct, additionally, you'll need the v18 Android Support Libraries. v7/mediaRouter & v7/appCompat

I finally got this to work for me. Originally, I tried doing it like I used ActionBarSherlock (making it a library, went to Project -> Properties and told it to use that library, etc) but that didn't work. Finally, I got frustrated and simply moved the GoogleCastSdkAndroid-1.0.0.jar file from the lib folder of the library directly into the lib folder of the project.

So, again, I imported from existing code the SDK into my workspace, then took the jar file from its library and put it directly into my project's lib folder. Not sure if that's how it's supposed to be, but the sample TicTacToe game is now error free and runs on my Nexus 4.

It sounds like you're trying to run one of the Google Cast sample apps without having installed the Google Cast SDK. The instructions for installing the SDK and all necessary support libraries were just uploaded here on GitHub. I'm quoting below the relevant section for installing the Cast SDK itself:

http://developer.android.com/tools/support-library/setup.html#libs-with-res

You can either add the Cast SDK as a library project in your workspace, or add the GoogleCastSdkAndroid-x.x.x.jar directly to the project you're building. The former is recommended if you have multiple Cast-related projects in your workspace.

As a library project: Follow the Support Library setup instructions linked above for your downloaded and extracted SDK.

As an included library:

  1. Copy the /libs folder from your downloaded SDK to your Cast-related project.

  2. In the Package Explorer window, open (your Cast project)/libs and right click on GoogleCastSdkAndroid-x.x.x.jar. Select Build Path->Add to Build Path.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top