I'm having issues with trying to build a debug module for my app. I'm not entirely sure why it's like this, but I had no problems with this initially. Recently, I've been trying to get IAPs and other core Cordova plugins to work, so my focus was on adding those plugins, and releasing into the Google Play alpha channel, and debugging the IAP just to get things working on a basic level. So I haven't been using the debug module during this time.
I had some rare quirks recently with my dev machine, like having me to force it to shut down and losing debugging mode on my android test phone. So right now, I've just reestablished my dev setup and I'm testing out XDK to make sure I can still do my tests on the device directly, and so I've encountered this problem.
Right now it tells me that I need to update my debug module. So I hit that and wait for the debug build. It tells me that it "Could not generate a debug module". Under Debug Module Error, here's what's in red:
A build log was provided. Here are the last several lines where the error was spotted:
-compile: [javac] Compiling 26 source files to .../builds/build.Uw_EUL.tmp/appanalyzer/platforms/android/bin/classes [javac] .../builds/build.Uw_EUL.tmp/appanalyzer/platforms/android/src/com/intel/xdk/device/Device.java:179: error: cannot find symbol [javac] final ViewGroup parent = (ViewGroup) webView.getEngine().getView().getParent(); [javac] ^ [javac] symbol: method getEngine() [javac] location: variable webView of type CordovaWebView [javac] Note: Some input files use or override a deprecated API. [javac] Note: Recompile with -Xlint:deprecation for details. [javac] 1 error BUILD FAILED .../android-sdk-linux/tools/ant/build.xml:720: The following error occurred while executing this line: .../android-sdk-linux/tools/ant/build.xml:734: Compile failed; see the compiler error output for details. Total time: 7 seconds .../builds/build.Uw_EUL.tmp/appanalyzer/platforms/android/cordova/node_modules/q/q.js:126 throw e; ^ Error code 1 for command: ant with args: release,-f,.../builds/build.Uw_EUL.tmp/appanalyzer/platforms/android/build.xml
And here's what it looks like in XDK. I've also attached the build log file if that's of any help.
I tried removing some of the plugins to see what works and what doesn't. Here's what appears to work (tested this until it showed me it's downloading to my device or it throws me the build error):
For what its worth, the Intel XDK plugins will be deprecated in the near future. You can still use them, but we highly recommend finding a similar Cordova plugin and switching to that.
I am working in a brand new app, started with a blank template (Cordova). I inserted some plugins (none XDK, but the last one is listed as com.intel.xdk.ppfa).
I can build normally, but if I try to debug, I receive an error: Could not generate debug module.
Looking the list, all the plugins are instaled:
The App ID is "com.intel.appx.MoedaseMedalhas.xwalk15"
The App Name is "AP Debug x15 MoedaseMedalhas" Application will be signed. Plugin "cordova-plugin-statusbar" (2.0.0) installed. Plugin "cordova-plugin-device" (1.1.0) installed. Plugin "cordova-plugin-splashscreen" (2.1.0) installed. Plugin "cordova-plugin-camera" (1.2.0) installed. Plugin "cordova-plugin-inappbrowser" (1.1.0) installed. Plugin "cordova-plugin-network-information" (1.1.0) installed. Plugin "cordova-plugin-vibration" (2.0.0) installed. Plugin "cordova-sqlite-storage" (0.7.14) installed. Plugin "org.apache.cordova.dialogs" (0.3.0) installed. Plugin "org.apache.cordova.globalization" (0.3.4) installed. Plugin "com.google.playservices" (19.0.0) installed. Plugin "com.cmackay.plugins.googleanalytics" (0.1.15) installed. Plugin "com.google.admobsdk" (6.12.2) installed. Plugin "cordova-plugin-admob" (2.2.0) installed. Plugin "com.intel.xdk.ppfa" (1.0) installed.
What can be the error? How to solve it? Thanks.
Hamilton, that last plugin (com.intel.xdk.ppfa) is inserted automatically by the debug module builder, it is a helper plugin for the Debug tab.
My suspicion is the debug module builder is having a conflict with one of the plugins on lines 10 and 13-16. Easiest way to find out is by removing them and confirming that you can build a debug module. Then add back, one-by-one, the most important to the least important, building a new debug module after each attempt, until you find the one that is causing the troubles.
Once you find the one that is causing troubles, I would simply debug without that plugin, you might have to add some conditional code around those places in your app that make calls to those APIs, so you avoid calling something that is not there.
p.s. You should also update the versions of those other two core plugins (org.apache.cordova.dialogs and org.apache.cordova.globalization), you are using the CLI 4.1.2 versions for those plugins.