Search code examples
nativescript

Nativescript 6.5 could not build module 'nanopb' on iOS


I have a NS 6.5 app which when I try to build fails with the following error: could not build module 'nanopb'

Here is my package.json:

{
  "nativescript": {
    "id": "io.app.app",
    "tns-ios": {
      "version": "6.5.3"
    }
  },
  "description": "NativeScript Application",
  "license": "SEE LICENSE IN <your-license-filename>",
  "repository": "<fill-your-repository-here>",
  "dependencies": {
    "@nativescript/theme": "~2.3.0",
    "@nstudio/nativescript-camera-plus": "3.0.7",
    "@nstudio/nativescript-loading-indicator": "3.0.2",
    "moment": "^2.26.0",
    "nativescript-appversion": "1.4.4",
    "nativescript-carousel": "^6.1.1",
    "nativescript-contacts-lite": "0.2.6",
    "nativescript-custom-bottomsheet": "^1.0.6",
    "nativescript-imagecropper": "^3.0.0",
    "nativescript-iqkeyboardmanager": "^1.5.1",
    "nativescript-masked-text-field": "4.0.3",
    "nativescript-permissions": "1.3.8",
    "nativescript-plugin-firebase": "10.5.2",
    "nativescript-ui-listview": "^8.1.2",
    "tns-core-modules": "6.5.20"
  },
  "devDependencies": {
    "nativescript-dev-webpack": "1.5.1",
    "tns-platform-declarations": "6.5.15",
    "typescript": "~3.5.3"
  },
  "gitHead": "d8bdf0799a219051f28f8abd7c258d2bf2fce6e1",
  "readme": "NativeScript Application"
}

Here is what I get when I run tns doctor:

No issues were detected.
✔ Your ANDROID_HOME environment variable is set and points to correct directory.
✔ Your adb from the Android SDK is correctly installed.
✔ The Android SDK is installed.
✔ A compatible Android SDK for compilation is found.
✔ Javac is installed and is configured properly.
✔ The Java Development Kit (JDK) is installed and is configured properly.
✔ Xcode is installed and is configured properly.
✔ xcodeproj is installed and is configured properly.
✔ CocoaPods are installed.
✔ CocoaPods update is not required.
✔ CocoaPods are configured properly.
✔ Your current CocoaPods version is newer than 1.0.0.
✔ Python installed and configured correctly.
✔ The Python 'six' package is found.
✔ Xcode version 11.5.0 satisfies minimum required version 10.
✔ Getting NativeScript components versions information...
⚠ Update available for component nativescript. Your current version is 6.5.0 and the latest available version is 7.0.10.
✔ Component tns-core-modules has 6.5.20 version and is up to date.
✖ Component tns-android is not installed.
✔ Component tns-ios has 6.5.3 version and is up to date.

I have tried removing the platform, deleting the hooks, node_modules, and platforms, upgrading the firebase plugin, but nothing helps.

Any ideas on what the problem is?

Thanks.


Solution

  • After opening the app in XCode, I tried building it from there. This build succeeded, so I figured that the issue is with NS. I fixed it by trial and error. I kept playing around with the NS global version and finally, everything worked when I downgraded to version 6.2.0.

    Note: Do not forget to clean your app before each test. I use:

    tns platform remove ios
    rm -rf node_modules hooks platforms package-lock.json

    I am not sure why this worked or what the problem was. Perhaps someone from the Nativescript team can shed some light on the topic.