I setup a TeamCity server and have it successfully building several C#.NET projects. Now I'm trying to get it to build a simple Android project but cannot get it to work. Checking the BuildLog it fails with the following error:
[17:00:11][Step 1/1] Using IntelliJ IDEA External Make #141.3028
[17:00:11][Step 1/1] Loading project (2s)
[17:00:13][Step 1/1] C:\TeamCity\buildAgent\system\.jps\c67b7fe19e4788da\-1866084326\gradle\configuration.xml (The system cannot find the path specified)
[17:00:13]
[Step 1/1] java.io.FileNotFoundException: C:\TeamCity\buildAgent\system\.jps\c67b7fe19e4788da\-1866084326\gradle\configuration.xml (The system cannot find the path specified)
at java.io.FileInputStream.open0(Native Method)
at java.io.FileInputStream.open(FileInputStream.java:195)
at java.io.FileInputStream.<init>(FileInputStream.java:138)
at com.intellij.openapi.util.JDOMUtil.loadDocument(JDOMUtil.java:337)
at org.jetbrains.jps.gradle.model.impl.JpsGradleExtensionServiceImpl.getGradleProjectConfiguration(JpsGradleExtensionServiceImpl.java:125)
at org.jetbrains.jps.gradle.model.impl.JpsGradleExtensionServiceImpl.getGradleProjectConfiguration(JpsGradleExtensionServiceImpl.java:113)
at org.jetbrains.jps.gradle.model.impl.GradleResourcesTarget.computeRootDescriptors(GradleResourcesTarget.java:69)
...
The directory ..\-1866084326\ exists but it does not contain a gradle subdirectory.
I am not very familiar with the details of building gradle/android projects as I've only ever used AndroidStudio's UI to build. I have done a lot of searching but have found virtually no information about setting up an android project in TeamCity beyond what is in the TeamCity user docs that effectively says "use IntelliJ IDEA Build Runner".
I setup a build config with an IntelliJ IDEA Project build step. The project settings are parsed without error and I leave everything the way it was detected. The only parameters I have are Android_SDK = C:\Users\%env.USERNAME%\AppData\Local\Android\sdk, API_Level = 23, and system.path.macro.USER.HOME = %env.HOMEPATH%.
This is on a Windows 7 x64 Pro server.
I can build the project directly in TeamCity's workdir using AndroidStudio so I expect it is a build runner configuration issue, but I cannot find any search results for this specific error. Does anyone have any ideas?
Related
I have a Unity project which, when compiled via Unity's Gradle build option, fails with
Output: error: resource style/Theme.AppCompat.Light.NoActionBar (aka com.xxx.sdk.unity:style/Theme.AppCompat.Light.NoActionBar) not found.
error: failed linking references.
I can reproduce this same error by entering a terminal, and going into the Temp/gradleOut directory, then saying gradle :MySDK:verifyReleaseResources or gradle :MySDK:assemble. However, if I change it to gradle :assemble then it works fine (this is what Android Studio does when I open the same Temp/gradleOut directory and it builds and runs the app fine):
/opt/Unity/Editor/Data/PlaybackEngines/AndroidPlayer/Tools/gradle/bin/gradle :assemble
> Configure project :
> Configure project :MySDK
BUILD SUCCESSFUL in 17s
Is there a way to make Unity3d (2017.2.0f3 in my case as the latest version crashes on Linux) execute the same gradle task as Android Studio? So instead of trying to do :MySDK:whatever it would do :whatever?
Ciao,
try adding .aar files in Assets/Plugins/Android folder.
Something when you build your app for Android, look for that resource (are you using Facebook SDK for example ?) and when building android app Unity need to find that resources in android archives.
This is my configuration :
i am importing one project. i am running this on linux. but when i build my project it gives me this error.
**Error:A problem occurred configuring project ':app'.
The SDK directory '/home/custom/Documents/Zebra_RFID_Mobile-1.0.2.17/C:\Users\DHXW76\AppData\Local\Android\Sdk' does not exist.**
Below is my local.properties file
## This file is automatically generated by Android Studio.
# Do not modify this file -- YOUR CHANGES WILL BE ERASED!
#
# This file must *NOT* be checked into Version Control Systems,
# as it contains information specific to your local configuration.
#
# Location of the SDK. This is only used by Gradle.
# For customization when using a Version Control System, please read the
# header note.
#Mon Sep 11 14:54:05 IST 2017
ndk.dir=/home/custom/Android/Sdk/ndk-bundle
sdk.dir=/home/custom/Android/Sdk
I am wondering that how is this error showing c:\users.... path, although i am trying it to run this on linux.
I have also checked my sdk location, it is perfect. can anybody help me solve this issue?
I had this problem. I'm using Linux.
Project stucture windows
How I corrected the error:
Need to check SDK Manager. Is the SDK similar to your project?SDK Manager
2.Checking Gradle.Gradle Folder Gradle
The version number in the Project Structure /project and in the /opt/android-studio/gradle/gradle-4.6/ folder should be the same. If the problem persists, update the Gradle.
2.1 We go to the site: https://gradle.org/install/#with-a-package-manager and download the binary version. Download the archive we throw in the folder /opt/android-studio/gradle/gradle-4.6/ and write down its version number in Project Structure /project.
3.Restart the studio.
If the program code shows an incorrect version of Gradle, then an error will appear that is difficult to fix. Try to check all the code or create a new project.
Check Gradle easily by creating a new project. I like this method.
I tried to follow this example : http://doc.qt.io/qtcreator/creator-mobile-app-tutorial.html
But when I try to build it, I have this error :
23:51:49: Internal Error: Unknown Android deployment JSON file
location. Error while building/deploying project accelbubble (kit:
Android for armeabi (GCC 4.9, Qt 5.4.1)) When executing step "Build
Android APK
There is not a lot of things about this on the Internet, so I came here for help.
Anyone know what to do ?
You need to select the run configuration for the project: see comments on this Qt bug report
Select the 'Project' icon on the left toolbar, choose 'Run' on that active target, and the set "Run Configuration".
My problem occured when I tried to build a library for Android.
I managed to solve it by removing corresponding records in projectname.pro.user file.
Quit QtCreator
remove the elements containing apk attribute and
install attribute. Not the attributes, but the elements containing them
run QtCreator and make sure there are no build apk and install steps in the project's build configuration
I also made sure there are no extra projectname.pro.user.* files and removed them, but I don't know if that matters.
Problem solved by installing QT on C:\Qt disk instead of D:\Program Files\Qt (my second hard drive, because the C is SSD and doesn't have much space).
I have been trying endlessly to build the sample HelloJni sample project for the Android NDK.
How I set up the environment:
I followed the instructions of the getting started in the docs: android-ndk-r10d\docs\Getting_Started/html/index.html:
Downloaded Eclipse Luna
Downloaded the Android SDK
Downloaded the Android NDK: android-ndk-r10d
Set the NDK installation folder in eclipse in preferences window -> android -> NDK.
Imported the hellp-jni sample.
Right click on the HelloJni Project -> Android tools -> Add native support.
Cleaned and Built the project.
Ran on my device the HelloJni library (not the tests)
And the app is running and everything is WORKING and I can see the generated .so file per architecture in the libs folder of the project (for every architecture, for example armebi, mips, etc...)
Here is a Print Screen showing everything is working:
Now here comes the strange part...
The Problem:
If I open the hello-jni.c file for editing or viewing in eclipse, I suddenly see compilation errors and I can't build and can't run the project anymore...
Here is a Print Screen showing that after i open the file, I suddenly get compilation errors:
What I have already tried but failed:
Adding the Android Native Nature, then removing it by:
Deleting the .project file,
the buildCommand tag of: org.eclipse.cdt.managedbuilder.core.genmakebuilde,
the buildCommand tag of: org.eclipse.cdt.managedbuilder.core.ScannerConfigBuilder
and removing the lines:
[nature]org.eclipse.cdt.core.cnature[/nature]
[nature]org.eclipse.cdt.core.ccnature[/nature] [nature]org.eclipse.cdt.managedbuilder.core.managedBuildNature[/nature] [nature]org.eclipse.cdt.managedbuilder.core.ScannerConfigNature[/nature]
removing the .cproject and all compiled files.
Then adding back the Android Native Nature.
According to this stackoverflow link:
Eclipse ADT - Unresolved inclusion jni.h
Failed
Once I got the error of (I am not getting it anymore): Unable to launch cygpath. Is Cygwin on the path?] java.io.IOException: Cannot run program "cygpath". So I Googled and I changed the build settings to give the absolute path of my NDK installation folder:
According to this stackoverflow link:
Unable to launch cygpath in android
Here is a Print Screen:
Failed
Changing the Used tools from Android GCC Compiler to GCC C Compiler
according to this stackoverflow link:
Android NDK build, Method could not be resolved
Here is a Print Screen:
Failed
Copying an eclipse Luna installation from a friend that has the project working for him.
Failed
I have been spending hours on this and I couldn't find any solution to why this is happening.
PLEASE HELP
This is a common problem when you try to edit a C/C++ file inside a JAVA workspace/perspective without the proper configuration. You can simply select all the entries in the Error Log and delete them.
FWIW, Eclipse seems to have issues with the r10d version of Android NDK. See https://code.google.com/p/android/issues/detail?id=97023. I suggest you try r10c instead #worksforme :)
I have installed Android Studio and gradle as required but while creating a new project I get this error
com.intellij.openapi.options.ConfigurationException: Failed to import new Gradle project: Could not fetch model of type 'IdeaProject' using Gradle distribution 'http://services.gradle.org/distributions/gradle-1.6-bin.zip'.
Unable to start the daemon process.
This problem might be caused by incorrect configuration of the daemon.
For example, an unrecognized jvm option is used.
Please refer to the user guide chapter on the daemon at http://gradle.org/docs/1.6/userguide/gradle_daemon.html
Please read below process output to find out more:
-----------------------
java.lang.IllegalArgumentException: URI has an authority component
at java.io.File.<init>(File.java:397)
at org.gradle.api.internal.classpath.EffectiveClassPath.findAvailableClasspathFiles(EffectiveClassPath.java:41)
at org.gradle.api.internal.classpath.EffectiveClassPath.<init>(EffectiveClassPath.java:32)
at org.gradle.api.internal.classpath.DefaultModuleRegistry.<init>(DefaultModuleRegistry.java:61)
at org.gradle.api.internal.classpath.DefaultModuleRegistry.<init>(DefaultModuleRegistry.java:55)
at org.gradle.launcher.bootstrap.ProcessBootstrap.runNoExit(ProcessBootstrap.java:41)
at org.gradle.launcher.bootstrap.ProcessBootstrap.run(ProcessBootstrap.java:32)
at org.gradle.launcher.daemon.bootstrap.GradleDaemon.main(GradleDaemon.java:22)
After lots of searching I think it is due to the fact that the .gradle folder is on a common server. "\ServerName\UserProfiles\naveen\.gradle" and AndroidStudio is not able to access it.
I also tried to change the path in Configure->Settings->gradle->ServiceDirectoryPath but it wont let me change that.
None of the problems on SO related to Android studio have any relation to what I have here.
So is there some way to change the path or maybe edit some file in AndroidStudio from which I can change Gradle Path and make it static.
I don't want to unlink my computer from server or anything like that.
go to C:\Users\user\AppData\Local\Android\android-studio\plugins\gradle\lib
and delete this files slf4j-api and slf4j-log4j12
You can use the Gradle Wrapper that doesn't relay on environment variables. If you execute gradle init on a project's root it will apply the appropriate wrapper files (along with the empty .gradle files if they don't exist).
This Android & Gradle Tutorial goes into great detail about using the platform.
I had the same problem with the gradle daemon with user home directory being a network location. Try setting a Windows environment variable GRADLE_USER_HOME to a local directory.
http://mrhaki.blogspot.com/2010/09/gradle-goodness-changing-gradle-user.html
Also, on windows 7, the user home envrionment variable might be set to a UNC path. Try adding -Duser.home=c:\some\path
Gradle Integration for Eclipse daemon startup failure