Ios --prod build error in ionic 3


#1

hello
i got this error when i type

ionic cordova build ios --prod --release
Error: Error encountered resolving symbol values statically. Calling function 'makeDecorator', function calls are not supported. Consider replacing the function or lambda with a reference to an exported function, resolving symbol Injectable in /Users/apple/Desktop/ionic 2 fin/commerate 3/node_modules/angularfire2/node_modules/@angular/core/src/di/metadata.d.ts, resolving symbol Injectable in /Users/apple/Desktop/ionic 2 fin/commerate 3/node_modules/angularfire2/node_modules/@angular/core/src/di.d.ts, resolving symbol Injectable in /Users/apple/Desktop/ionic 2 fin/commerate 3/node_modules/angularfire2/node_modules/@angular/core/src/core.d.ts, resolving symbol Injectable in /Users/apple/Desktop/ionic 2 fin/commerate 3/node_modules/angularfire2/node_modules/@angular/core/index.d.ts, resolving symbol AngularFireAuth in /Users/apple/Desktop/ionic 2 fin/commerate 3/node_modules/angularfire2/auth/auth.d.ts, resolving symbol AngularFireAuth in /Users/apple/Desktop/ionic 2 fin/commerate 3/node_modules/angularfire2/auth/auth.d.ts


#2

Did you resolve this?


#3
  • Happening also without --release?
  • Post your ionic info output please.
  • Run ionic cordova build ios --prod --verbose and post the output please.
  • Run cordova build ios --debug and post the output please.

#4

ionic build ios --prod --verbose
T

ask: title=build, name=build, summary=Build (prepare + compile) an Ionic project for a given platform.
, <PLATFORM>=, [options]=, title=Do not add default Ionic hooks for Cordova, boolean=true, isProjectTask=true, run=function run(ionic, argv, rawCliArguments) {
  var appDirectory = process.cwd();
  var rawArgs = rawCliArguments.slice(0);
  var cmdName = settings.name;

  // If platform was not passed then add it to the rawArgs
  var runPlatform = argv._[1];
  if (!runPlatform) {
    runPlatform = 'ios';
    rawArgs.splice(1, 0, runPlatform);
  }

  if (runPlatform === 'ios' && os.platform() !== 'darwin') {
    log.error('✗ You cannot run iOS unless you are on Mac OSX.');
    return Q();
  }

  var promiseList = []
    .concat(!cordovaUtils.isPlatformInstalled(runPlatform, appDirectory) ?
      cordovaUtils.installPlatform(runPlatform) :
      [])
    .concat(!cordovaUtils.arePluginsInstalled(appDirectory) ?
      cordovaUtils.installPlugins() :
      []);

  return Q.all(promiseList).then(function() {
    return npmScripts.hasIonicScript('build');
  })
  .then(function(hasBuildCommand) {
    if (hasBuildCommand) {
      return npmScripts.runIonicScript('build', rawArgs.slice(2));
    }
    return Q.resolve();
  })
  .then(function() {

    // ensure the content node was set back to its original
    return ConfigXml.setConfigXml(appDirectory, {
      resetContent: true,
      errorWhenNotFound: false
    });
  })
  .then(function() {
    var optionList = cordovaUtils.filterArgumentsForCordova(cmdName, argv, rawArgs);
    return cordovaUtils.execCordovaCommand(optionList);
  })
  .catch(function(ex) {
    if (ex instanceof Error) {
      log.error(ex);
    }
  });
}
Looking up Ionic root, cwd: /Users/rossrawlins/Desktop/Work/EngagementFactory/MobileEvent_V2.0
Ionic root directory:  /Users/rossrawlins/Desktop/Work/EngagementFactory/MobileEvent_V2.0
Package.json found scripts: clean=ionic-app-scripts clean, build=ionic-app-scripts build, lint=ionic-app-scripts lint, ionic:build=ionic-app-scripts build, ionic:serve=ionic-app-scripts serve

Npm scripts: clean=ionic-app-scripts clean, build=ionic-app-scripts build, lint=ionic-app-scripts lint, ionic:build=ionic-app-scripts build, ionic:serve=ionic-app-scripts serve
Gulpfile found: false 


> EventsFactory@2.6.788 ionic:build /Users/rossrawlins/Desktop/Work/EngagementFactory/MobileEvent_V2.0
> ionic-app-scripts build "--prod" "--verbose"

[13:50:13]  ionic-app-scripts 1.3.7 
[13:50:13]  build prod started ... 
[13:50:13]  clean started ... 
[13:50:13]  clean finished in 1 ms 
[13:50:13]  copy started ... 
[13:50:13]  ngc started ... 
[13:50:16]  ionic-app-script task: "build" 
[13:50:16]  Error: Error encountered resolving symbol values statically. Calling function 'makeDecorator', function 
            calls are not supported. Consider replacing the function or lambda with a reference to an exported function, 
            resolving symbol Injectable in 
            /Users/rossrawlins/Desktop/Work/EngagementFactory/MobileEvent_V2.0/node_modules/@ionic/cloud-angular/node_modules/@angular/core/src/di/metadata.d.ts,
            resolving symbol OpaqueToken in 
            /Users/rossrawlins/Desktop/Work/EngagementFactory/MobileEvent_V2.0/node_modules/@ionic/cloud-angular/node_modules/@angular/core/src/di/opaque_token.d.ts,
            resolving symbol OpaqueToken in 
            /Users/rossrawlins/Desktop/Work/EngagementFactory/MobileEvent_V2.0/node_modules/@ionic/cloud-angular/node_modules/@angular/core/src/di/opaque_token.d.ts
Error: Error encountered resolving symbol values statically. Calling function 'makeDecorator', function calls are not supported. Consider replacing the function or lambda with a reference to an exported function, resolving symbol Injectable in /Users/rossrawlins/Desktop/Work/EngagementFactory/MobileEvent_V2.0/node_modules/@ionic/cloud-angular/node_modules/@angular/core/src/di/metadata.d.ts, resolving symbol OpaqueToken in /Users/rossrawlins/Desktop/Work/EngagementFactory/MobileEvent_V2.0/node_modules/@ionic/cloud-angular/node_modules/@angular/core/src/di/opaque_token.d.ts, resolving symbol OpaqueToken in /Users/rossrawlins/Desktop/Work/EngagementFactory/MobileEvent_V2.0/node_modules/@ionic/cloud-angular/node_modules/@angular/core/src/di/opaque_token.d.ts
    at Error (native)
    at syntaxError (/Users/rossrawlins/Desktop/Work/EngagementFactory/MobileEvent_V2.0/node_modules/@angular/compiler/bundles/compiler.umd.js:1550:34)
    at simplifyInContext (/Users/rossrawlins/Desktop/Work/EngagementFactory/MobileEvent_V2.0/node_modules/@angular/compiler/bundles/compiler.umd.js:23870:23)
    at StaticReflector.simplify (/Users/rossrawlins/Desktop/Work/EngagementFactory/MobileEvent_V2.0/node_modules/@angular/compiler/bundles/compiler.umd.js:23882:13)
    at StaticReflector.annotations (/Users/rossrawlins/Desktop/Work/EngagementFactory/MobileEvent_V2.0/node_modules/@angular/compiler/bundles/compiler.umd.js:23331:41)
    at NgModuleResolver.resolve (/Users/rossrawlins/Desktop/Work/EngagementFactory/MobileEvent_V2.0/node_modules/@angular/compiler/bundles/compiler.umd.js:13883:70)
    at CompileMetadataResolver.getNgModuleMetadata (/Users/rossrawlins/Desktop/Work/EngagementFactory/MobileEvent_V2.0/node_modules/@angular/compiler/bundles/compiler.umd.js:14473:60)
    at addNgModule (/Users/rossrawlins/Desktop/Work/EngagementFactory/MobileEvent_V2.0/node_modules/@angular/compiler/bundles/compiler.umd.js:23050:58)
    at /Users/rossrawlins/Desktop/Work/EngagementFactory/MobileEvent_V2.0/node_modules/@angular/compiler/bundles/compiler.umd.js:23061:14
    at Array.forEach (native)

npm ERR! Darwin 16.6.0
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "run" "ionic:build" "--" "--prod" "--verbose"
npm ERR! node v6.9.4
npm ERR! npm  v3.10.10
npm ERR! code ELIFECYCLE
npm ERR! EventsFactory@2.6.788 ionic:build: `ionic-app-scripts build "--prod" "--verbose"`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the EventsFactory@2.6.788 ionic:build script 'ionic-app-scripts build "--prod" "--verbose"'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the EventsFactory package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     ionic-app-scripts build "--prod" "--verbose"
npm ERR! You can get information on how to open an issue for this project with:
npm ERR!     npm bugs EventsFactory
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!     npm owner ls EventsFactory
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     /Users/rossrawlins/Desktop/Work/EngagementFactory/MobileEvent_V2.0/npm-debug.log
Spawn command ionic:build completed

#5

Please edit your post and use the </> button above the post input field to format your code or error message or wrap it in ``` (“code fences”) manually. This will make sure your text is readable and if it recognizes the programming language it also automatically adds code syntax highlighting. Thanks.


#6

Done cordova is not he issue its ionic that wont build.


#7

So npm run ionic:build has the same problem?
(Jsut trying to pinpoint the problem right now)


#8

Yes so I have just updated my ionic CLI

Error: Error encountered resolving symbol values statically. Calling function ‘makeDecorator’, function calls are not supported. Consider replacing the function or lambda with a reference to an exported function, resolving symbol Injectable in /Users/rossrawlins/Desktop/Work/EngagementFactory/MobileEvent_V2.0/node_modules/@ionic/cloud-angular/node_modules/@angular/core/src/di/metadata.d.ts, resolving symbol OpaqueToken in /Users/rossrawlins/Desktop/Work/EngagementFactory/MobileEvent_V2.0/node_modules/@ionic/cloud-angular/node_modules/@angular/core/src/di/opaque_token.d.ts, resolving symbol OpaqueToken in /Users/rossrawlins/Desktop/Work/EngagementFactory/MobileEvent_V2.0/node_modules/@ionic/cloud-angular/node_modules/@angular/core/src/di/opaque_token.d.ts

And that is the error I am looking and it seems to be ionic cloud causing the issue? If I have constants is that an issue? Its something I read some where.


#9

(Please also post your `ionic info’ now)


#10

global packages:

@ionic/cli-utils : 1.4.0
Cordova CLI      : 6.5.0 
Ionic CLI        : 3.4.0

local packages:

@ionic/app-scripts              : 1.3.7
@ionic/cli-plugin-cordova       : 1.4.0
@ionic/cli-plugin-ionic-angular : 1.3.1
Cordova Platforms               : android 6.2.3 ios 4.3.1
Ionic Framework                 : ionic-angular 3.4.1

System:

Node       : v6.9.4
OS         : macOS Sierra
Xcode      : Xcode 8.2.1 Build version 8C1002 
ios-deploy : 1.9.1 
ios-sim    : 5.0.13 
npm        : 3.10.10

#11

Looks relevant.


#12

What does your package.json look like?


#13

Ionic cloud released and update that resolved this all.


#14

So you weren’t on the last versoin of @ionic/cloud-angular?


#15

I’ve updated to the latest Ionic and am still having this issue. I don’t get this issue with new projects but I am getting it with a project I upgraded from Ionic 2.0

Here’s my Ionic Info:


global packages:

    @ionic/cli-utils : 1.4.0
    Cordova CLI      : 7.0.1 
    Ionic CLI        : 3.4.0

local packages:

    @ionic/app-scripts              : 1.3.7
    @ionic/cli-plugin-cordova       : 1.4.0
    @ionic/cli-plugin-ionic-angular : 1.3.1
    Cordova Platforms               : android 6.2.3 ios 4.3.1
    Ionic Framework                 : ionic-angular 3.4.2

System:

    Node       : v6.9.4
    OS         : macOS Sierra
    Xcode      : Xcode 8.3.2 Build version 8E2002 
    ios-deploy : 1.9.0 
    ios-sim    : 6.0.0 
    npm        : 3.10.10 

Here’s what verbose printed:

$ ionic cordova build android --prod --release --verbose
[DEBUG] Loading global plugin @ionic/cli-plugin-proxy
[DEBUG] Throwing PLUGIN_NOT_INSTALLED for global @ionic/cli-plugin-proxy
[DEBUG] Loading local plugin @ionic/cli-plugin-cordova
[DEBUG] Loading local plugin @ionic/cli-plugin-ionic-angular
Running app-scripts build: --prod --iscordovaserve --externalIpRequired --nobrowser

[16:25:49]  build prod started ... 
[16:25:49]  clean started ... 
[16:25:49]  clean finished in 1 ms 
[16:25:49]  copy started ... 
[16:25:50]  ngc started ... 
[WARN] Error occurred during command execution from a CLI plugin (@ionic/cli-plugin-cordova). Your plugins may be out of
       date.
[DEBUG] !!! ERROR ENCOUNTERED !!!
Error: Error encountered resolving symbol values statically. Calling function 'makeDecorator', function calls are not supported. Consider replacing the function or lambda with a reference to an exported function, resolving symbol Injectable in /Users/Development/Projects/app/node_modules/@ionic/cloud-angular/node_modules/@angular/core/src/di/metadata.d.ts, resolving symbol OpaqueToken in /Users/Development/Projects/app/node_modules/@ionic/cloud-angular/node_modules/@angular/core/src/di/opaque_token.d.ts, resolving symbol OpaqueToken in /Users/Development/Projects/app/node_modules/@ionic/cloud-angular/node_modules/@angular/core/src/di/opaque_token.d.ts
[DEBUG] Error: Error encountered resolving symbol values statically. Calling function 'makeDecorator', function calls
        are not supported. Consider replacing the function or lambda with a reference to an exported function, resolving
        symbol Injectable in
        /Users/Development/Projects/app/node_modules/@ionic/cloud-angular/node_modules/@angular/core/src/di/metadata.d.ts,
        resolving symbol OpaqueToken in
        /Users/Development/Projects/app/node_modules/@ionic/cloud-angular/node_modules/@angular/core/src/di/opaque_token.d.ts,
        resolving symbol OpaqueToken in
        /Users/Development/Projects/app/node_modules/@ionic/cloud-angular/node_modules/@angular/core/src/di/opaque_token.d.ts
        at Error (native)
        at syntaxError
        (/Users/Development/Projects/app/node_modules/@angular/compiler/bundles/compiler.umd.js:1550:34)
        at simplifyInContext
        (/Users/Development/Projects/app/node_modules/@angular/compiler/bundles/compiler.umd.js:23870:23)
        at StaticReflector.simplify
        (/Users/Development/Projects/app/node_modules/@angular/compiler/bundles/compiler.umd.js:23882:13)
        at StaticReflector.annotations
        (/Users/Development/Projects/app/node_modules/@angular/compiler/bundles/compiler.umd.js:23331:41)
        at NgModuleResolver.resolve
        (/Users/Development/Projects/app/node_modules/@angular/compiler/bundles/compiler.umd.js:13883:70)
        at CompileMetadataResolver.getNgModuleMetadata
        (/Users/Development/Projects/app/node_modules/@angular/compiler/bundles/compiler.umd.js:14473:60)
        at addNgModule
        (/Users/Development/Projects/app/node_modules/@angular/compiler/bundles/compiler.umd.js:23050:58)
        at
        /Users/Development/Projects/app/node_modules/@angular/compiler/bundles/compiler.umd.js:23061:14
        at Array.forEach (native)

#16

Just to be clear, Ionic is separate from Ionic Cloud, so are you using the latest Ionic Cloud version?


#17

I’m using the latest version of Ionic, not using Ionic Cloud


#18

Then why do you have the @ionic/cloud-angular package in your app?


#19

Ah, I see what you mean…

It’s for push notifications. Even so, I made a fresh project, copied over the package.json from the project I’m having the above issue with, ran an npm install and it worked.

It just won’t work for this project that I’ve upgraded from 2.0 to 3.4.2


#21

Ah, found the issue. Was using cloud-angular 0.8.0, set it to 0.12.0 and it worked.