Open AVGP opened 10 years ago
The only thing I can think of is make sure your Google APIs are up to date... That happens when the resource XML's aren't included in the project...
Hm, unfortunately all libs are updated (acording to the Android SDK updater) and the build succeeds.. I even rechecked, if all the libprojects have the same compile target as the Cordova project
I have the exact same issue. Did you find a solution?
Same problem here. Any solution on this?
Unfortunately I haven't found a solution to this issue yet.
You have to add those libraries as references! It will not work yet without them.
Just open your project in Eclipse and add the projects
As stated in the issue, the libraries are in there as library projects, no? Check out the project.properties file I pasted in my first message in this issue. What's wrong there?
Or could you paste your project.properties
- maybe the difference emerges from that.
Having exactly the same problem. The java dependencies compile fine, but when I try to initialize the chromecast the cordova app crashes.
Ok thank you very much, now it works!! I imported appcompat and mediarouter separately.
@trenkwaldermartin would you mind explaining in detail what you did that got it working for you?
@AVGP , I haven't had any success either. However, I did manage to get the "refactor" branch to compile. I haven't gotten Chromecast to connect yet, but it does compile using Cordova library versions of mediarouter, appcompat and play services.
@JudeOsborn thanks for the heads up. I will give it a go soon then
Just open your project in Eclipse, and add the requirements!
That's taking a sledgehammer to crack a nut.
Can you please share your project.properties file - at least in excerpt. Because Eclipse is just a few hundred megabytes sugar on top of editing project.properties and running ant.
2014-06-10 18:35 GMT+02:00 Mathieu Gosbee notifications@github.com:
Just open your project in Eclipse, and add the requirements!
— Reply to this email directly or view it on GitHub https://github.com/GetVideostream/cordova-chromecast/issues/7#issuecomment-45638450 .
What ill-conceived sorcery is this... -_- but thanks for the heads up. It makes me sad to see Google build such black magic. Am 12.06.2014 06:30 schrieb "Jude Osborn" notifications@github.com:
I imported the three libraries via eclipse and finally got them to work. However, the results are the same as the "refactor" branch. Everything seems to load okay, but when initializing I get this error:
W/System.err( 7029): java.lang.reflect.InvocationTargetException W/System.err( 7029): at java.lang.reflect.Method.invokeNative(Native Method) W/System.err( 7029): at java.lang.reflect.Method.invoke(Method.java:515) W/System.err( 7029): at acidhax.cordova.chromecast.Chromecast.execute(Chromecast.java:58) W/System.err( 7029): at org.apache.cordova.CordovaPlugin.execute(CordovaPlugin.java:65) W/System.err( 7029): at org.apache.cordova.PluginManager.execHelper(PluginManager.java:242) W/System.err( 7029): at org.apache.cordova.PluginManager.exec(PluginManager.java:227) W/System.err( 7029): at org.apache.cordova.ExposedJsApi.exec(ExposedJsApi.java:53) W/System.err( 7029): at com.android.org.chromium.base.SystemMessageHandler.nativeDoRunLoopOnce(Native Method) W/System.err( 7029): at com.android.org.chromium.base.SystemMessageHandler.handleMessage(SystemMessageHandler.java:24) W/System.err( 7029): at android.os.Handler.dispatchMessage(Handler.java:102) W/System.err( 7029): at android.os.Looper.loop(Looper.java:136) W/System.err( 7029): at android.os.HandlerThread.run(HandlerThread.java:61) W/System.err( 7029): Caused by: org.json.JSONException: Index 1 out of range [0..1) W/System.err( 7029): at org.json.JSONArray.get(JSONArray.java:282) W/System.err( 7029): at org.json.JSONArray.getString(JSONArray.java:451) W/System.err( 7029): at acidhax.cordova.chromecast.Chromecast.launch(Chromecast.java:130)
Definitely a step closer, but not sure what's happening here yet.
@AVGP https://github.com/AVGP , I'm not sure what the difference is. When I imported via eclipse my project.properties looked like this:
android.library.reference.1=CordovaLib
Project target.
target=android-19
Not what I would have expected. No reference here at all to the other three libraries.
— Reply to this email directly or view it on GitHub https://github.com/GetVideostream/cordova-chromecast/issues/7#issuecomment-45829119 .
Actually, never mind my last comment (sort of). I was looking at the wrong project. The libraries are indeed loading (and the sorcery is still there) but I'm not getting that error message. Looks like it's working better now. Not quite connecting to the Chromecast, but I feel like I'm getting close.
You cannot just add the Jar files, you will need to import them as libraries with resources. http://developer.android.com/tools/support-library/setup.html#libs-with-res
@marques99 , we're aware that the jars won't work. The problem is that we've been trying to import the project libraries (the entire folders) using the command line, but have had no success. It has only worked when importing them in Eclipse.
Either way, I noticed the "refactor" branch does a pretty job of importing the dependencies as plug-ins rather than relying on manual import. Hopefully this will happen with master as well.
Yup. We got that from the Google-fu. And that's what we did, as can be seen in the project.properties I posted. No workee. New ideas, please? Am 12.06.2014 06:38 schrieb "marques99" notifications@github.com:
You cannot just add the Jar files, you will need to import them as libraries with resources. http://developer.android.com/tools/support-library/setup.html#libs-with-res
— Reply to this email directly or view it on GitHub https://github.com/GetVideostream/cordova-chromecast/issues/7#issuecomment-45829436 .
Sorry, I deleted my previous post because I had made mistake, but in summary, after importing via eclipse, my project.properties looked like this:
android.library.reference.1=CordovaLib
# Project target.
target=android-19
As @AVGP pointed out toward the beginning of this post, we would have expected each of the three libraries to be referenced here, but that's not the case. Black magic, I say!
Alright - so I had some time today to try setting up a fresh cordova project... and yeah... I cannot get the app to run correctly without some Eclipse intervention. :'(
Once I get it running with Eclipse - the command-line cordova works fine.
The steps I had to take that aren't documented well are the following:
<meta-data android:name="com.google.android.gms.version" android:value="@integer/google_play_services_version" />
to your AndroidManifest.xmlandroid-support-v7-appcompat
, android-support-v7-mediarouter
, google-play-services_lib
I also had some issues after doing this correctly - the way that I fixed those problems is by cleaning the workspace and building each library project one by one manually and finishing by building and debugging the cordova app.
hello nothing of what I ltto helped me titanic undertaking. I was not able to solve it by adding the plugin to mediarouter, appcomat, google-play-services. support-v4, and even with the manual procedure done both manually and with the sublime with both eclipse.
the error I get is always the initial one,
java.lang.NoClassDefFoundError: android.support.v7.mediarouter.R $ string
I tried with both branches (master and refactor).
I also had to slightly modify some java classes to refactor because it gave error in multiple catch.
you could write a complete procedure for the import of libraries and the use of basic chromecast?
@grahamkennery:
I have managed it to perform the mentioned steps without using eclipse. This is what I did
project.properties
of all three projects so that the target
property references a Android version that you have installed locally. If you have installed all Android versions, than you might leave it as it is.mediarouter
add a property android.library.reference.1=../appcompat
to its project.properties
android update lib-project -p .
as well as ant clean
and then ant release
project.properties
. Make sure that these reference are relative paths. Example:
android.library.reference.2=../../extras/google/google_play_services/libproject/google-play-services_lib
android.library.reference.3=../../extras/android/support/v7/mediarouter
android.library.reference.4=../../extras/android/support/v7/appcompat
Still pretty complicated but it works for me.
I followed your instructions to the T and it's working for me now without eclipse. I think it must be the ant clean and ant release that I wasn't doing before. Thank you very much!
I did what @pkaul suggested and it worked. However, I was getting an error upon choosing my chromecast on the list, saying that a com.google.android.gms.version
meta-data
tag was needed in the AndroidManifest.xml
file. So I did what @grahamkennery suggested on step 1 and I got it working.
The file is in the platforms/android/
directory, and the tag must be inside the <application>
tag.
First off: Great work! It's about time that Chromecast support becomes available for Cordova :+1:
However, I have trouble getting your plugin to work :(
I set up my Cordova project with the needed library projects in project.properties:
and it compiles just fine. But when I try to use the chrome.cast.* API like this:
I get the following from
adb logcat
when I launch the app:Thanks for help troubleshooting this one!