I am starting with hello world example to learn nativescript.
I am compiling and building code behind corporate explicit proxy. I am able to create project and add android platform in my project. but when i try to build the project I face below error.
D:\CurrentProjects\Android\NativeScript\simple>tns run android
Executing before-prepare hook from D:\CurrentProjects\Android\NativeScript\simpl
e\hooks\before-prepare\nativescript-dev-android-snapshot.js
Preparing project...
FAILURE: Build failed with an exception.
What went wrong:
A problem occurred configuring root project 'simple'.
Could not resolve all dependencies for configuration ':classpath'.
Could not download gradle-core.jar (com.android.tools.build:gradle-core:2.1
.2)
Could not get resource 'https://jcenter.bintray.com/com/android/tools/bu
ild/gradle-core/2.1.2/gradle-core-2.1.2.jar'.
Could not GET 'https://jcenter.bintray.com/com/android/tools/build/gr
adle-core/2.1.2/gradle-core-2.1.2.jar'.
This is usually a temporary error during hostname resolution and m
eans that the local server did not receive a response from an authoritative serv
er (jcenter.bintray.com)
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: 21.159 secs
Processing node_modules failed. Error: Command D:\CurrentProjects\Android\Native
Script\simple\platforms\android\gradlew.bat failed with exit code 1
Gradle is accessible from browser. But "tns build android" or "tns run android" couldn't download and give above proxy error. This seems gradle error but don't have answer in gradle as well.
UPDATE: when network guy removed proxy authentication check at his end, gradle compiled. I guess issue is gradle is not taking up proxy settings as mentioned in other answers on stackoverflow.
Related
I was trying to compile location-saver that has a dependency react-native-vector-icons that I was not able to build.
The build was failing after a lot of attempts. Here is the log:
react-native run-android
JS server already running.
Building and installing the app on the device (cd android && ./gradlew installDebug)...
FAILURE: Build failed with an exception.
* What went wrong:
A problem occurred configuring project ':app'.
> A problem occurred configuring project ':react-native-vector-icons'.
> Could not resolve all dependencies for configuration ':react-native-vector-icons:_debugCompile'.
> Could not find com.android.support:appcompat-v7:27.1.1.
Searched in the following locations:
file:/Users/gureks/.m2/repository/com/android/support/appcompat-v7/27.1.1/appcompat-v7-27.1.1.pom
file:/Users/gureks/.m2/repository/com/android/support/appcompat-v7/27.1.1/appcompat-v7-27.1.1.jar
https://jcenter.bintray.com/com/android/support/appcompat-v7/27.1.1/appcompat-v7-27.1.1.pom
https://jcenter.bintray.com/com/android/support/appcompat-v7/27.1.1/appcompat-v7-27.1.1.jar
file:/Users/gureks/Desktop/Github/reacting/location-saver/node_modules/react-native/android/com/android/support/appcompat-v7/27.1.1/appcompat-v7-27.1.1.pom
file:/Users/gureks/Desktop/Github/reacting/location-saver/node_modules/react-native/android/com/android/support/appcompat-v7/27.1.1/appcompat-v7-27.1.1.jar
https://repo1.maven.org/maven2/com/android/support/appcompat-v7/27.1.1/appcompat-v7-27.1.1.pom
https://repo1.maven.org/maven2/com/android/support/appcompat-v7/27.1.1/appcompat-v7-27.1.1.jar
file:/Users/gureks/Library/Android/sdk/extras/android/m2repository/com/android/support/appcompat-v7/27.1.1/appcompat-v7-27.1.1.pom
file:/Users/gureks/Library/Android/sdk/extras/android/m2repository/com/android/support/appcompat-v7/27.1.1/appcompat-v7-27.1.1.jar
file:/Users/gureks/Library/Android/sdk/extras/google/m2repository/com/android/support/appcompat-v7/27.1.1/appcompat-v7-27.1.1.pom
file:/Users/gureks/Library/Android/sdk/extras/google/m2repository/com/android/support/appcompat-v7/27.1.1/appcompat-v7-27.1.1.jar
Required by:
LocationSaver:react-native-vector-icons:unspecified > com.facebook.react:react-native:0.57.8
* 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: 16.274 secs
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
I even changed the Support Library versions in the build.grade of the react-native-vector node_module.
Need help for a project, new to react-native.
I am trying to build an android app with flutter and vscode but I am continuously getting an error.
Launching lib\main.dart on Micromax Q427 in debug mode...
Error running Gradle: Exit code 1 from:
E:\Flutter\mytestapp\android\gradlew.bat app:properties: Starting a
Gradle Daemon, 2 busy Daemons could not be reused, use --status for
details Download
https://dl.google.com/dl/android/maven2/com/android/tools/build/builder/3.0.1/builder-3.0.1.jar
Download
https://repo1.maven.org/maven2/com/google/j2objc/j2objc-annotations/1.1/j2objc-annotations-1.1.jar
Download
https://dl.google.com/dl/android/maven2/com/android/tools/external/com-intellij/intellij-core/26.0.1/intellij-core-26.0.1.jar
FAILURE: Build failed with an exception.
What went wrong: A problem occurred configuring root project
'android'.
Could not resolve all files for configuration ':classpath'. Could not
download builder.jar (com.android.tools.build:builder:3.0.1)
Could not get resource 'https://dl.google.com/dl/android/maven2/com/android/tools/build/builder/3.0.1/builder-3.0.1.jar'.
Premature end of Content-Length delimited message body (expected: 26945712; received: 8650688 Could not download intellij-core.jar
(com.android.tools.external.com-intellij:intellij-core:26.0.1) Could
not get resource
'https://dl.google.com/dl/android/maven2/com/android/tools/external/com-intellij/intellij-core/26.0.1/intellij-core-26.0.1.jar'.
Premature end of Content-Length delimited message body (expected: 8234273; received: 6553552
Try: Run with --stacktrace option to get the stack trace. Run with
--info or --debug option to get more log output.
Get more help at https://help.gradle.org
BUILD FAILED in 14m 39s Please review your Gradle project setup in the
android/ folder. Exited (sigterm)
I have tried many solutions but nothing worked also flutter doctor shows no issue and I am not able to understand why I am getting this error while building my app.
I have also asked this query in github but got no reply so far here is the link: https://github.com/flutter/flutter/issues/19614
i install react native and open a new project.
i try to run
react-native run-android
and I get this error
PS E:\Projects\React native\myapp> react-native run-android
Scanning 574 folders for symlinks in E:\Projects\React native\myapp\node_modules (27ms)
JS server already running.
Building and installing the app on the device (cd android && gradlew.bat installDebug)...
FAILURE: Build failed with an exception.
* Where:
Build file 'E:\⌠°σΘΘ≈ΦΘφ\⌠°σΘΘ≈ΦΘφ ≈Θ⌡\React native\myapp\android\app\build.gradle' line: 1
* What went wrong:
A problem occurred evaluating project ':app'.
> Failed to apply plugin [id 'com.android.application']
> Your project path contains non-ASCII characters. This will most likely cause the build to fail on Windows. Please move your project to a different directory. See http://b.android.com/95744 for details. This warning can be disabled by adding the line 'android.overridePathCheck=true' to gradle.properties file in the project directory.
* 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.877 secs
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/android-setup.html
As you can see from the error you need to move your project to a different directory with no non-ASCII characters.
Your project path contains non-ASCII characters. This will most
likely cause the build to fail on Windows. Please move your project
to a different directory. See http://b.android.com/95744 for details
I created an Android platform with success, but when I run
ionic build android
I get the following error:
FAILURE: Build failed with an exception.
* What went wrong:
Could not create an instance of type org.gradle.invocation.DefaultGradle_Decorated.
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
ERROR building one of the platforms: Error code 1 for command: /home/skylek/Ionic/conFusion/platforms/android/gradlew with args: cdvBuildDebug,-b,/home/skylek/Ionic/conFusion/platforms/android/build.gradle,-Dorg.gradle.daemon=true,-Pandroid.useDeprecatedNdk=true
You may not have the required environment or OS to build this project
Error: Error code 1 for command: /home/skylek/Ionic/conFusion/platforms/android/gradlew with args: cdvBuildDebug,-b,/home/skylek/Ionic/conFusion/platforms/android/build.gradle,-Dorg.gradle.daemon=true,-Pandroid.useDeprecatedNdk=true
Can anyone help me out.
I had exactly the same problem with an ionic project build with the m-ionic yeoman generator, that was uploaded to the ionic cloud.
It started after my computer crashed with a 'blue screen of death', in the middle of a compilation task
What We did to fix the project was to copy and replacing the gradle and corodova files :
.gradle
cordova
CordovaLib
gradle
gradlew.bat
from other ionic>platform>android project that I knew was working fine, beacuse we thought the Cordova files might be corrupted, and early in the project we fixed a similar compilation problem that way. It did not fixed the problem. But then removed the ionic cloud configuration files: ionic.project .
And it worked!!
I hope it could help you!
I'm trying out ionic for the first time. I have no issues with iOS, but building the demo app for Android gives me an error with virtually no information (see below). It seems likely to me that the issue is with the gradle config file that ships with Cordova, but I don't believe it's considered good practice with Cordova to edit the platform-specific files if you can avoid it.
[myApp]Bro? ionic build android
Running command: /Users/x/Documents/Dev/myApp/hooks/after_prepare/010_add_platform_class.js /Users/x/Documents/Dev/myApp
add to body class: platform-android
Running command: /Users/x/Documents/Dev/myApp/platforms/android/cordova/build
ANDROID_HOME=/Users/x/Library/Android/sdk
JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.8.0_65.jdk/Contents/Home
Running: /Users/x/Documents/Dev/myApp/platforms/android/gradlew cdvBuildDebug -b /Users/x/Documents/Dev/myApp/platforms/android/build.gradle -Dorg.gradle.daemon=true
FAILURE: Build failed with an exception.
* What went wrong:
A problem occurred configuring root project 'android'.
> A problem occurred configuring project ':CordovaLib'.
> Failed to notify project evaluation listener.
> java.lang.ExceptionInInitializerError (no error message)
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
BUILD FAILED
Looked at the stacktrace and it was clear that I had an issue with my Java XPath and XQuery libraries (Saxon). Turns out I hadn't updated that library since migrating from JDK 7 to JDK 8, and JDK 8 is not compatible with the version I had installed. Looks like the Android build uses the same plugin to parse the AndroidManifest.xml.
Short answer - look at your stack trace. Perhaps it also has to do with an outdated Java library.