Open dberube opened 9 years ago
Hi. 1) Try installing the lastest Build Tools. You have 20.0.0, now is 21.1.2
2) Change target-api level from 19 to 21 In your config.xml
In ALL the "project.properties" (your project, AppCompatLib, MediarouterLib, PlayServicesLib and ¿optional? CordovaLib): target=android-21
3) If you compile your project with Cordova CLI it's mandatory a copy of AppCompatLib, MediarouterLib and PlayServicesLib accesible inside your project and link dependences to it in your "project.properties" like: android.library.reference.1=CordovaLib android.library.reference.2=path/to/AppCompatLib (... or the name of AppCompat folder) android.library.reference.3=path/to/MediarouterLib android.library.reference.4=path/to/PlayServicesLib
Hope this help you.
I'm now using 21.1.2 Build Tools.
I removed android platform and all plugins associated with it and re-added JUST android platform (cordova platform add android)
I changed project.properties to have target=android-21 in it for both:
platform/android/project.properties.xml && platform/android/CordovaLib/project.properties.xml
I then try:
cordova plugin add https://github.com/acidhax/cordova-chromecast.git
And get the following output & errors:
https://gist.github.com/7e1aad38fa40dc094a50
On line #59 it shows target as being 19, not sure why it's defaulting to that, or if that even matters at this step...
But the errors start right after that point.
Any and all help is greatly appreciated!
Hi If the three libraries are inside your project you can do it manually as pkaul explain in this thread: https://github.com/GetVideostream/cordova-chromecast/issues/7
Note: You can copy the three libraries manually without installing through google-play-services plugin (and not install this plugin), then change the project.properties (android-target=21). In mediarouter add appcompat library reference In your proyect add the three libraries references then go to each library folders and execute: $ android update lib-project -p $ ant clean $ ant release
And finally compile your project.
Unfortunately, nothing works......
Just a note, I am using Ionic w/ Cordova...
I create a new ionic/cordova project.
I do the following:
Am I'm missing a step/procedure or doing something out of place??
Thanks.
Also, I tried another approach.
I copied all 3 library directories into platforms/android/
I changed project.properties to have target=android-21 instead of target=android-19 in all 3 files.
I modified platforms/android/mediarouter/project.properties to be: https://gist.github.com/d66ef0f38b3a31dab4a0
I also changed platforms/android/project.properties and CordovaLib/project.properties to also have target=android-21 instead of target=android-19
I modified platforms/android.project.properties to be: https://gist.github.com/c075ee7ab093ea068695
I've included everything and modified everything as has been suggested.... Unless I'm including something wrong?
I then ran:
In all three lib directories (not Cordova, and not platforms/android).
Everything has worked fine up until this point.
I then try to add this Plugin via:
cordova plugin add https://github.com/GetVideostream/cordova-chromecast.git
And get this output: https://gist.github.com/92c56ad0514fb815485f
If you read the top, it's trying to install another copy (different directory names) of the 3 libraries -- is that the problem?
Hi I added some fixes to the plugin. Try to add from my fork: $ cordova plugin add https://github.com/Vaporexpress/cordova-chromecast.git
Soon I will send the Pull Request.
Looks like it installed just fine -- any pointers on usage -- nothing I'm doing seems to work chrome undefined, etc type errors everywhere when I try to implement.
Thanks again, you've been great help.
Now you can try this. https://github.com/Vaporexpress/Cordova-CastVideos-chrome A sample from scratch.
when I do cordova run -cl (console output and live reload) I get the following console JS error:
136131 error Uncaught TypeError: Object prototype may only be an Object or null: undefined, http://10.0.1.81:8100/plugins/acidhax.cordova.chromecast/chrome.cast.js, Line: 579
This is line 579:
chrome.cast.Session.prototype = Object.create(EventEmitter.prototype);
Did or do you also get that when using?
Is with your project or with the sample i put? Follow the steps in the previous sample, it's cristal clear. ... And look at the implementation. Plugin needs work after document ready is loaded and so on.
That last issue was with my own prototype, not your sample.
Your sample, worked perfectly on first run and without changing anything too much...
As soon as I put it in Ionic, I get this error in JS Console, builds are all 100% now (using all of your same files in www):
4 061333 error Uncaught ReferenceError: chrome is not defined, http://10.0.1.81:8100/lib/js/chromecast-video.js, Line: 138
I can't thank you enough man, you've put in a lot of work helping me, so thank you -- it's soo close.
Line 138:
if (!chrome.cast || !chrome.cast.isAvailable) {
Interesting.. try putting
<script>
window.chrome = {};
</script>
in the HEAD of the page.
Please see Gist here: https://gist.github.com/dberube/27b18797ba0c95d10e10
cordova run errors with:
BUILD FAILED /Users/david/Android/sdk/tools/ant/build.xml:720: The following error occurred while executing this line: /Users/david/Android/sdk/tools/ant/build.xml:734: Compile failed; see the compiler error output for details.
Total time: 3 seconds
/Users/david/Mobile/TestApp/platforms/android/cordova/node_modules/q/q.js:126 throw e; ^ Error code 1 for command: ant with args: debug,-f,/Users/david/Mobile/TestApp/platforms/android/build.xml,-Dout.dir=ant-build,-Dgen.absolute.dir=ant-gen Error: /Users/david/Mobile/TestApp/platforms/android/cordova/run: Command failed with exit code 8 at ChildProcess.whenDone (/usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/cordova/superspawn.js:135:23) at ChildProcess.emit (events.js:98:17) at maybeClose (child_process.js:756:16) at Process.ChildProcess._handle.onexit (child_process.js:823:5)
Might be related to my other issue of not appearing to be able to add Google Play Services plugin (another Issue).