Compiling with android production options command compiles as iOS App

Hi guys!
I was trying to compile my first Framework7 app for Android production, just for testing.

But when i run npm run build-cordova-android-prod i think it compiles it as a iOS app, since it says “ios”, and then gives a error saying that (correctly, since I am on windows) that I don’t have xcode, even if i’m trying to compile for android.

Output just when i run the command:

 C:\Users\myname\path>npm run build-cordova-android-prod

 > [email protected] build-cordova-android-prod C:\Users\myname\path
 > cross-env TARGET=cordova cross-env NODE_ENV=production node ./build/build.js && cd cordova && cordova build ios

Output at the end of the process:

Thanks in advance!

copy and paste package.json plz

Hello, first of all, great application, thank you for it!

I have the same problem:

$ npm run build-cordova-android-prod

> [email protected] build-cordova-android-prod /home/x/dev/pame/app/f7
> cross-env TARGET=cordova cross-env NODE_ENV=production node ./build/build.js && cd cordova && cordova build ios

If I just go into cordova and do

$ cordova build --release

That works fine.

Another thing, this error only comes up with prod build, not in dev.

This is my package.json file:

{
  "name": "iwido",
  "private": true,
  "version": "1.0.0",
  "description": "iWiDO",
  "repository": "",
  "license": "UNLICENSED",
  "framework7": {
    "cwd": "/home/x/dev/pame/app/f7",
    "type": [
      "cordova"
    ],
    "name": "iWiDO",
    "pkg": "com.venatico.iwido",
    "platform": [
      "ios",
      "android"
    ],
    "framework": "core",
    "template": "split-view",
    "bundler": "webpack",
    "cssPreProcessor": false,
    "customColor": false,
    "iconFonts": true,
    "cordovaFolder": "cordova"
  },
  "scripts": {
    "build-dev": "cross-env NODE_ENV=development node ./build/build.js",
    "build-prod": "cross-env NODE_ENV=production node ./build/build.js",
    "build-cordova-dev": "cross-env TARGET=cordova cross-env NODE_ENV=development node ./build/build.js && cd cordova && cordova build",
    "build-cordova-prod": "cross-env TARGET=cordova cross-env NODE_ENV=production node ./build/build.js && cd cordova && cordova build",
    "build-cordova-ios-dev": "cross-env TARGET=cordova cross-env NODE_ENV=development node ./build/build.js && cd cordova && cordova build ios",
    "build-cordova-ios-prod": "cross-env TARGET=cordova cross-env NODE_ENV=production node ./build/build.js && cd cordova && cordova build ios",
    "build-cordova-android-dev": "cross-env TARGET=cordova cross-env NODE_ENV=development node ./build/build.js && cd cordova && cordova build android",
    "build-cordova-android-prod": "cross-env TARGET=cordova cross-env NODE_ENV=production node ./build/build.js && cd cordova && cordova build ios",
    "dev": "cross-env NODE_ENV=development webpack-dev-server --config ./build/webpack.config.js",
    "start": "npm run dev"
  },
  "browserslist": [
    "Android >= 5",
    "IOS >= 9.3",
    "Edge >= 15",
    "Safari >= 9.1",
    "Chrome >= 49",
    "Firefox >= 31",
    "Samsung >= 5"
  ],
  "dependencies": {
    "dom7": "^2.1.3",
    "framework7": "^4.2.2",
    "framework7-icons": "^2.3.0",
    "template7": "^1.4.1"
  },
  "devDependencies": {
    "@babel/core": "^7.4.3",
    "@babel/plugin-syntax-dynamic-import": "^7.2.0",
    "@babel/plugin-transform-runtime": "^7.4.3",
    "@babel/preset-env": "^7.4.3",
    "@babel/runtime": "^7.4.3",
    "babel-loader": "^8.0.5",
    "chalk": "^2.4.2",
    "copy-webpack-plugin": "^5.0.2",
    "cross-env": "^5.2.0",
    "css-loader": "^2.1.1",
    "file-loader": "^3.0.1",
    "framework7-component-loader": "^1.3.0",
    "html-webpack-plugin": "^3.2.0",
    "mini-css-extract-plugin": "^0.5.0",
    "optimize-css-assets-webpack-plugin": "^5.0.1",
    "ora": "^3.4.0",
    "postcss-loader": "^3.0.0",
    "postcss-preset-env": "^6.6.0",
    "rimraf": "^2.6.3",
    "style-loader": "^0.23.1",
    "uglifyjs-webpack-plugin": "^2.1.2",
    "url-loader": "^1.1.2",
    "webpack": "^4.29.6",
    "webpack-cli": "^3.3.0",
    "webpack-dev-server": "^3.2.1"
  }
}

Again, thanks for this product.

Hello, I am doing some tests in case they help.

I created several apps with different configurations and I get the same error each time.

In this case it is only an app for android && ios, not for web.

I selected only Android this time.

In this occasion the command line seems to be fine, but the error persists.

Before, when I had both ios && android I could build-dev, now I can’t even do that.

If I just go into cordova and compile directly I can not install the application, I get an error

There was a problem while parsing the package

Not very explicit, but that is what it says. Before I was able to install fine.

$npm run build-cordova-dev

[email protected] build-cordova-dev /home/x/dev/pame/app/i
cross-env TARGET=cordova cross-env NODE_ENV=development node ./build/build.js && cd cordova && cordova build

{
  "name": "iwido",
  "private": true,
  "version": "1.0.0",
  "description": "iWiDO",
  "repository": "",
  "license": "UNLICENSED",
  "framework7": {
"cwd": "/home/x/dev/pame/app/iWiDO",
"type": [
  "cordova"
],
"name": "iWiDO",
"pkg": "com.venatico.iwido",
"platform": [
  "android"
],
"framework": "core",
"template": "split-view",
"bundler": "webpack",
"cssPreProcessor": false,
"customColor": false,
"iconFonts": true,
"cordovaFolder": "cordova"
  },
  "scripts": {
"build-dev": "cross-env NODE_ENV=development node ./build/build.js",
"build-prod": "cross-env NODE_ENV=production node ./build/build.js",
"build-cordova-dev": "cross-env TARGET=cordova cross-env NODE_ENV=development node ./build/build.js && cd cordova && cordova build",
"build-cordova-prod": "cross-env TARGET=cordova cross-env NODE_ENV=production node ./build/build.js && cd cordova && cordova build",
"dev": "cross-env NODE_ENV=development webpack-dev-server --config ./build/webpack.config.js",
"start": "npm run dev"
  },
  "browserslist": [
"Android >= 5",
"IOS >= 9.3",
"Edge >= 15",
"Safari >= 9.1",
"Chrome >= 49",
"Firefox >= 31",
"Samsung >= 5"
  ],
  "dependencies": {
"dom7": "^2.1.3",
"framework7": "^4.2.2",
"framework7-icons": "^2.3.0",
"template7": "^1.4.1"
  },
  "devDependencies": {
"@babel/core": "^7.4.3",
"@babel/plugin-syntax-dynamic-import": "^7.2.0",
"@babel/plugin-transform-runtime": "^7.4.3",
"@babel/preset-env": "^7.4.3",
"@babel/runtime": "^7.4.3",
"babel-loader": "^8.0.5",
"chalk": "^2.4.2",
"copy-webpack-plugin": "^5.0.2",
"cross-env": "^5.2.0",
"css-loader": "^2.1.1",
"file-loader": "^3.0.1",
"framework7-component-loader": "^1.3.0",
"html-webpack-plugin": "^3.2.0",
"mini-css-extract-plugin": "^0.5.0",
"optimize-css-assets-webpack-plugin": "^5.0.1",
"ora": "^3.4.0",
"postcss-loader": "^3.0.0",
"postcss-preset-env": "^6.6.0",
"rimraf": "^2.6.3",
"style-loader": "^0.23.1",
"uglifyjs-webpack-plugin": "^2.1.2",
"url-loader": "^1.1.2",
"webpack": "^4.29.6",
"webpack-cli": "^3.3.0",
"webpack-dev-server": "^3.2.1"
  }
}

Another thing I noticed is that if I have ios listed in the target platforms this gets included each time:

static/icons/apple-touch-icon.png 69.8 KiB [emitted]

But now that it is android only, that line is not there.
Thank you.

Hello, its me again.

I did another install with both platforms and found this:

“build-cordova-android-dev”: “cross-env TARGET=cordova cross-env NODE_ENV=development node ./build/build.js && cd cordova && cordova build android”,
“build-cordova-android-prod”: “cross-env TARGET=cordova cross-env NODE_ENV=production node ./build/build.js && cd cordova && cordova build ios”,

It should be cordova build android --release

Same thing as before, if I go into the cordova directory and compile directly it will work, but I can not install in the phone.

Best regards.

Yes, there was a type in this build-cordova-android-prod command. Update to latest F7-CLI, it is fixed there

1 Like