How to resolve NativeScript error with plugins? - javascript

For example...
tns plugin add nativescript-simple-libsodium
.
.
.
Build file '/Users/******/helloworld/platforms/android/app/build.gradle' line: 575
A problem occurred configuring project ':app'.
SSL peer shut down incorrectly
Another example...
tns plugin add nativescript-crypto
...
FAILURE: Build completed with 2 failures.
1: Task failed with an exception.
-----------
* Where:
Build file '/Users/****/helloworld/platforms/tempPlugin/nativescript_crypto/build.gradle' line: 231
* What went wrong:
A problem occurred evaluating root project 'nativescript_crypto'.
> Could not find method compile() for arguments [com.madgag.spongycastle:core:1.56.0.0] on object of type org.gradle.api.internal.artifacts.dsl.dependencies.DefaultDependencyHandler.
* 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.
-----------
* Where:
Build file '/Users/****/helloworld/platforms/tempPlugin/nativescript_crypto/build.gradle' line: 210
* What went wrong:
A problem occurred configuring root project 'nativescript_crypto'.
> Could not get unknown property 'generateReleaseBuildConfig' for root project 'nativescript_crypto' of type org.gradle.api.Project.
* 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 1s
Failed to build plugin nativescript-crypto :
Error: Command ./gradlew failed with exit code 1
The above errors appear after I execute tns run android. After you execute tns plugin add do you need to make another things? If you remove that added plugin is OK. The error is the same for npm install And tns plugin add.

Related

Error: Command failed: gradlew.bat app:installDebug -PreactNativeDevServerPort=8081 FAILURE: Build failed with an exception

How can i fix this issue in my code? does anyone can help me how can I fix this error I am using latest version of react native I installed the project yesterday only but still its giving me this error came after i installed a package called "react-native-vision-camera" you can check that here https://mrousavy.com/react-native-vision-camera/docs/guides/ i followed every step but still this error came.
Error: Command failed: gradlew.bat app:installDebug -PreactNativeDevServerPort=8081
FAILURE: Build failed with an exception.
* What went wrong:
The Android Gradle plugin supports only kotlin-android-extensions Gradle plugin version 1.6.20 and higher.
The following dependencies do not satisfy the required version:
project ':react-native-vision-camera' -> org.jetbrains.kotlin:kotlin-gradle-plugin:1.5.30
* 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.
BUILD FAILED in 36s

I constantly get this error when creating APK in React native application

I constantly get this error when creating APK in React native application.
Could you please help?
I have tried all of the codes below.
react-native bundle --platform android --dev false --entry-file
index.js --bundle-output
android/app/src/main/assets/index.android.bundle --assets-dest
android/app/src/main/res
gradlew clean
gradlew assembleRelease -x bundleReleaseJsAndAssets or gradlew
bundleRelease
FAILURE: Build completed with 2 failures.
1: Task failed with an exception.
-----------
* What went wrong:
Execution failed for task ':app:mergeReleaseResources'.
> C:\Users\Emre Can\Desktop\ReactNative\bulutmd\android\app\src\main\res\drawables\launch_screen.png: Error: The file name must end with .xml
* 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:
java.lang.StackOverflowError (no error message)
* 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
Deprecated Gradle features were used in this build, making it incompatible with Gradle 8.0.
You can use '--warning-mode all' to show the individual deprecation warnings and determine if they come from your own scripts or plugins.
See https://docs.gradle.org/7.5.1/userguide/command_line_interface.html#sec:command_line_warnings
BUĀ¦LD FAILED in 2m 46s
159 actionable tasks: 127 executed, 32 up-to-date
PS C:\Users\Emre Can\Desktop\ReactNative\bulutmd\android>
* History restored
Try the new cross-platform PowerShell https://aka.ms/pscore6
PS C:\Users\Emre Can\Desktop\ReactNative> cd bulutmd
PS C:\Users\Emre Can\Desktop\ReactNative\bulutmd> cd android
PS C:\Users\Emre Can\Desktop\ReactNative\bulutmd\android>
guys i have fixid this error using react native old version 0.68.0....
newer version of react native are fixing this problem like
0.70.2,0.70.2 are
so plz change your project with old version,hope this guide helps you..

React native Webview error, App not installing Help me to solve this

I am creating an app that uses webview. I installed and imported the webview and when using it, app was not installed in the android emulator. Without webview app installing correctly.
I tried by creating another project for example ,same error returns.
Here is the error by using webview:
FAILURE: Build completed with 2 failures.
1: Task failed with an exception.
-----------
* Where:
Build file 'F:\FirstProject\node_modules\react-native-webview\android\build.gradle' line: 35
* What went wrong:
A problem occurred evaluating project ':react-native-webview'.
> org/jetbrains/kotlin/cli/common/PropertiesKt
* 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 ':react-native-webview'.
> compileSdkVersion is not specified. Please add it to build.gradle
* 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 15s
I am using java version: java 15.0.2
compileSdkVersion : 30

How do I build app with :app:bundleReleaseJsAndAssets error?

I need help, I need to fix this error when building apk using gradlew assembleRelease, the configuration is successful, but when executing at 70% there throws an error:
> Task :app:bundleReleaseJsAndAssets_SentryUpload FAILED
error: An organization slug is required (provide with --org)
Add --log-level=[info|debug] or export SENTRY_LOG_LEVEL=[info|debug] to see more output.
Please attach the full debug log to all bug reports.
FAILURE: Build completed with 2 failures.
1: Task failed with an exception.
-----------
* What went wrong:
Execution failed for task ':app:bundleReleaseJsAndAssets'.
> Process 'command 'cmd'' 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.
==============================================================================
2: Task failed with an exception.
-----------
* What went wrong:
Execution failed for task ':app:bundleReleaseJsAndAssets_SentryUpload'.
> Process 'command 'cmd'' 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.
For info, I tried building without bundleReleasejsAssets, but when I install the app on my phone, App won"t start it is instantly crashing, just can't open, I think this bundleReleaseJsAssets needs to be added, or my app won't run.

How can i solve the following error while run the app : Could not resolve all files for configuration?

FAILURE: Build failed with an exception.
What went wrong:
Could not resolve all files for configuration ':react-native-camera:debugCompileClasspath'.
Could not find play-services-basement.aar (com.google.android.gms:play-services-basement:15.0.1).
Searched in the following locations:
https://jcenter.bintray.com/com/google/android/gms/play-services-basement/15.0.1/play-services-basement-15.0.1.aar
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 0s
12 actionable tasks: 1 executed, 11 up-to-date
Could not install the app on the device, read the error above for details.
Make sure you have an Android emulator running or a device connected and have
set up your Android development environment:
https://facebook.github.io/react-native/docs/getting-started.html
what is the build command you are running. as it says adding --stacktrace to that may help. something like (assuming package.json/npm etc) - npm run build --stacktrace or in the scripts - <BUILD-PACKAGE> --stacktrace [options]
package.json:
{
"scripts": {
"makeItSo": "<BUILD-PACKAGE> --stacktrace [options]"
}
}

Categories