Software Archive
Read-only legacy content
17061 Discussions

[WORKAROUND] TypeError: Cannot read property 'mode' of undefined error - stuck on Cordova export

Joaquim_S_
Beginner
1,476 Views

Hi all!

I googled a bit but most of the time the answer is "upload your project and I'll p.m. you" so I cannot try and solve it on my end...

I'm on linux (Manjaro) and have a fresh intel XDK install version 3922. If I try to build my project with the soon to be deprecated tools, I cannot get past the "building" phase. It just spins endlessly.

If I try and get used to the package + Cordova CLI I cannot create a package. If I delete my developer certificate ( as in the tip says "Packages that will be built using PhoneGap Build or Cordova CLI do not require the “certificate fields” in the Build Settings. Your build certificates will be specified separately through your PhoneGap Build account or in your Cordova CLI project.")  I get the  "One or more of your selected targets has build settings issues. Either deselect the target or fix the build setting issues to proceed."

If I use the certificate and just try to build the package I get the Error - TypeError: Cannot read property 'mode' of undefined.

Any help or tips would be very appreciated.

Jnsantos

 

0 Kudos
6 Replies
PaulF_IntelCorp
Employee
1,476 Views

I'm not sure why you are getting an unending "building" phase...

Add the build certificates to your build settings so that you can export the PhoneGap/Cordova build package. It does not matter which certificates you choose, because they will not be included in the exported package. Not including them does, unfortunately, cause that error message. In other words, the exporter wants to see them in your build settings even though it does not need them for export (that is being fixed in the next release).

Once you have the exported ZIP file, are you able to build it using PhoneGap Build?

0 Kudos
Joaquim_S_
Beginner
1,476 Views

Hi Paul,

I was out of the Uni yesterday so I was unable to retry...

I keep getting the annoying unending "building..."

I'm afraid I cannot do the "Cordova Build Package". After adding the build certificates (it is just the developer certificate, right?) I keep getting the  TypeError: Cannot read property 'mode' of undefined

So I never get to the ZIP file. I'm going to try with a test project - a couple of folders and some files and see what happens.

0 Kudos
Joaquim_S_
Beginner
1,476 Views

Just tried 2 ways to start a new project: importing my html or creating a new project from a template.

If I import my html, even if it is just a www folder with an index file inside I get the same error (TypeError: Cannot read property 'mode' of undefined).

If I use a template, as soon as I press the "Create Package button" I'm taken into a save as dialogue and there's the ZIP file waiting for me...

Any ideas?

Joaquim

PS - I resorted to trickery... I use a template (plain html5) get the project generated and then just copy paste my files & folders into the new project... I would assume some error on my part on setting the project but I'm unable to spot any difference...

PS2 - This, however, doesn't stop the unending "building" cycle...

0 Kudos
PaulF_IntelCorp
Employee
1,476 Views

Joaquim -- I'm sending you a private message to get a copy of the problem project. There must be something about that project structure that is causing the problem. An alternative is to use this script > https://github.com/xmnboy/xdk-to-cli < to do essentially the same thing. --Paul

0 Kudos
PaulF_IntelCorp
Employee
1,476 Views

The export tool is failing because your project is a "web app" project rather than a "cordova" project. In fact, when you build your "web app" project using our build system, you get a "cordova" app, but without any user-specified plugins (there are a few system-supplied plugins which are added automatically). All you need to do is "upgrade" your project to a "cordova" project by pushing the "upgrade" button in the Project Info section at the top of the Projects tab:

Screen Shot 2017-05-17 at 10.04.27 .png

Screen Shot 2017-05-17 at 10.42.13 .png

Screen Shot 2017-05-17 at 10.42.44 .png

p.s. The resulting "cordova" project will result in an identical build as your "web app" project, the only difference between the two project types is whether or not you can add Cordova plugins. The build process, however, is identical for both project types.

0 Kudos
Leonardo_S_
Beginner
1,476 Views

Paul F. (Intel) wrote:

The export tool is failing because your project is a "web app" project rather than a "cordova" project. In fact, when you build your "web app" project using our build system, you get a "cordova" app, but without any user-specified plugins (there are a few system-supplied plugins which are added automatically). All you need to do is "upgrade" your project to a "cordova" project by pushing the "upgrade" button in the Project Info section at the top of the Projects tab:

p.s. The resulting "cordova" project will result in an identical build as your "web app" project, the only difference between the two project types is whether or not you can add Cordova plugins. The build process, however, is identical for both project types.

Thank you, I'll test it

0 Kudos
Reply