I have the following errors after installing android sdk, and android plugin for NetBeans:
c:/Android/android-sdk/tools/ant/build.xml:892:The following error occurred while executing this line:
c:/Android/android-sdk/tools/ant/build.xml:894: The following error occurred while executing this line:
c:/Android/android-sdk/tools/ant/build.xml:906: The following error occurred while executing this line:
c:/Android/android-sdk/tools/ant/build.xml:284: null return: 2
My guess is that the environment is not properly configured to run the build. You can look into c:/Android/android-sdk/tools/ant/build.xml:284 to see what is executed there. You may need to tell Ant where is Java installed or something similar.
Related
I'm trying to run a nativescript app on android using tns run android
I'm always getting gradle error:
FAILURE: Build failed with an exception.
* Where:
Build file:
'/Volumes/My_SSD/myproject/platforms/tempPlugin/kinvey_nativescript_sdk/bui
ld.gradle' line: 28
* What went wrong:
A problem occurred evaluating root project '`kinvey_nativescript_sdk`'.
> Failed to apply plugin [class 'org.gradle.api.plugins.BasePlugin']
> Could not create service of type OutputFilesRepository using ExecutionServices.createOutputFilesRepository().`
I tried the following:
Run ./gradlew --stacktrace but I got this error:
Caused by: org.gradle.cache.LockTimeoutException: Timeout waiting to lock
execution history cache
(/Volumes/My_SSD/myproject/platforms/tempPlugin/kinvey_nativescript_sdk/.gr
adle/5.1.1/executionHistory). It is currently in use by another Gradle
instance.
Owner PID: unknown
Our PID: 50331
Owner Operation: unknown
Our operation:
Lock file:
/Volumes/My_SSD/myproject/platforms/tempPlugin/kinvey_nativescript_sdk/.gra
dle/5.1.1/executionHistory/executionHistory.lock
Deleted .lock files manually and re-ran tns run android but I got the same error again
Run
chmod R+x/Volumes/My_SSD/myproject/platforms/tempPlugin/kinvey_nativescript_sdk
Didn't fix the problem
The app runs fine on ios emulator and but not on android
I was having the same problem, looks to be related with this Gradle issue.
The workaround I found here is to move the project to the home folder (~).
The problem is that since this morning (I believe, I have not worked yesterday) when I try to run my ionic 3 application on the device I get an AAPT error.
To recreate the problem I started from a scratch app.
I create a simple new ionic application:
ionic start gradleError tabs
Now if I try to run it on my device it works
Let's say I want to add this plugin using simply this two commands:
ionic cordova plugin add cordova-plugin-mauron85-background-geolocation
npm install --save #ionic-native/background-geolocation
Now when I try to run it on my device I get the following Errors:
* What went wrong:
Execution failed for task ':app:processDebugResources'.
> Failed to execute aapt
Reading the error output is seems that the problem is this one:
fontVariationSettings not found.
ttcIndex not found.
First fix attempt was made by changing inside "platforms/android/project.properties" the line into:
cordova.system.library.2=com.android.support:support-v4:26+
After trying to run in on device I start to get a bunch of errors which looks like:
/Users/zeno/Desktop/Bachelor/App/gradleError/test/platforms/android/app/src/main/java/com/tenforwardconsulting/cordova/BackgroundGeolocationPlugin.java:563: error: cannot find symbol
#TargetApi(Build.VERSION_CODES.KITKAT)
^
symbol: variable KITKAT
location: class VERSION_CODES
/Users/zeno/Desktop/Bachelor/App/gradleError/test/platforms/android/app/src/main/java/org/apache/cordova/splashscreen/SplashScreen.java:297: error: cannot find symbol
LayoutParams layoutParams = new LinearLayout.LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT);
^
symbol: variable MATCH_PARENT
With ate the end:
* What went wrong:
Execution failed for task ':app:compileDebugJavaWithJavac'.
Now following what has been said on the ionic forum I tried to run the following command:
cordova plugin add cordova-android-support-gradle-release --variable ANDROID_SUPPORT_VERSION=27.0.0
with which I get the same errors as the change I made before.
I tried also to play with the system and the numbers, from 27 to 27.1 to 24 and so on, nothing changed.
I'm using Ionic and this is the message:
BUILD FAILED C:\adt\sdk\tools\ant\build.xml:720: The following error
occurred while executing this line:
C:\adt\sdk\tools\ant\build.xml:734: Compile failed; see the compiler
error output for details.
Total time: 5 seconds
C:\wamp\www\external\projectx\dirx\platforms\android\cordova\node_modules\q\q.js:126
Where can I see the log details? I've tried googling a bunch of things like "ionic log path" etc but nothing comes up. I saw something else that said run it with a -c argument but the output is the same.
Make sure you update your sdk, sometimes error occur when trying to build android incompatible API to your cordova version or ionic.
I am try to build android apps but while creating apps my build failed with following errors.
D:\ibm\AnywhereWorkManager\build.xml:87: The following error occurred
while executing this line:
D:\ibm\AnywhereWorkManager\anywhere-apps-builder.xml:720: The
following error occurred while executing this line:
D:\ibm\AnywhereWorkManager\anywhere-apps-builder.xml:716: Failed
building application:
com.worklight.builder.exception.WorklightBuildException:
java.io.IOException: Unable to delete directory
D:\ibm\AnywhereWorkManager\apps\WorkApproval\android\native\assets\www\default\dojo\cldr\nls\zh-hans-mo.
at
org.apache.tools.ant.ProjectHelper.addLocationToBuildException(ProjectHelper.java:551)
I know this answer might seem obvious, but if you have any of the files mentioned in the failure (D:\ibm\AnywhereWorkManager\apps\WorkApproval\android\native\assets\www\default\dojo\cldr\nls\zh-hans-mo)
open ( commandline, eclipse, other editor), this will cause the issue.
I have been struggling to get TeamCity to build my Android Project. I have finally gotten the server to be able to compile the project with Gradlew (although I have to ignore lint errors, which I am not happy about - it will not tell me which lint errors are being violated EDIT: I found it in ..\build\outputs\lint-results.html)
But now I can see that it is trying to execute the following:
C:\TeamCity\buildAgent\work\284714bad9f1a533\MyProject>gradlew.bat --init-script C:\TeamCity\buildAgent\plugins\gradle-runner\scripts\init.gradle clean build
And I am getting the following error:
FAILURE: Build failed with an exception.
* Where:
Initialization script 'C:\TeamCity\buildAgent\plugins\gradlerunner\scripts\init.gradle' line: 31
* What went wrong:
A problem occurred evaluating initialization script.
> Cannot invoke method split() on null object
I have checked this line and it seems fairly standard:
initscript {
dependencies {
def teamCityInitLib = System.getenv("TEAMCITY_BUILD_INIT_PATH")
println "Init lib: ${teamCityInitLib}"
def classPathFiles = teamCityInitLib.split(File.pathSeparator) //line 31
classpath files(classPathFiles)
}
}
Can anyone help me? NOTE: the following command works without a problem:
gradlew.bat clean build
Seems that you don't have TEAMCITY_BUILD_INIT_PATH variable in your PATH on your build machine. You can add it either by standart ways, depending on OS, or by adding it to Build Parameters in Configuration Steps of your build.
It seems like the build file is not being found. At least, that is what support is telling me. To me this is a TeamCity bug and not on my side. When I find out more, I'll post it.
Found this post while looking for a way to emulate a TC build from the command line and trying to understand how to set TEAMCITY_BUILD_INIT_PATH.
In my environment I determined that it's set to:
/apps/teamcity-agent/agent/lib/serviceMessages.jar:/apps/teamcity-agent/agent/lib/runtime-util.jar:/apps/teamcity-agent/agent/plugins/gradle-runner/lib/gradle-runner-common.jar
Where /apps/teamcity-agent is the my TC install path.
Hope this helps.