Nativescript 6.5 could not build module 'nanopb' on iOS - nativescript

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.

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.

Related

Nativescript build for ios succeeds but getting error message

Building my app for a device and it seems to succeed but comes back with no .ipa file found - but it's there.
** EXPORT SUCCEEDED **
Project successfully built.
No .ipa found in /Users/mini/Projects/publish-app-ios/platforms/ios/build/Release-iphoneos directory.
the above is a result of a tns build ios --for-device ... command.
My xcode version is 12.5.1 and I would prefer not to update.
I'm using NS 6 and have added the fixes on How to Fix NativeScript Issue with iOS14 and XCode 12
tns run ios works ok?
which version tns-ios using in package.json?
try to set
{
"nativescript": {
"id": "package.name",
"tns-android": {
"version": "6.5.3"
},
"tns-ios": {
"version": "6.5.4"
}
},
...
}
if it was set different version, run tns platform remove ios before tns run
Or do you run tns build for publication?

Can't deploy nativescript app to ios emulator or real device

I have successfully deployed my nativescript app to my ios and android devices and emulators many, many times. But now, when I try to deploy the app to ios, the builder stops at Project successfully prepared (ios) and won't load it to the emulator or device.
I deleted the hooks, node_modules, and platforms folders, then rebuilt with the same result. I can successfully run the app if I run it directly through XCode, just not from the nativescript cli.
Here's the output from tns doctor
✔ Getting environment information
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.6.0 satisfies minimum required version 10.
✔ Getting NativeScript components versions information...
✔ Component nativescript has 6.7.8 version and is up to date.
✔ Component tns-core-modules has 6.5.12 version and is up to date.
✔ Component tns-android has 6.5.3 version and is up to date.
✔ Component tns-ios has 6.5.2 version and is up to date.
Any idea as to why I can deploy from XCode but not the command line?
I have had similar problems in the past, and it has always meant doing an update of Nativescript and then restarting my system. However, your tns doctor output looks basically the same as mine and I'm not having any issues with this. Not sure what to say -- maybe try a new npm install -g nativescript -- but it looks like you are already up to date. I've found in my experiences that this seems to happen if Xcode has updated and the version of Nativescript I have is one behind. Your situation may be for a different reason. Also, for whatever reason, I also found I need to completely reboot (paradoxical as that sounds) after doing an update to get things working again. That led me to speculate at one point that something in the connectivity layer might get jiggered up and causing things to wait for a ready state that never appears (?) but that doesn't really make much sense either on deeper thought. Wish I had a more definitive suggestion!
I finally found the problem. In my situation, the nativescript-videorecorder plugin has a hook that runs during the after-prepare phase of the build process. The after-prepare script creates a promise that only resolves if it finds the AndroidManifest.xml in the platforms folder. When I delete the platforms folder to do a clean rebuild of ios, the AndroidManifest.xml doesn't exist causing the promise to hang.
If I build for android first, the ios build runs fine and deploys to my simulator and real device.
I notified the owner of nativescript-videorecorder. Hopefully this helps someone else who may have a similar problem with this or another plugin.

Cloud build fails for ios sdk target 12.1

Build in sidekick for ios always fails when targeting sdk 12.1. Hoped updating to latest nativescript and sidekick would resolve this problem but it is still there. Android works fine.
I have updated nativescript and sidekick and xcode to latest version, migrated my project. Tried remove/add tns platforms, remove/install xcode, updating components. Problem still persists.
Any help would be much appreciated :)
tns doctor says:
✔ 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 10.3.0 satisfies minimum required version 10.
✔ Getting NativeScript components versions information...
✔ Component nativescript has 6.0.2 version and is up to date.
✔ Component tns-core-modules has 6.0.2 version and is up to date.
⚠ Update available for component tns-android. Your current version is 6.0.0 and the latest available version is 6.0.1.
✔ Component tns-ios has 6.0.1 version and is up to date.
Dependencies in json.package file:
"dependencies": {
"#types/node": "^12.6.8",
"axios": "^0.19.0",
"nativescript-barcodescanner": "^3.2.1",
"nativescript-platform-css": "1.6.9",
"nativescript-theme-core": "1.0.6",
"nativescript-vue": "2.4.0",
"tns-core-modules": "^6.0.2",
"tslib": "^1.10.0",
"vuex": "^3.1.1"
},
"devDependencies": {
"#babel/core": "7.4.5",
"#babel/preset-env": "7.4.5",
"babel-loader": "~8.0.6",
"nativescript-dev-webpack": "1.0.2",
"nativescript-vue-template-compiler": "~2.4.0",
"node-sass": "4.12.0",
"tns-core-modules-widgets": "^6.0.1",
"tns-platform-declarations": "^6.0.2",
"typescript": "3.4.5",
"vue-loader": "~15.7.1"
},
Error output:
[19-07-29 11:38:37.271] (CLI) ** ARCHIVE FAILED ** [19-07-29
11:38:37.271] (CLI) The following build commands failed: [19-07-29
11:38:37.271] (CLI) \tProcessPCH
/tmp/builds//e0e933b61c66a857c8413163ff98f28c705b345f/6.0.2/6.0.1/VetZooExpress/platforms/ios/DerivedData/VetZooExpress/Build/Intermediates.noindex/ArchiveIntermediates/VetZooExpress/PrecompiledHeaders/SharedPrecompiledHeaders/5472762253979011612/VetZooExpress-Prefix.pch.gch
/tmp/builds//e0e933b61c66a857c8413163ff98f28c705b345f/6.0.2/6.0.1/VetZooExpress/platforms/ios/VetZooExpress/VetZooExpress-Prefix.pch normal armv7 objective-c com.apple.compilers.llvm.clang.1_0.compiler
[19-07-29 11:38:37.271] (CLI) (1 failure) [19-07-29 11:38:37.271]
(CLI) [xcode-build] The armv7 architecture is deprecated for your
deployment target (iOS 12.1). You should update your ARCHS build
setting to remove the armv7 architecture. (in target 'VetZooExpress')
[19-07-29 11:38:37.271] (CLI) [xcode-build] clang: error: invalid iOS
deployment version '-miphoneos-version-min=12.1', iOS 10 is the
maximum deployment target for 32-bit targets
[-Winvalid-ios-deployment-target] [19-07-29 11:38:38.710] (CLI) **
ARCHIVE FAILED ** [19-07-29 11:38:38.710] (CLI) The following build
commands failed: [19-07-29 11:38:38.710] (CLI) \tProcessPCH
/tmp/builds//e0e933b61c66a857c8413163ff98f28c705b345f/6.0.2/6.0.1/VetZooExpress/platforms/ios/DerivedData/VetZooExpress/Build/Intermediates.noindex/ArchiveIntermediates/VetZooExpress/PrecompiledHeaders/SharedPrecompiledHeaders/5472762253979011612/VetZooExpress-Prefix.pch.gch
/tmp/builds//e0e933b61c66a857c8413163ff98f28c705b345f/6.0.2/6.0.1/VetZooExpress/platforms/ios/VetZooExpress/VetZooExpress-Prefix.pch normal armv7 objective-c com.apple.compilers.llvm.clang.1_0.compiler
[19-07-29 11:38:38.710] (CLI) (1 failure) [19-07-29 11:38:49.823]
Build step completed.

Getting error `spawn ./gradlew ENOENT` when I run `tns build android`

I'm starting with nativescript. I'm trying to build a hello world application to test it. However, when I run it, I get an exit status 127 for command not found.
Here is how I try to build:
[ahmed#localhost hello]$ tns build android
Executing before-shouldPrepare hook from /home/ahmed/PycharmProjects/hello/hooks/before-shouldPrepare/nativescript-dev-webpack.js
Skipping prepare.
Building project...
Gradle build...
spawn ./gradlew ENOENT
[ahmed#localhost hello]$ echo $?
127
[ahmed#localhost hello]$
If I run tns doctor, everything seems to be ok
[ahmed#localhost hello]$ tns doctor
✔ Getting environment information
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.
✔ Local builds for iOS can be executed only on a macOS system. To build for iOS on a different operating system, you can use the NativeScript cloud infrastructure.
✔ Getting NativeScript components versions information...
✔ Component nativescript has 5.1.0 version and is up to date.
✔ Component tns-core-modules has 5.1.1 version and is up to date.
✔ Component tns-android has 5.1.0 version and is up to date.
✔ Component tns-ios has 5.1.0 version and is up to date.
[ahmed#localhost hello]$
What did I miss?
I ran tns install to install dependencies. That solved my issue.
I was trying several things, the one that worked fort me, was:
ns clean
ns install

Property 'delegate' not found on object of type 'FIRMessaging

Property 'delegate' not found on object of type 'FIRMessaging
I am trying to run my ionic project on a ios platform from Xcode.
Has anyone ever encountered this type of error on cordova.
I have installed plugin: cordova fmc for cloud messaging
cordova plugin add cordova-plugin-fcm
npm install --save #ionic-native/fcm
I have even downgraded from :
"#ionic-native/fcm": "^4.7.0",
to
"#ionic-native/fcm": "^4.0.0",
no success
I have deleted the DerivedData of my project and also ModuleCache.noindex then removing and adding the plarform fixes the problem for me

Resources