i am very new to nativescript, i try to build my first app in nativescript, but it shows
=============================================================================
C:\Nativescript\Grab1>
C:\Nativescript\Grab1>tns prepare android
Executing before-prepare hook from C:\Nativescript\Grab1\hooks\before-prepare\na
tivescript-dev-android-snapshot.js
Preparing project...
SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further detail
s.
FAILURE: Build failed with an exception.
What went wrong:
org/slf4j/impl/StaticLoggerBinder
Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug
option to get more log output.
Processing node_modules failed. Error: Command C:\Nativescript\Grab1\platforms\a
ndroid\gradlew.bat failed with exit code 1
C:\Nativescript\Grab1>
================================================================================
here i attached my command prompt screen shot also, please help me to solve this problem friends
It seems some files missing in platform -> android folder. I fixed this issue by removing the android platform and adding it again by using the below command:
Make sure you are in project directory.Then try this below two commands:
tns platform remove android
tns platform add android
Same way for IOS:
tns platform remove ios
tns platform add ios
Just in case if someone out there is having the same problem on MacOS systems
tns platform remove iOS
tns platform add iOS
Just delete the platform folder from the root directory of the project and run
tns run android
I guess Gradle keeps the history logs which is creating the error. So we need to delete that and rebuild the project.
Related
I created a nativescript vue template:
sudo vue init nativescript-vue/vue-cli-template project
When I try to run it with the command: tns run, I get the following errors:
Gradle build...
FAILURE: Build completed with 2 failures.
1: Task failed with an exception.
-----------
* Where:
Build file '/home/petar/Documents/Workspace/js/project/platforms/android/app/build.gradle' line: 221
* What went wrong:
A problem occurred evaluating project ':app'.
> Invalid revision: undefined
* 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.
==============================================================================
2: Task failed with an exception.
-----------
* What went wrong:
A problem occurred configuring project ':app'.
> SDK location not found. Define location with an ANDROID_SDK_ROOT environment variable or by setting the sdk.dir path in your project's local properties file at '/home/petar/Documents/Workspace/js/roomy/roomy/platforms/android/local.properties'.
* 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 6s
Unable to apply changes on device: 2383f95c9f0d7ece. Error is: Command ./gradlew failed with exit code 1.
Also, I get a couple of warnings just after I run the command. I installed Android studio, tried to set the JAVA_HOME variable correctly, and a couple of other things, but nothing worked.
✖ The ANDROID_HOME environment variable is not set or it points to a non-existent directory. You will not be able to perform any build-related operations for Android.
To be able to perform Android build-related operations, set the `ANDROID_HOME` variable to point to the root of your Android SDK installation directory.
✖ 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: 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
You have installed Android Studio but possibly haven't, as error 2 and tns points to, set ANDROID_SDK_ROOT environment variable.
What OS are you using?
I am debugging my Flutter application and sometimes I get Gradle build errors. That's fine, some configuration is incorrect.
However it is difficult to find the actual problem as the debug console is not displaying any details, such as which row is breaking the build.
There's no error trace.
Launching lib\main.dart on Android SDK built for x86 in debug mode...
* Error running Gradle:
ProcessException: Process "C:\Users\<USER>\Projects\<app>\android\gradlew.bat" exited abnormally:
Command: C:\Users\<USER>\Projects\<APP>\android\gradlew.bat app:properties
Please review your Gradle project setup in the android/ folder.
Exited (sigterm)
Where, or how, can I see the Gradle logs when building a Flutter application in debug mode?
Here is a print too.
You should edit your $HOME/.gradle/gradle.properties file by adding:
org.gradle.console=verbose
and run
flutter run -v
Here a piece of output in VSCode
You can open the Android part of your project with AndroidStudio to help you understand the gradle errors.
With IntelliJ or VSCode, you just have to right click on android folder and click "Open in Android Studio"
I have deleted my project on Xcode may it be .xcworkspace or .xcodeproj.
Because of that, I had to delete IOS and android folders while downgrading, updating and re-upgrading my react version to re-install IOS and android folders.
Thanks to that the emulator is working but unfortunately the project isn't present in the emulator and is still absent with Xcode. One thing to point out is that the simulator only appears when ran in the integrated terminal and nor in general terminal after cd-ing in the project folder.
Can anyone please help re-integrating the project in the emulator and on Xcode, please.
Here is the error when the emulator is running in a general terminal:
Here is the error when the emulator is running in a general terminal:
error Command failed: xcrun instruments -s
xcrun: error: Failed to determine realpath of '/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk' (errno=No such file or directory)
xcrun: error: unable to find utility "instruments", not a developer tool or in PATH
Here is the error for building the project within emulator when ran from VS code integrated terminal:
error Failed to build iOS project. We ran "xcodebuild" command but it exited with error code 65. To debug build logs further, consider building your app with Xcode.app, by opening project.xcodeproj
The process you need to follow is so similar to renaming a react native app. Basically you just need to run react-native upgrade in your root project directory. For further info you can check another question here. The instructions below explains how to create another react native project based on a copied one with a new name.
First copy the directory which your to-be-name-changed application exists. And go to your newly cloned directory.
Change the name at index.ios/android.js file which is given as a parameter to AppRegistry.
Change the name and version accordingly on package.json
Delete /ios and /android folders which are remaining from your older app.
Run $react-native upgrade to generate /ios and /android folders again.
Run $react-native link for any native dependency.
Finally run $react-native run-ios or anything you want.
Courtesy of
https://stackoverflow.com/questions/42506068/how-can-i-regenerate-ios-folder-in-react-native-project
When I try to run the project in simulator, I get the error:
Failed to create plugin placeholder for
/Users/zc/Library/Developer/Xcode/DerivedData/iPhoneHandheldACT-cwlfykavlwlqwlhbecjubziblyzi/Build/Products/Debug-iphonesimulator/iPhoneHandheldACT.app/PlugIns/CallerID.appex
The build is successful, but run gives me the error.
This happened after I started re-organising the files in my project.
I tried deleting the derived data, clean and restarting the Xcode but it didn't help.
Removing the CallerID.apex from the embed framework section in Build Settings fixed this error.
For me the issue was that the version and bundle version of my widget configuration intent target didn't match the versions of the widget and the app.
I have a nativescript (3.0) application which I am developing on mac (ElCapitan). I am able to run the iOS emulator without a problem, but I cannot find a way to build the app for Android. I am getting the following error:
FAILURE: Build failed with an exception.
* What went wrong:
A problem occurred configuring root project 'MyApp'.
> Flavor 'nativescript-telerik-ui' has unknown dimension 'nativescript-telerik-ui'.
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
BUILD FAILED
Total time: 2.004 secs
Command ./gradlew failed with exit code 1
I followed the nativescript documentation strictly, removed the android platform and added it again, reinstalled the Android SDK and tools, but without any success.
At this point I am out of ideas. Any help would be greatly appreciated.
Thank you.
did you try nuke it?
tns plugin remove nativescript-telerik-ui
tns plugin add nativescript-telerik-ui
my be you have an older version
It seems you have changed something on the "AndroidManifest.xml" file and which is not correct. Please fix the "AndroidManifest.xml" file.
If not, you can try this
tns platform remove android
tns platform add android
if only these two lines are not enough for the solution, you may run the android platform on Android Studio.
app/platforms/android
This is the directory, you have to open on Android Studio. After opening this, Android Studio will suggest to you what you have to do.