Software Archive
Read-only legacy content
17060 Discussions

File plugin failes on buid

Mike_C_4
New Contributor I
321 Views

 

Hello,

 
I had to upgrade my File plugin to get a fix for the Samsung Galaxy S6.
I also updated the Capture and Media plugins base on  recommendations from the developers.
 
However my android builds are now failing. see attached screen shot.
 
Is there anyway possible that I can get theses version to compile?  I have two beta tester using Samsung Galaxy S6 and I need to get them my latest version. My live target date is in 2 weeks. 
 
With out this fix I can not release my software. any help would be great.
 
PS I also try to build with just the FIle plugin  update and that failed also.
 
Mike
 
 
0 Kudos
5 Replies
PaulF_IntelCorp
Employee
321 Views

Can you send a private message with a link to a ZIP file of your COMPLETE project directory? We can try to build it and see what the problem is and see what you've included for plugins, etc...

0 Kudos
Mike_C_4
New Contributor I
321 Views
Sent Paul and thank you
0 Kudos
PaulF_IntelCorp
Employee
321 Views

Mike, having trouble importing this project you gave me. First, a few comments:

  • Do you actually need ALL of the plugins you've specified? I'm able to identify a few as required, but some of these seem like they are unneeded. Please prune to those that are actually used by your JS code, this will help to debug the situation.
     
  • Do not reference CDNs or pull in JS files from a network resource. If your user's device has no network connection or a flaky network connection your app is going to fail on startup, because it won't be able to retrieve some critical files. It will be "dead in the water." For example, these lines are going to be a significant problem:
        <link rel="stylesheet" type="text/css" href="http://code.jquery.com/mobile/1.4.3/jquery.mobile.structure-1.4.3.min.css" />
    ...
        <link href="http://netdna.bootstrapcdn.com/font-awesome/4.2.0/css/font-awesome.min.css" rel="stylesheet" type="text/css">
    ...
        <script src="http://cdn.jtsage.com/datebox/latest/jqm-datebox.core.min.js"></script>
        <script src="http://dev.jtsage.com/cdn/datebox/latest/jqm-datebox.mode.flipbox.min.js"></script>
    
  • Regarding the above comment, you should download those files/resources and copy them into your project and reference them locally.
     
  • Install and use the HTML and CSS and JS lint tools, they help find latent bugs immeasurably!
     
  • Remove that reference to the debug script and use the Debug tab. Only use weinre if you absolutely must. Use the Debug tab with a USB-connected device, you'll discover much more. Also, you can build an app and set "debuggable" equal "true" in the additions file to get very high-fidelity debugging for particularly difficult issues. See https://software.intel.com/en-us/xdk/docs/intel-xdk-debug-and-test-overview
     
  • Remove the <project>/www/plugins directory (not the <project>/plugins directory, keep that), it is not being used and is adding tremendous size to your built apps. This is probably a holdover from an older version of the XDK. I'm assuming you are using 2727? If not, please upgrade to that version, the build system will work much better for you (using CLI 5.1.1).
     
  • Do not fill your index.html file with JavaScript. Put that stuff in a separate app.js (or whatever name you prefer) file. It is difficult to lint and debug JS code in the html file. There also is a lot going on inside your device ready, you might be able to restructure the app to minimimize what's in the device ready function. In general, your JS files should all be "definitions" of functions, and then use the device ready function to "kick off" the app. In other words, keep the actual execution of JS limited to after the device ready event has happened, you can define to your heart's content before that moment (which you should do). Hope that makes sense.
     
  • Build with Crosswak, not Android. You will find many discrepancies in the various Android devices out there that will cause you to lose sleep and hair. Use Crosswalk, it is up-to-date and will eliminate those issues.
     
  • I was having trouble reproducing the build error you were seeing, the plugins were all messed up when I imported the project. It was a mixture of 4.1.2 versions and 5.1.1 versions. So I had to start over with the plugins, removing almost all except the third-party plugins you had added, and then slowly adding back the various core Cordova plugins. I don't have enough time to completely debug this, but here's where I ended, assuming that these are the plugins that you are actually using (no easy way to confirm this, I'm guessing):

Screen Shot 2015-12-02 at 12.30.34 PM.png

I'm guessing that the issue you cite regarding the File plugin, which is claimed to be fixed but according to the bug reference is not yet published, may be causing trouble in how the File API is being used? I'm not really clear on what the key problem is (besides the build troubles). But what I was seeing in the project you gave me was a very old version of that plugin, which will definitely not contain the fixes referenced in the issue. Plus the photokandy plugin is quite old, and I believe there have been significant changes in the File plugin API, which could possibly affect how photokandy uses that API (assuming it is using it).

There is too much to know about the internals of this app for me to make any reasonable guesses as to what is wrong. I recommend you take the same approach I did, which is to remove all the plugins and add them back in, one-by-one, building each time, in order to determine where the conflict is.

0 Kudos
Mike_C_4
New Contributor I
321 Views

it seems I sent you a old version of the sotfware if you like could  send you the correct version please let me know

0 Kudos
PaulF_IntelCorp
Employee
321 Views

I will not be off work for the next four days, so don't send to me unless you are willing to wait a while before I can get to it. I probably will not be able to look at it again until Tuesday or Wednesday of next week.

Are you able to perform the experiment that I suggested? Remove all the core Cordova plugins and attempt a build with your third-party plugins (should work if my test is any indication). Then add each one back, one-at-a-time, and perform a build after each add-back. Keep doing this until you find the one causing the conflict. If we can identify the conflict we can make more progress.

0 Kudos
Reply