Nativescript 1.3.0 intsllation issue - nativescript

I will try my best to explain what I did and where I am right now. I am using window7
What I did for installation.
Installed jdk and updated the environment path variable and created new one JAVA_HOME
Downloaded Gradle and updated the environment path pointing to bin directory of gradle
Installed android sdk with all the specified version, sdk tool, and platform tools.
Created ANDROID_HOME variable.
Remove and Reinstalled Nativescript
Ran tns doctor command and result can be found here
Launched the app via tns run android --emulator and tried on device as well error received was "Unfortunately mysir has stopped" and log can be found here.
Now Can anyone please tell me what I am missing?

Check out if <your app>\platforms\android\src\main\assets\internal\prepareExtend.js file exists. This file is supposed to be created when you execute tns platform add android command. If the file does not exist then it may be better to create a new project.

well the whole problem was I was not running command npm install tns-core-modules --save after creating new project.

Related

How to change windows build version name in Flutter?

My version of Flutter is 3.3.6.
I created a Windows exe application with Flutter, but its version number has always been 1.0.0.0. I tried to change the version in pubspec.yaml, which has no effect. I tried to pass parameters in the packaging command, but it didn't take effect.
fvm flutter build windows --build-name=1.0.3 --build-number=3
Does anyone know what to do?
1- change version in pubspec.yaml
2- run command:
flutter build windows --build-name=1.0.3 --build-number=3
Your project can be updated using these steps:
Verify you are on Flutter version 3.3 or newer using flutter --version
If needed, use flutter upgrade to update to the latest version of the Flutter SDK
Backup your project, possibly using git or some other version control system
Delete the windows/runner/CMakeLists.txt and windows/runner/Runner.rc files
Run flutter create --platforms=windows .
Review the changes to your windows/runner/CMakeLists.txt and windows/runner/Runner.rc files
Verify your app builds using flutter build windows
https://docs.flutter.dev/development/platform-integration/windows/version-migration

Flutter_CLI: Because every version of flutterfire_cli depends on xml >=5.3.0 which requires SDK version >=2.14.0 <3.0.0, flutterfire_cli is forbidden

I am trying to install firebase_cli for my flutter project, but it tells me:
"Because every version of flutterfire_cli depends on xml >=5.3.0 which
requires SDK version >=2.14.0 <3.0.0, flutterfire_cli is forbidden"
Showing that my SDK version is 2.13.4 and it needs 2.14.0 onwards.
I went to flutter console as administrator and run choco upgrade dart-sdk. It told me I now have version v2.17.3.
However, I still get the same problem in flutterfire_cli.
Things I've tried:
creating a .bashrc file with the line export PATH="$PATH": "C:\Users\sjrol\OneDrive\Documentos\flutter\.pub-cache\bin" in it (it is the route flutter console told me to save).
creating a system environment variable inside PATH that points to my dart folder , with the newer version.
In my pubspec.yaml file I've got .
Then rebooted the PC. Same problem. No idea of what's happening.
Dart pub global and choco upgrade results (running the firebase console as administrator):
Flutter doctor (I don't use android studio so no problem, and the android status problem is something I've been facing for a long time and has never given me any problem. Maybe it still has something to do with this?).
I can tell I'm working with the new dart version in my VSCode now, thanks to the new features it has, but firebase still won't let me install CLI. Thank you in advance for your help.
Try this:
Change your sdk version in pubspec.yaml to sdk: ">=2.17.3 <3.0.0"
Run dart --version to make sure the new path is working
Run flutter clean
Run the app

Nativescript doctor throws warnings and errors

I want to connect my virtual android device to nativescript sidekick.
When I open NativeScript Sidekick and click on "Virtual Device Launcher" Button, I get the following error message.
[20-03-24 09:50:23.966] Unable to execute avdmanager, ensure JAVA_HOME is set and points to correct directory
So I ran tns doctor:
TIP: To avoid setting up the necessary environment variables, you can use the chocolatey package manager to install the Android SDK and its dependencies.
There seem to be issues with your configuration.
Component nativescript has 6.5.0 version and is up to date.
Your ANDROID_HOME environment variable is set and points to correct directory.
WARNING: WARNING: adb from the Android SDK is not installed or is not configured properly.
For Android-related operations, the NativeScript CLI will use a built-in version of adb.
To avoid possible issues with the native Android emulator, Genymotion or connected
Android devices, verify that you have installed the latest Android SDK and
its dependencies as described in http://developer.android.com/sdk/index.html#Requirements
WARNING: WARNING: The Android SDK is not installed or is not configured properly.
You will not be able to run your apps in the native emulator. To be able to run apps
in the native Android emulator, verify that you have installed the latest Android SDK
and its dependencies as described in http://developer.android.com/sdk/index.html#Requirements
WARNING: Cannot find a compatible Android SDK for compilation. To be able to build for Android, install Android SDK 28 or later.
Run `$ sdkmanager` to manage your Android SDK versions.
WARNING: You need to have the Android SDK Build-tools installed on your system. You can install any version in the following range: '>=23 <=29'.
Run `$ sdkmanager` from your command-line to install required `Android Build Tools`. In case you already have them installed, make sure `ANDROID_HOME` environment variable is set correctly.
WARNING: Error executing command 'javac'. Make sure you have installed The Java Development Kit (JDK) and set JAVA_HOME environment variable.
You will not be able to build your projects for Android.
To be able to build for Android, verify that you have installed The Java Development Kit (JDK) and configured it according to system requirements as
described in http://docs.nativescript.org/setup/ns-cli-setup/ns-setup-win.html#system-requirements
WARNING: WARNING: The Java Development Kit (JDK) is not installed or is not configured properly.
You will not be able to work with the Android SDK and you might not be able
to perform some Android-related operations. To ensure that you can develop and
test your apps for Android, verify that you have installed the JDK as
described in http://docs.oracle.com/javase/8/docs/technotes/guides/install/install_overview.html (for JDK 8).
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.
Your environment is not configured properly and you will not be able to execute local builds. To continue, choose one of the following options:
Run $ tns preview command to enjoy NativeScript without any local setup.
Run $ tns setup command to run the setup script to try to automatically configure your environment for local builds.
In order to test your application use the $ tns login command to log in with your account and then $ tns cloud build command to build your app in the cloud.
Verify that your environment is configured according to the system requirements described at http://docs.nativescript.org/setup/ns-cli-setup/ns-setup-win.html#system-requirements.
Android Studio Says Android SDK-Tools are installed:
ANDROID_SDK_HOME is in my environment variables (user):
JAVA_HOME is in my environment variables (system):
When I open cmd and run javac -version I get javac 1.8.0_131
adb devices says List of devices attached (works fine)
First option I suggest to you is to run sdkmanager in the command line and try tns run again.
For setting the java_home path this is a link : Setting JAVA_HOME at Android SDK
Second option you may need to change the path of ANDROID_HOME: for example this is mine
C:\Users\USERNAME\AppData\Local\Android\Sdk note the sdk at the end of the path

Ionic trouble: can't build to android

I've got an Ionic 3.4 project and trying to build it to Android for testing purposes.
I installed Android Studio and the Android SDK, aswell Java 8. Then did:
ionic cordova platform add android
Then, when I write...
ionic build android
... I get the following error:
cordova build android ✖ Running command - failed!
[ERROR] Cordova encountered an error.
You may get more insight by running the Cordova command above directly.
[ERROR] An error occurred while running cordova build android (exit
code 1):
ANDROID_HOME=C:\Users\Zerok\AppData\Local\Android\sdk
JAVA_HOME=C:\Program Files\java\jdk1.8.0_121
Error: Could not find an installed version of Gradle either in Android Studio,
or on your system to install the gradle wrapper. Please include gradle
in your path, or install Android Studio
What's going on? I also installed Gradle 4.0 into the Java folder, and pointed towards it in the GRADLE_HOME environment variable:
Var name: GRADLE_HOME
Value: C:\Program Files\Java\gradle-4.0
Also added the following to the path:
GRADLE_HOME\bin
But it still throws the same error... I don't think it's a problem with plugins, but with the Ionic/Cordova build system. What I don't understand, is why it needs Gradle when it's perfectly working in Android Studio, maybe it's because it's not in C:/, but a different disk? Any ideas?
(Assuming Windows 10)
open Start Menu, type path and hit Enter
System Properties will open. On the bottom click Environment Variables...
In the window that opens, on the bottom section named System Variables, double click Path
Click New and copy paste the path to your gradle installation
Make sure the path environment variable points to the bin folder of gradle like so: export PATH="$PATH:/home/jeffbl/android-studio/gradle/gradle-3.2/bi‌​n".
If that doesn't work try:
$ cordova platform rm android && cordova platform add https://github.com/apache/cordova-android && cordova build
If that doesn't work then use the SDK manager to downgrade to an earlier version of your SDK. It might be that there is no graddle wrapper out yet for the latest.
In any case you will find the answer to your problem in this github issue.
Ok, I already fixed it. And the fix is weird as hell, but well, at least it works.
Solution: uninstall Android Studio and install it in the main drive (C in my case). Everything began to work perfectly after this clean install.

When installing Appcelerator CLI, appc setup command throws error

I am trying to install the appcelerator cli but keep running into an issue that I haven't been able to find a fix for.
When running the "appc setup" command I get the error "cannot find module 'C:\cyclic.js'"
link to full screen capture of error
I am running windows 7 64 bit and am following the directions here https://web.appcelerator.com/product/cli
*Edit: If you are facing this same issue. Uninstall Node, and Appcelerator. Then make sure you install JDK 32 Bit (if using windows). DELETE the NPM and Appcelerator folders in your C:\Users[username]\AppData\Roaming\ directory. Then reinstall Node (I had success with 32 bit) and the Appcelerator CLI. That worked for me.
Hello make sure you have node.js and JDK installed and environment variable set properly. For reference http://docs.appcelerator.com/platform/latest/#!/guide/Installation_and_Configuration. Now, As you already tried "appc setup". You need to delete all cache of previous installation try and try reinstalling again. Run,
sudo rm -rf ~/.appcelerator
sudo npm uninstall -g appcelerator
appc use latest
appc setup
To setup the Appcelerator CLI, install Node.js, install the appcelerator module using the NPM CLI, then run the appc setup command to download and setup the latest CLI package. You can follow the guide here. Also you can check this link, if you experience an issue installing any of the npm packages.
If still not solved, I suggest you to start from scratch. I see you work on Windows, true?:
Remove install of NodeJS from "Uninstall programms" of control pannel
Remove install of Appcelerator from "Uninstall programms" of control pannel
Remove any folder from C:\Program Files or your user's folder referencing "node" "npm" or similar.
Go to your user's folder and remove any .app or .appcelerator folder (could be hidden, so look it well)
Don't forget to look in C:\Users\[username]\AppData\Roaming (probably will be hidden)
Now you have only Java JDK installed (I'm using 1.8).
Proceed with a new appcelerator.EXE install, it must detect that you don't have Node and will download by itself the proper Node version.

Resources