Cannot read property 'env' of undefined while building nativescript-vue project - nativescript

When I building nativescript-vue application using "tns build android --bundle" it shows
Project successfully prepared (android)
Executing after-prepare hook from D:\Downloads\User\Desktop\App\hooks\after-prepare\nativescript-dev-webpack.js
Cannot read property 'env' of undefined

Related

Flutter Module won't build in iOS

I'm getting this error when trying to build iOS app with flutter module injected in it. I added the FLUTTER_ROOT and flutter dependencies in pod are successfully installed but the build fails getting this error:
ERROR: Unknown FLUTTER_BUILD_MODE: vedur_dev.
Valid values are 'Debug', 'Profile', or 'Release' (case insensitive).
This is controlled by the FLUTTER_BUILD_MODE environment variable.
If that is not set, the CONFIGURATION environment variable is used.
You can fix this by either adding an appropriately named build
configuration, or adding an appropriate value for FLUTTER_BUILD_MODE to the
.xcconfig file for the current build configuration (Vedur_Dev).
I added FLUTTER_BUILD_MODE in User-Defined Settings in TARGETS App like this:
And assigned the values iOS understands. I clean the project, but getting exactly the same error.
I'm not sure where am I making a mistake.
Edit: App builds just fine without the module.
We have seen this on our build system as well. The problem seems to be that the flutter scripts can't figure out what kind of build you are running. So to set the FLUTTER_BUILD_MODE environment variable to Release fixed it.
Valid values are Debug, Profile, or Release
Guide for setting enviroment variables for Xcode. (Or via scripts.)

flutter project build error when moved from one PC to other( window to mac)

I move the flutter project from the window PC to Mac. I am facing this error I also try flutter clean but it did not work for. got an error by running flutter create.
could not determine the dependencies of task app complieflutterbuilddebugarm flutter
java.net.URISytaxSException Illegal character in opaque part at index 2:c:\\User\\username\\Androidstudioprojects\\appname\\lib\\main.dart
when I make simple default project on window pc and move it to mac it works fine but my big project is not able to move.
FAILURE: Build failed with an exception.
* Where:
Script '/Users/admin/Desktop/fluttersdk/flutter/packages/flutter_tools/gradle/flutter.gradle' line: 875
* What went wrong:
Could not determine the dependencies of task ':app:compileFlutterBuildDebugArm'.
> java.net.URISyntaxException: Illegal character in opaque part at index 2: C:\\Users\\Waqas\\AndroidStudioProjects\\Naija\\lib\\main.dart
* 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 45s
Finished with error: Gradle task assembleDebug failed with exit code 1
I got this after running flutter create
admin#mac-mini Naija 2 % flutter create
Warning! The 'flutter' tool you are currently running is from a different Flutter repository than the one last used by this package. The repository from which the 'flutter' tool is
currently executing will be used instead.
running Flutter tool: /Users/admin/Desktop/flutter
previous reference : /Users/admin/Desktop/fluttersdk/flutter
This can happen when you have multiple copies of flutter installed. Please check your system path to verify that you are running the expected version (run 'flutter --version' to see
which flutter is on your path).
No option specified for the output directory.
Create a new Flutter project.
If run on a project that already exists, this will repair the project, recreating any files that are missing.
Usage: flutter create <output directory>
-h, --help Print this usage information.
--[no-]pub Whether to run "flutter pub get" after the project has been created.
(defaults to on)
--[no-]offline When "flutter pub get" is run by the create command, this indicates whether to run it in offline mode or not. In offline mode, it will need to have all
dependencies already available in the pub cache to succeed.
--[no-]with-driver-test Also add a flutter_driver dependency and generate a sample 'flutter drive' test.
-t, --template=<type> Specify the type of project to create.
[app] (default) Generate a Flutter application.
[package] Generate a shareable Flutter project containing modular Dart code.
[plugin] Generate a shareable Flutter project containing an API in Dart code with a platform-specific implementation for Android, for iOS code, or for both.
-s, --sample=<id> Specifies the Flutter code sample to use as the main.dart for an application. Implies --template=app. The value should be the sample ID of the desired
sample from the API documentation website (http://docs.flutter.dev). An example can be found at
https://master-api.flutter.dev/flutter/widgets/SingleChildScrollView-class.html
--list-samples=<path> Specifies a JSON output file for a listing of Flutter code samples that can created with --sample.
--[no-]overwrite When performing operations, overwrite existing files.
--description The description to use for your new Flutter project. This string ends up in the pubspec.yaml file.
(defaults to "A new Flutter project.")
--org The organization responsible for your new Flutter project, in reverse domain name notation. This string is used in Java package names and as prefix in the
iOS bundle identifier.
(defaults to "com.example")
--project-name The project name for this new Flutter project. This must be a valid dart package name.
-i, --ios-language [objc, swift (default)]
-a, --android-language [java, kotlin (default)]
--[no-]androidx Generate a project using the AndroidX support libraries
Remove .packages and execute flutter pub get in the command line.
don't copy your .flutter-plugins file
and make sure to run
flutter clean
and
flutter packages get
At last if not above mentioned worked, you try in the same project folder:
flutter create
Faced same problem.
Simply open terminal
Run 'flutter clean',
The error still shows
Now run 'flutter pub get'
if all this did not work, try upgrading your sdk by running
flutter upgrade

Invalid Request upon trying run in simulator

I cannot seem to run anything via iOS simulator in appcelerator today:
STUDIO BUILD: 4.7.0.201607250649
SDK :5.4.0 (have tried a few different sdks versions)
When trying to run I get:
[INFO] : Alloy compiled in 0.65622s [INFO] : Alloy compiler completed successfully [ERROR] : invalid request
That was for existing projects...
When I tried a new project I got a message stating:
The project has an invalid/non-platform GUID. and cannot be run. Would yo like to register the app with the platform, updating its GUID?
Upon clicking yes it does nothing to resolve the issue.
Invalid Request seems to trigger when there is an issue with your authentication with Appcelerator.
Go to terminal a log in again: appc login.
All should work after you've logged in.

Compile Android NDK project error with Gradle

I have an Android project that has a little CPP code inside.
The server that I'm trying to build this project has the Android SDK and the NDK installed and the dir location was set on the system variable section.
When I trying to build the project with gradle I get the following error message:
Execution failed for task ':mobilecoresdk:compileDebugNdk'.
NDK not configured.
I understand that gradle didn't found the NDK dir and therefore it's failed.
When i'm trying to build the project on a differnt pc with Android studio I can build it, since the local.properties file is telling gradle where to find the ndk dir, so the only differance in the server is the local.properties file inside the my project which isn't avilable in the server build proccess.
local.properties content is:
ndk.dir=/Users/avilevinshtein/Library/Android/sdk/ndk-bundle
sdk.dir=/Users/avilevinshtein/Library/Android/sdk
Should I inject this file on the sever? or am i missing something?
Thanks a lot! :)
Set those two environment variables before executing:
ANDROID_HOME=<SDK_Location>
ANDROID_NDK_HOME=<NDK_Location>
If using Jenkisn for building you can use the EnvInject plugin for that.

What is a SwiftShims module?

I'm attempting to transform a Swift v1.2 project into a Swift v2.0 project via Xcode 7.0.
I got this during the build:
Swift had fatal errors constructing the ast context for this module:
missing required module 'SwiftShims' Debug info from this module will
be unavailable in the debugger.
What is the module 'SwiftShims'?
And how would I install it if it is missing?
I was getting a similar error message regarding the SwiftShims module, so this is probably only a partial solution to your case.
I had to clean all the user data Xcode was using and empty all caches. This did the job for me:
How to Empty Caches and Clean All Targets Xcode 4

Resources