Open FreakTheMighty opened 10 years ago
Adding the actual traceback:
-compile:
[javac] Compiling 6 source files to /private/tmp/chrome-app-developer-tool/ChromeAppDevTool/platforms/android/bin/classes
[javac] /private/tmp/chrome-app-developer-tool/ChromeAppDevTool/platforms/android/src/org/apache/cordova/filetransfer/FileTransfer.java:798: cannot find symbol
[javac] symbol : variable pluginManager
[javac] location: interface org.apache.cordova.CordovaWebView
[javac] FileUtils filePlugin = (FileUtils)webView.pluginManager.getPlugin("File");
[javac] ^
[javac] Note: /private/tmp/chrome-app-developer-tool/ChromeAppDevTool/platforms/android/src/org/apache/cordova/filetransfer/FileTransfer.java uses or overrides a deprecated API.
[javac] Note: Recompile with -Xlint:deprecation for details.
[javac] 1 error
I removed the the org.apache.cordova.file-transfer and org.apache.cordova.media-capture then reinstalled them from their respective apache git repos. This allowed me to compile successfully, but resulted in this error upon launch of CADT.
Uncaught Error: Error calling method on NPObject. cordova.js:924 androidExec cordova.js:924 module.exports.bootstrap cordova.js:1469 (anonymous function) cordova.js:1218 build cordova.js:53 require cordova.js:68 (anonymous function) cordova.js:1877 (anonymous function)
Sorry to hear that this has given you so much grief. This sounds like it's all related to the Android 4.0.x branch of Cordova, which we're now using in CADT (but which I don't see mentioned at all in the docs.)
Can you try to clone cordova-android from the source repo, and check out the 4.0.x
branch? When you run createproject.sh
, you'll need to specify that you want cordova-android from a specific location, like this:
export ANDROID_PATH=<path-to-cordova-android>
export PLUGIN_SEARCH_PATH=<path-to-cordova-plugins>
export PLATFORMS=android
./createproject.sh ChromeAppDevTool
That's what I've been using to compile it; hopefully it works for you.
If you're using the latest version of the createproject.sh script, ANDROID_PATH doesn't do anything anymore. It instead uses the copy of cordova-android from within node_modules/cca/cordova/cordova-android.
I think more likely the plugin problem is due to the published version of file-transfer plugin being incompatible, and instead needing the version from master. To get this, clone the file-transfer repo, and use export PLUGIN_SEARCH_PATH=<path-to-file-cloned-plugin>
to tell the script where to find it.
Well, this is what happens when I go away for a week ;)
The JS error:
Uncaught Error: Error calling method on NPObject. cordova.js:924
is something that I've seen when using a version of Cordova-JS that is incompatible with Cordova-Android, since we dropped the location-change bridge mode, I think. Does our node_modules
version of Cordova-Android include the correct JS snapshot?
Certainly hope so! It's what we're using for CCA itself.
On Wed, Aug 6, 2014 at 11:36 AM, Ian Clelland notifications@github.com wrote:
Well, this is what happens when I go away for a week ;)
The JS error:
Uncaught Error: Error calling method on NPObject. cordova.js:924
is something that I've seen when using a version of Cordova-JS that is incompatible with Cordova-Android, since we dropped the location-change bridge mode, I think. Does our node_modules version of Cordova-Android include the correct JS snapshot?
— Reply to this email directly or view it on GitHub https://github.com/MobileChromeApps/chrome-app-developer-tool/issues/28#issuecomment-51352148 .
Is the issue here that you have to have an npm linked version of cca
in chrome-app-developer-tool
?
With the release of 0.3.0 late friday, perhaps the issues goes away if you re-run npm install
?
Just downgraded to cca 0.2.2 and fails to build for android, but succeeds with 0.3.0.
It didn't look like the same error, but I haven't been digging into it.
I'm not sure if the npm install resolved to different versions this time, but like @mmocny said, with cca 0.3.0 the build completed without any changes to the installed plugins.
Unfortunately I'm still getting the error:
Uncaught Error: Error calling method on NPObject
This is the same state that I found after manually installing the master branches of the media-capture and file-transfer plugins.
Just to be 100% sure, did you remove the old version of the plugin before installing from repo?
Earlier this week I attempted to "upgrade" a plugin in-place (cca plugin add foo when foo was already installed). Since this isn't currently supported by cordova-cli, it failed -- but annoyingly the version number in cca plugin ls
was bumped up to the version I attempted to install. Probably some metadata was updated and not rolled back when the install failed.
So, its a long shot, but may you please confirm that the content of the plugin actually matches the latest version?
Thanks!
I did do the remove before adding, but that was on a previous attempt. This time I didn't need to install from master to get it to compile.
I can try again, double check, and report back.
Out of curiosity, does anyone have a working build? If so, it would be helpful if you posted the apk. On Aug 7, 2014 4:17 AM, "Michal Mocny" notifications@github.com wrote:
Just to be 100% sure, did you remove the old version of the plugin before installing from repo?
Earlier this week I attempted to "upgrade" a plugin in-place (cca plugin add foo when foo was already installed). Since this isn't currently supported by cordova-cli, it failed -- but annoyingly the version number in cca plugin ls was bumped up to the version I attempted to install. Probably some metadata was updated and not rolled back when the install failed.
So, its a long shot, but may you please confirm that the content of the plugin actually matches the latest version?
Thanks!
— Reply to this email directly or view it on GitHub https://github.com/MobileChromeApps/chrome-app-developer-tool/issues/28#issuecomment-51458978 .
I played around with this today. The problem is that the plugins used by default are too old. This should be fixed in the next few days as there is a cordova plugin release going on right now.
There are pre-built APKs here: https://github.com/MobileChromeApps/chrome-app-developer-tool/releases
The latest APK doesn't have the plugins that I need. I'll just have to wait until the next release.
On Thu, Aug 7, 2014 at 12:27 PM, agrieve notifications@github.com wrote:
I played around with this today. The problem is that the plugins used by default are too old. This should be fixed in the next few days as there is a cordova plugin release going on right now.
There are pre-built APKs here: https://github.com/MobileChromeApps/chrome-app-developer-tool/releases
— Reply to this email directly or view it on GitHub https://github.com/MobileChromeApps/chrome-app-developer-tool/issues/28#issuecomment-51519680 .
Jesse Vander Does 401-226-8251 | jvanderdoes@gmail.com
Now, building CADT from Source works, however, still I have the error in the Chrome Dev Console:
Uncaught Error: Error calling method on NPObject. cordova.js:924
Any ideas about what it causes? Thanks :)
This error: Uncaught Error: Error calling method on NPObject. cordova.js:924
disappeared when I deleted attaching cordova.js
:
<script src="cordova.js"></script>
I have this error too, but with all my plugins, keyboard (from Ionic), camera.
I found what is the problem.
The first problem is that GitHub search is not so good than google, site:github.com/MobileChromeApps/chrome-app-developer-tool/ NPObject
The issue (in my case) is the CCA include cordova.js
automatically for me. When I add it in my project, things go wrong and any native function doesn't works.
I found it here https://github.com/MobileChromeApps/mobile-chrome-apps/issues/317 and here https://github.com/MobileChromeApps/chrome-app-developer-tool/issues/33
Thank you @mmocny :)
I'm trying to build the CADT from source.
The build fails while compiling the file transfer plugin. Removing the plugin allows the build to complete, but not surprisingly prevents CADT from running properly.