How to setup/build LibGDX + Kotlin project correctly? - kotlin

I've downloaded gdx-setup.jar and try to build empty project with the following settings:
And here is what I get in console:
Generating app in C:\Users\Divelix\Desktop\test
Executing 'C:\Users\Divelix\Desktop\test/gradlew.bat clean --no-daemon idea'
To honour the JVM settings for this build a new JVM will be forked. Please consider using the daemon: https://docs.gradle.org/4.6/userguide/gradle_daemon.html.
Daemon will be stopped at the end of the build stopping after processing
WARNING: Configuration 'compile' is obsolete and has been replaced with 'implementation'.
It will be removed at the end of 2018
FAILURE: Build failed with an exception.
* What went wrong:
A problem occurred configuring project ':android'.
> Failed to notify project evaluation listener.
> com.android.build.gradle.internal.variant.BaseVariantData.getOutputs()Ljava/util/List;
* 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 22s
Done!
To import in Eclipse: File -> Import -> General -> Existing Projects into Workspace
To import to Intellij IDEA: File -> Open -> YourProject.ipr
If I do not mark "Use Kotlin" it builds well, so why is that and what am I doing wrong?

Well, I've finally figured out how to build project correctly with Kotlin (and if you have trouble with gradle it also will help you). Firstly, you just should to build it without "Use Kotlin" and than than edit your project build.gradle file like this:
buildscript {
ext.kotlinVersion = '1.1.1'
repositories {
mavenLocal()
mavenCentral()
maven { url "https://oss.sonatype.org/content/repositories/snapshots/" }
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.3.3'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVersion"
}
}
Also you should delete google() if you have it after jcenter()
In :desktop replace java with kotlin plugin and add kotlin-stdlib
project(":desktop") {
apply plugin: "kotlin"
dependencies {
compile project(":core")
compile "com.badlogicgames.gdx:gdx-backend-lwjgl:$gdxVersion"
compile "com.badlogicgames.gdx:gdx-platform:$gdxVersion:natives-desktop"
compile "com.badlogicgames.gdx:gdx-freetype-platform:$gdxVersion:natives-desktop"
compile "org.jetbrains.kotlin:kotlin-stdlib:$kotlinVersion"
}
}
In :android add kotlin-android plugin and kotlin-stdlib
project(":android") {
apply plugin: "android"
apply plugin: "kotlin-android"
configurations { natives }
dependencies {
compile project(":core")
compile "com.badlogicgames.gdx:gdx-backend-android:$gdxVersion"
natives "com.badlogicgames.gdx:gdx-platform:$gdxVersion:natives-armeabi"
natives "com.badlogicgames.gdx:gdx-platform:$gdxVersion:natives-armeabi-v7a"
natives "com.badlogicgames.gdx:gdx-platform:$gdxVersion:natives-arm64-v8a"
natives "com.badlogicgames.gdx:gdx-platform:$gdxVersion:natives-x86"
natives "com.badlogicgames.gdx:gdx-platform:$gdxVersion:natives-x86_64"
compile "com.badlogicgames.ashley:ashley:$ashleyVersion"
compile "com.badlogicgames.gdx:gdx-freetype:$gdxVersion"
natives "com.badlogicgames.gdx:gdx-freetype-platform:$gdxVersion:natives-armeabi"
natives "com.badlogicgames.gdx:gdx-freetype-platform:$gdxVersion:natives-armeabi-v7a"
natives "com.badlogicgames.gdx:gdx-freetype-platform:$gdxVersion:natives-arm64-v8a"
natives "com.badlogicgames.gdx:gdx-freetype-platform:$gdxVersion:natives-x86"
natives "com.badlogicgames.gdx:gdx-freetype-platform:$gdxVersion:natives-x86_64"
compile "org.jetbrains.kotlin:kotlin-stdlib:$kotlinVersion"
}
}
In :core replace java with kotlin plugin and add kotlin-stdlib
project(":core") {
apply plugin: "kotlin"
dependencies {
compile "com.badlogicgames.gdx:gdx:$gdxVersion"
compile "com.badlogicgames.ashley:ashley:$ashleyVersion"
compile "com.badlogicgames.gdx:gdx-freetype:$gdxVersion"
compile "org.jetbrains.kotlin:kotlin-stdlib:$kotlinVersion"
}
}
If you have just kotlin issue it would be enough.
If you also have gradle issue like me, so open gradle-wrapper.properties and fix gradle version to 3.3:
distributionUrl=https\://services.gradle.org/distributions/gradle-3.3-bin.zip

Related

Execution failed for task ':app:mergeDebugNativeLibs' while running react-native app

While running react native app I am getting following error:
`
Task :app:mergeDebugNativeLibs FAILED
Deprecated Gradle features were used in this build, making it incompatible with Gradle 7.0.
Use '--warning-mode all' to show the individual deprecation warnings.
See https://docs.gradle.org/6.9.2/userguide/command_line_interface.html#sec:command_line_warnings
574 actionable tasks: 2 executed, 572 up-to-date
FAILURE: Build failed with an exception.
What went wrong:
Execution failed for task ':app:mergeDebugNativeLibs'.
A failure occurred while executing com.android.build.gradle.internal.tasks.MergeJavaResWorkAction
2 files found with path 'lib/armeabi-v7a/libfbjni.so' from inputs:
- C:\Users\nouman.gradle\caches\transforms-3\6ef14503de3c85fa1ab2aba364d580cc\transformed\jetified-react-native-0.71.0-rc.0-debug\jni
- C:\Users\nouman.gradle\caches\transforms-3\64faf76bb2f0142d731347d7bfff47d4\transformed\jetified-fbjni-0.3.0\jni
If you are using jniLibs and CMake IMPORTED targets, see
https://developer.android.com/r/tools/jniLibs-vs-imported-targets
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 32s
error Failed to install the app. Make sure you have the Android development environment set up: https://reactnative.dev/docs/environment-setup.
Error: Command failed: gradlew.bat app:installDebug -PreactNativeDevServerPort=8081
FAILURE: Build failed with an exception.
What went wrong:
Execution failed for task ':app:mergeDebugNativeLibs'.
A failure occurred while executing com.android.build.gradle.internal.tasks.MergeJavaResWorkAction
2 files found with path 'lib/armeabi-v7a/libfbjni.so' from inputs:
- C:\Users\nouman.gradle\caches\transforms-3\6ef14503de3c85fa1ab2aba364d580cc\transformed\jetified-react-native-0.71.0-rc.0-debug\jni
- C:\Users\nouman.gradle\caches\transforms-3\64faf76bb2f0142d731347d7bfff47d4\transformed\jetified-fbjni-0.3.0\jni
If you are using jniLibs and CMake IMPORTED targets, see
https://developer.android.com/r/tools/jniLibs-vs-imported-targets
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 32s
at makeError (D:\BayQi-Customer-Mobile-App\node_modules\execa\index.js:174:9)
at D:\BayQi-Customer-Mobile-App\node_modules\execa\index.js:278:16
at processTicksAndRejections (node:internal/process/task_queues:96:5)
at async runOnAllDevices (D:\BayQi-Customer-Mobile-App\node_modules\react-native\node_modules\#react-native-community\cli-platform-android\build\commands\runAndroid\runOnAllDevices.js:94:5)
at async Command.handleAction (D:\BayQi-Customer-Mobile-App\node_modules\#react-native-community\cli\build\index.js:192:9)
info Run CLI with --verbose flag for more details.
`
I am trying to run my react native app in physical device but getting this error.
It was running okay but suddenly has stopped working
UPDATED ANSWER
📢 Patches for >= 0.63 We have prepared releases for all the main versions of react-native with an hotfix:
🛳 0.70.5: https://github.com/facebook/react-native/releases/tag/v0.70.5
🛳️ 0.69.7: https://github.com/facebook/react-native/releases/tag/v0.69.7
🛳 0.68.5: https://github.com/facebook/react-native/releases/tag/v0.68.5
🛳️ 0.67.5: https://github.com/facebook/react-native/releases/tag/v0.67.5
🛳️ 0.66.5: https://github.com/facebook/react-native/releases/tag/v0.66.5
🛳️ 0.65.3: https://github.com/facebook/react-native/releases/tag/v0.65.3
🛳️ 0.64.4: https://github.com/facebook/react-native/releases/tag/v0.64.4
🛳️ 0.63.5: https://github.com/facebook/react-native/releases/tag/v0.63.5
By updating to these patch versions, your Android build should start working again.
Source https://github.com/facebook/react-native/issues/35210
OLD ANSWER
Add this to your android/build.gradle,
def REACT_NATIVE_VERSION = new File(['node', '--print',"JSON.parse(require('fs').readFileSync(require.resolve('react-native/package.json'), 'utf-8')).version"].execute(null, rootDir).text.trim())
allprojects {
configurations.all {
resolutionStrategy {
force "com.facebook.react:react-native:" + REACT_NATIVE_VERSION
}
}
If that does not work for you (with the dynamic version), then hard code your version in:
PLEASE BE CAREFUL TO MOVE THIS VERSION WHEN YOU UPDATE REACT-NATIVE
allprojects {
configurations.all {
resolutionStrategy {
force 'com.facebook.react:react-native:<your version>'
}
}
repositories {
// ...
}
}
Check this for more updates https://github.com/facebook/react-native/issues/35204
add this to your app/build.gradle
android {
// yout existing code
packagingOptions {
pickFirst '**/libc++_shared.so'
pickFirst '**/libfbjni.so'
}
}
// Top-level build file where you can add configuration options common to all sub-projects/modules
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
// ...
}
allprojects {
repositories {
+ exclusiveContent {
+ // We get React Native's Android binaries exclusively through npm,
+ // from a local Maven repo inside node_modules/react-native/.
+ // (The use of exclusiveContent prevents looking elsewhere like Maven Central
+ // and potentially getting a wrong version.)
+ filter {
+ includeGroup "com.facebook.react"
+ }
+ forRepository {
+ maven {
+ url "$rootDir/../node_modules/react-native/android"
+ }
+ }
+ }
// ...
}
}
New patch release for react-native
https://github.com/facebook/react-native/issues/35210#:%7E:text=We%20have%20prepared%20releases%20for%20all%20the%20main%20versions%20of%20react%2Dnative%20with%20an%20hotfix%3A
just update your package.json with latest react-native version
This helped me to resolve the issue.
This is happening because all the templates reference the React Native dependency by range, like implementation com.facebook.react:react-native:+. Usually this dependency gets resolved from the local Maven repo in ./node_modules/react-native/android but, since it has been published to Maven Central, it's now grabbing the very latest RC.
You can resolve this problem by forcing the React Native dependency to the version you expect with something like this implementation com.facebook.react:react-native:0.68.2!! in your app's Gradle file. The !! is shorthand for restricting Gradle from upgrading if your project or its transitive dependencies depend on a newer version. AFAIK Maven Central is immutable and the published dependency can't removed so this might be the only solution.
File: android/app/build.gradle
dependencies {
implementation 'com.facebook.react:react-native:0.67.2!!'
}
Reference: https://github.com/facebook/react-native/issues/35204
Workaround: I have made the following changes & It is working:
In gradle-wrapper.properties file, change gradle version
distributionUrl=https\://services.gradle.org/distributions/gradle-6.9-all.zip
In project level build.gradle file, add following lines:
dependencies {
classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:1.6.0")
}
allprojects {
repositories {
exclusiveContent {
// We get React Native's Android binaries exclusively through
npm,
// from a local Maven repo inside node_modules/react-native/.
// (The use of exclusiveContent prevents looking elsewhere like
Maven Central
// and potentially getting a wrong version.)
filter {
includeGroup "com.facebook.react"
}
forRepository {
maven {
url "$rootDir/../node_modules/react-native/android"
}
}
}
}
configurations.all {
resolutionStrategy {
force 'androidx.core:core:1.6.0'
force 'androidx.core:core-ktx:1.6.0'
}
}
In app level build.gradle, add these dependecies:
implementation 'androidx.core:core-ktx:1.6.0',
implementation 'androidx.core:core:1.6.0'
Add following lines inside the android>build.gradle file -
allprojects {
repositories {
...
exclusiveContent {
// We get React Native's Android binaries exclusively through npm,
// from a local Maven repo inside node_modules/react-native/.
// (The use of exclusiveContent prevents looking elsewhere like Maven Central
// and potentially getting a wrong version.)
filter {
includeGroup "com.facebook.react"
}
forRepository {
maven {
url "$rootDir/../node_modules/react-native/android"
}
}
}
}
This issue occurred from November 4th 2022. See the reference: https://github.com/facebook/react-native/issues/35210

WARNING: API 'variant.getPackageLibrary()' is obsolete and has been replaced with 'variant.getPackageLibraryProvider()'

I just upadated kotlin to 1.3.30 and I now get this error when syncing gradle:
WARNING: API 'variant.getPackageLibrary()' is obsolete and has been
replaced with 'variant.getPackageLibraryProvider()'. It will be
removed at the end of 2019. For more information, see
https://d.android.com/r/tools/task-configuration-avoidance. To
determine what is calling variant.getPackageLibrary(), use
-Pandroid.debug.obsoleteApi=true on the command line to display a stack trace. Affected Modules: hydatabase
Here is my build.gradle:
apply plugin: 'com.squareup.sqldelight'
apply plugin: 'kotlin-multiplatform'
apply plugin: 'com.android.library'
android {
compileSdkVersion 28
defaultConfig {
minSdkVersion 19
}
lintOptions {
abortOnError false
}
}
sqldelight {
Database {
packageName = "com.company.hydatabase"
}
}
kotlin {
targets {
fromPreset(presets.jvm, 'jvm')
fromPreset(presets.android, 'android')
}
sourceSets {
commonMain.dependencies {
api 'org.jetbrains.kotlin:kotlin-stdlib-common'
}
jvmMain.dependencies {
api 'org.jetbrains.kotlin:kotlin-stdlib-jdk8'
// ICU4J: Use DecimalFormat
// Get rid of this when minSDKLevel = API 24 - Nougat (7.0)
// https://developer.android.com/guide/topics/resources/internationalization.html
api 'com.ibm.icu:icu4j:60.2'
}
androidMain.dependencies {
implementation 'org.jetbrains.kotlin:kotlin-stdlib'
api "com.squareup.sqldelight:android-driver:1.1.1"
}
androidMain.dependsOn jvmMain
}
}
task copyDatabase(type: Copy) {
from "${rootProject.file('hyappcommon/Databases/').path}"
into "${rootProject.file('hydatabase/src/main/assets/databases/').path}"
include '**/*.sqlite'
}
preBuild.dependsOn(copyDatabase)
// workaround for https://youtrack.jetbrains.com/issue/KT-27170
configurations {
compileClasspath
}
If you debug, it shows
REASON: The Kotlin plugin is currently calling this API. We are working to solve this.
To see this error please run
./gradlew -Pandroid.debug.obsoleteApi=true --stacktrace
As tommyboy said, the Kotlin plugin is calling this deprecated API.
If you don't want to get this warning while Kotlin is working on this, you can just use the previous version of Kotlin plugin like:
dependencies {
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:1.3.21"
}
It's probably a bug and fixed soon
You can revert back to the previous version or add this line to gradle.properties
android.debug.obsoleteApi=true
In my project gradle file I had
buildscript {
ext.kotlin_version = '1.3.31'
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.3.2'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
Simple changing
ext.kotlin_version = '1.3.31' to ext.kotlin_version = '1.3.41' solved the problem
when using version 1.3.31 i had tried gradlew -Pandroid.debug.obsoleteApi=true
It mentioned
WARNING: API 'variant.getPackageLibrary()' is obsolete and has been
replaced with 'variant.getPackageLibraryProvider()'. It will be
removed at the end of 2019.
For more information, see https://d.android.com/r/tools/task-configuration-avoidance.
REASON: The Kotlin plugin is currently calling this API. We are working to solve this.
WARNING: Debugging obsolete API calls can take time during
configuration. It's recommended to not keep it on at all times.
Looks like it is solved in 1.3.41
It's an issue with the Kotlin plugin, as mentioned here. It'll get fixed in a later version.
After I updated Kotlin to 1.3.30, the following dependencies cause the error:
dependencies {
classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.8.4'
classpath 'com.github.dcendents:android-maven-gradle-plugin:2.1'
// ... other dependencies
}
I have reported the issue here:
https://github.com/bintray/gradle-bintray-plugin/issues/284
https://github.com/dcendents/android-maven-gradle-plugin/issues/81
By the way, you can ignore that error message.
The issue is tracked here and it is fixed.
Just use the Kotlin Gradle plugin v 1.3.40 or higher.
WARNING: API 'variant.getPackageLibrary()' is obsolete and has been replaced with 'variant.getPackageLibraryProvider()'.
It will be removed at the end of 2019.
Just updated to "v1.3.40-release-Studio3.4-1" plugin.
as you can see in https://youtrack.jetbrains.com/issue/KT-30784
I met this problem when I use kotlin plugin with library plugin. I found that if you use kotlin plugin with application plugin, it works well. But if you use kotlin plugin with library plugin, it will cause this problem. So that means:
// work well:
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-kapt'
apply plugin: 'kotlin-android-extensions'
// error:
apply plugin: 'com.android.library'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-kapt'
apply plugin: 'kotlin-android-extensions'
As the error diplayed that, you can use ./gradlew -Pandroid.debug.obsoleteApi=true --stacktrace to find out with module caused this problem.
Then I found that one of my module used the wrong plugin combination above. And that seems to be a bug of kotlin plugin. So finally, I upgraded the kotlin plugin, and then it worked well. Below is the kotlin plugin that I finally used:
buildscript {
ext.kotlin_version = '1.3.40'
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.4.1'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
}
}
You can run this command in the root project
gradlew -Pandroid.debug.obsoleteApi=true
and the warning will be disappeared.

io.micronaut.runtime.Micronaut - No embedded container found

I'm trying to build a Kotlin application but, even with successfully build, I face with the error bellow. What I'm doing wrong?
▶ java -jar build/libs/app-0.1.jar
22:10:02.122 [main] INFO io.micronaut.runtime.Micronaut - No embedded container found. Running as CLI application
Here is my build status:
▶ ./gradlew assemble
BUILD SUCCESSFUL in 3s
14 actionable tasks: 1 executed, 13 up-to-date
That is the part of my gradle.build file:
apply from: "dependencies.gradle"
apply from: "protobuf.gradle"
version "0.1"
group "app"
mainClassName = "app.Application"
dependencies {
compile "ch.qos.logback:logback-classic:1.2.3"
}
jar {
manifest {
attributes "Main-Class": mainClassName
}
from {
configurations.compile.collect { it.isDirectory() ? it : zipTree(it) }
}
}
I had a similar issue:
I was able to run code from IDE, but failed to run Docker container with the app
And had compile 'io.micronaut:micronaut-http-server-netty:1.1.0' in my build.gradle.
Also I was using shadowJar plugin and there was the issue. Adding:
shadowJar {
mergeServiceFiles()
}
solved the problem. It transforms entries in META-INF/services resources into a single resource. My shadowed jar file contained a lot of entries in this folder.
It is difficult to say for sure without seeing the project but one thing that could cause that issue would be not having a dependency on io.micronaut:micronaut-http-server-netty. A newly created app will have something like this in build.gradle...
dependencies {
compile "org.jetbrains.kotlin:kotlin-stdlib-jdk8:${kotlinVersion}"
compile "org.jetbrains.kotlin:kotlin-reflect:${kotlinVersion}"
compile "io.micronaut:micronaut-runtime"
compile "io.micronaut:micronaut-http-client"
// Make Sure You Have This...
compile "io.micronaut:micronaut-http-server-netty"
kapt "io.micronaut:micronaut-inject-java"
kapt "io.micronaut:micronaut-validation"
kaptTest "io.micronaut:micronaut-inject-java"
runtime "ch.qos.logback:logback-classic:1.2.3"
runtime "com.fasterxml.jackson.module:jackson-module-kotlin:2.9.4.1"
testCompile "org.junit.jupiter:junit-jupiter-api:5.1.0"
testCompile "org.jetbrains.spek:spek-api:1.1.5"
testRuntime "org.junit.jupiter:junit-jupiter-engine:5.1.0"
testRuntime "org.jetbrains.spek:spek-junit-platform-engine:1.1.5"
}

How to build my xtext language with gradle for android

I've written a test-DSL in xtext and generated an IntelliJ plugin.
I have a small Android-test project and in Android Studio my DSL-editor shows up and also generates the output files as expected.
Now I try to configure gradle to also generate the files, but this fails with an error.
I found the Android Integration section for the xtext-builder. This seems out-dated (e.g. it refers to org.xtext.android, which does not exist - also the link there is broken).
Anyway, in the xtext-gradle-plugin github repo there is an org.xtext.android.builder plugin: I guess this is the correct one.
My project build.gradle file looks like this (relevant parts only):
buildscript {
repositories {
maven {
url "https://plugins.gradle.org/m2/" // needed for org.xtext:xtext-android-gradle-plugin
}
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.2.3'
classpath "org.xtext:xtext-android-gradle-plugin:1.0.14"
}
}
allprojects {
repositories {
jcenter()
mavenLocal() // This is required so that the mydsl language is found
}
}
when I activate the org.xtext.android.builder plugin in the build.gradle file of in my app module:
apply plugin: 'com.android.application'
apply plugin: "org.xtext.android.builder" // causes the Error!
I get this error:
Error:Unable to find method 'com.android.build.gradle.api.BaseVariant.getJavaCompiler()Lorg/gradle/api/tasks/compile/AbstractCompile;'...
I guess there's some version mismatch or something is not up-to-date.
Any ideas?
This was a bug (#73) in the xtext-gradle-plugin. It was fixed in Version 1.0.16.

How to run build.gradle with Sikuli integrated into the project?

I am using Sikuli in my project to handle some flash buttons. It's working fine while running scripts locally. The issue is that when I need to run the build.gradle, I need to have the Sikuli dependency in build.gradle. That is how I have written build.gradle. When I run the build, I get this error:
What went wrong: Could not resolve all dependencies for configuration ':compile'.
Could not find com.googlecode.javacpp:javacpp:0.1. Required by:
:new_qa_automation:1.0 > org.sikuli:sikuli-api:1.0.2 > org.sikuli:sikuli-c ore:1.0.1
Could not find com.googlecode.javacv:javacv:0.1. Required by:
:new_qa_automation:1.0 > org.sikuli:sikuli-api:1.0.2 > org.sikuli:sikuli-c ore:1.0.1
Try: Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
BUILD FAILED.
Here is my build.gradle file
apply plugin: 'java' version = '1.0' apply plugin: 'project-report'
repositories { mavenCentral() maven { url
"http://repo.springsource.org/release" url
"http://oss.sonatype.org/content/groups/public/" } }
sourceCompatibility = 1.6 targetCompatibility = 1.6
configurations { cucumberRuntime { extendsFrom testRuntime } }
task test(overwrite: true) {
dependsOn assemble, processTestResources, compileTestJava
doLast {
javaexec {
main = "cucumber.api.cli.Main"
classpath = configurations.cucumberRuntime + sourceSets.main.output + sourceSets.test.output
//some args
systemProperties System.properties
}
} }
dependencies { compile 'org.seleniumhq.selenium:selenium-java:2.32.+'
compile 'org.apache.commons:commons-lang3:3.1' compile
'org.springframework:spring-context:3.2.3.RELEASE'
compile group: 'org.sikuli', name: 'sikuli-api', version: '1.0.+' compile group: 'commons-collections', name: 'commons-collections',
version: '3.+'
testCompile 'info.cukes:cucumber-java:1.1.2'
testCompile 'info.cukes:cucumber-spring:1.1.2'
testCompile 'info.cukes:cucumber-junit:1.1.2'
testCompile 'junit:junit:4.11' testCompile 'org.easytesting:fest-assert-core:2.0+'
}
Edit:
I added the URL for the Maven repositry. Now the error has changed to
ePage.java:9: error: package org.sikuli.script does not exist
import org.sikuli.script.FindFailed;
sikuli-script.jar in Sikuli IDE project not provide in any repository so you must use it like a 3rd party jar
see:
"Mavan's central repository will not answer on any Sikuli stuff" https://answers.launchpad.net/sikuli/+question/185713
"Gradle: Make a 3rd party jar available to local gradle repository" Gradle: Make a 3rd party jar available to local gradle repository
The Sikuli code base appears to be fragmented. It's quite confusing; I know of 3 different sets of Java bindings. (one, two, three)
I think the one you're pulling with Maven is this: http://code.google.com/p/sikuli-api/
If so, org.sikuli.script is not the right import. You don't include your code to show me what you're trying to do with Sikuli, but most of the things you'd want to import are somewhere under org.sikuli.api.
Just download the sikulix jar and mention it in build.gradle
eg: compile files('C:\Users\vedavyasa\Documents\jar\sikulixapi.jar')