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.
Related
I have an problem building hello world flutter project for arm64 (apple m1 pro silicon) macos platform:
$ flutter build macos
Running "flutter pub get" in flutter_application_1... 234ms
💪 Building with sound null safety 💪
--- xcodebuild: WARNING: Using the first of multiple matching destinations:
{ platform:macOS, arch:arm64, id:00006000-000C09201A06801E }
{ platform:macOS, arch:x86_64, id:00006000-000C09201A06801E }
Snapshot not compatible with the current VM configuration: the snapshot requires 'release no-code_comments no-dwarf_stack_traces_mode lazy_async_stacks lazy_dispatchers no-dedup_instructions no-asserts use_field_guards use_osr no-branch_coverage x64-sysv no-compressed-pointers no-null-safety' but the VM has 'release no-code_comments no-dwarf_stack_traces_mode lazy_async_stacks lazy_dispatchers no-dedup_instructions no-asserts use_field_guards use_osr no-branch_coverage arm64-sysv no-compressed-pointers no-null-safety'
Command PhaseScriptExecution failed with a nonzero exit code
** BUILD FAILED **
Building macOS application...
Build process failed
Unfortunately I'm not an expert on flutter and flutter build tools, but it seems that flutter builds x86_64 binary and tries to run it on aarch64 platform for some reason. How can I make flutter to build aarch64 version of app?
Template project built with command:
flutter create --template app --platforms macos hello_world
Tools version info:
$ flutter --version
Flutter 3.0.4 • channel stable • https://github.com/flutter/flutter.git
Framework • revision 85684f9300 (3 months ago) • 2022-06-30 13:22:47 -0700
Engine • revision 6ba2af10bb
Tools • Dart 2.17.5 • DevTools 2.12.2
$ sw_vers
ProductName: macOS
ProductVersion: 12.1
BuildVersion: 21C52
$ xcodebuild -version
Xcode 13.0
Build version 13A233
The main issue was with the way I've installed flutter: nixpkgs. It tries to find tools in wrong folder. After modifying patches https://github.com/NixOS/nixpkgs/pull/196133 for macos everything works fine.
i'm actually trying to run my app but i'm stucked with that error :
Running "flutter pub get" in riverpod_stacked_app...
Launching lib/main.dart on sdk gphone x86 arm in debug mode...
Running Gradle task 'assembleDebug'...
../../.pub-cache/hosted/pub.dartlang.org/get-3.15.0/lib/get_navigation/src/extension_navigation.dart:235:37: Error: No named parameter with the name 'shadowThemeOnly'.
final theme = Theme.of(context, shadowThemeOnly: true);
^^^^^^^^^^^^^^^
../../development/flutter/packages/flutter/lib/src/material/theme.dart:119:20: Context: Found this candidate, but the arguments don't match.
static ThemeData of(BuildContext context) {
^^
../../.pub-cache/hosted/pub.dartlang.org/get-3.15.0/lib/get_navigation/src/extension_navigation.dart:431:43: Error: No named parameter with the name 'shadowThemeOnly'.
theme: Theme.of(key.currentContext, shadowThemeOnly: true),
^^^^^^^^^^^^^^^
../../development/flutter/packages/flutter/lib/src/material/theme.dart:119:20: Context: Found this candidate, but the arguments don't match.
static ThemeData of(BuildContext context) {
^^
FAILURE: Build failed with an exception.
* Where:
Script '/Users/Alex/development/flutter/packages/flutter_tools/gradle/flutter.gradle' line: 900
* What went wrong:
Execution failed for task ':app:compileFlutterBuildDebug'.
> Process 'command '/Users/Alex/development/flutter/bin/flutter'' finished with non-zero exit value 1
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
* Get more help at https://help.gradle.org
BUILD FAILED in 19s
Exception: Gradle task assembleDebug failed with exit code 1
I don't understand why it can't build. I don't see the link between those 2 errors :
get_navigation
something with the theme from material.dart
And my actual motivation to use riverpod, stacked_services and firebase.
Here is the result of flutter doctor -v :
[✓] Flutter (Channel master, 1.24.0-8.0.pre.98, on Mac OS X 10.15.7 19H2 darwin-x64, locale fr-FR)
• Flutter version 1.24.0-8.0.pre.98 at /Users/Alex/development/flutter
• Framework revision ef4ec09a06 (6 hours ago), 2020-11-05 08:02:13 -0800
• Engine revision bf259226b2
• Dart version 2.12.0 (build 2.12.0-21.0.dev)
[✓] Android toolchain - develop for Android devices (Android SDK version 30.0.2)
• Android SDK at /Users/Alex/Library/Android/sdk
• Platform android-30, build-tools 30.0.2
• Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java
• Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b3-6222593)
• All Android licenses accepted.
[✗] Xcode - develop for iOS and macOS
✗ Xcode installation is incomplete; a full installation is necessary for iOS development.
Download at: https://developer.apple.com/xcode/download/
Or install Xcode via the App Store.
Once installed, run:
sudo xcode-select --switch /Applications/Xcode.app/Contents/Developer
sudo xcodebuild -runFirstLaunch
✗ CocoaPods not installed.
CocoaPods is used to retrieve the iOS and macOS platform side's plugin code that responds to your plugin usage on the Dart side.
Without CocoaPods, plugins will not work on iOS or macOS.
For more info, see https://flutter.dev/platform-plugins
To install see https://guides.cocoapods.org/using/getting-started.html#installation for instructions.
[✓] Android Studio (version 4.1)
• Android Studio at /Applications/Android Studio.app/Contents
• Flutter plugin can be installed from:
🔨 https://plugins.jetbrains.com/plugin/9212-flutter
• Dart plugin can be installed from:
🔨 https://plugins.jetbrains.com/plugin/6351-dart
• Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b3-6222593)
[✓] Connected device (1 available)
• sdk gphone x86 arm (mobile) • emulator-5554 • android-x86 • Android 11 (API 30) (emulator)
! Doctor found issues in 1 category.
And here is my dependencies in pubspeck.yaml
version: 1.0.0+1
environment:
sdk: ">=2.7.0 <3.0.0"
dependencies:
flutter:
sdk: flutter
cupertino_icons: ^1.0.0
stacked_services:
auto_route: 0.6.9
hooks_riverpod: 0.12.1
flutter_hooks:
firebase_core: 0.5.1
firebase_auth: 0.18.2
dev_dependencies:
flutter_test:
sdk: flutter
build_runner:
auto_route_generator:
Any ideas ? I've trie to clean up my dependencies and reinstall. Also i start a blank project with flutter counter app and it runs properly.
I also had this problem today after upgrading Flutter.
I was only able to solve it after I deleted that method parameter from the file that triggered the error. You'll have to delete it in two places.
Search in .pub-cache/hosted/pub.dartlang.org/get-3.15.0/lib/get_navigation/src/extension_navigation.dart for
Theme.of(key.currentContext, shadowThemeOnly: true)
As replace it with
Theme.of(key.currentContext)
This is probably cause by the stacked_services dependency that uses the get: ^3.15.0 dependency
Later edit: this is actually not the best solution, because somebody cloning your repo will not be able to compile the project unless they also to this change
So it's better to upgrade the dependency that causes this error, or replace it with another one; but only after you ran flutter upgrade, or try changing the channel
this is already fixed by getx in 16.1. Pub upgrade will do it
https://github.com/jonataslaw/getx/issues/762
you need to remove only
ThemeData theme = Theme.of(key.currentContext, shadowThemeOnly: false);
if (theme != null) {
bottomSheet = new Theme(data: theme, child: bottomSheet);
}
return bottomSheet;
form your .pubcach folder.
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.
I installed flutter by official docs. When I did flutter doctor -v I don't get information with :
IOS toolchain as my other(old) mac book.
[✓] iOS toolchain - develop for iOS devices (Xcode 11.2.1)
• Xcode at /Applications/Xcode.app/Contents/Developer
• Xcode 11.2.1, Build version 11B500
• ios-deploy 1.9.4
• CocoaPods version 1.8.3
Instead this I get:
> [✓] Xcode - develop for iOS and macOS (Xcode 11.2.1)
> • Xcode at /Applications/Xcode.app/Contents/Developer
> • Xcode 11.2.1, Build version 11B500
> • CocoaPods version 1.8.4
and flutter doesn't see ios-deploy. Which I installed as well.
ios-deploy --version
1.10.0-beta.3
And as result on my new mac book my project doen't work. I cloned the same git branch on my new macbook and get error after run "flutter build ios --release --no-codesign":
8 warnings generated.
=== BUILD TARGET Runner OF PROJECT Runner WITH CONFIGURATION Release ===
ld: targeted OS version does not support use of thread local variables in __ZZN9GMSx_absl18container_internal10RandomSeedEvE7counter for architecture armv7
clang: error: linker command failed with exit code 1 (use -v to see invocation)
#Pro You was right, this is not flutter issue.
Answear:
The issue fixed by changing the Deployment Target from 8.0 to 9.0 in Xcode
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