Following a tutorial on setting up A LibGDX project and the tutorial says that in the third party section there should be a Universal Tween Engine. Mines not showing up, is there a way for it to show up? What do i have to download?
Thanks in advance :))
The Gdx-setup-new-ui-jar does not come with TweenEngine library.
There is another way of adding Universal TweenEngine. Since you are using Gradle now, so it is very easy.
just download the TweenEngine from here https://code.google.com/p/java-universal-tween-engine/downloads/list and paste it in your core/libs android/libs and ios/libs folders.
in build.gradle add this line at the end of dependencies of core, android and ios.
compile fileTree(dir: 'libs', include: '*.jar')
like this:
project(":android") {
apply plugin: "android"
configurations { natives }
dependencies {
compile project(":core")
compile "com.badlogicgames.gdx:gdx-backend-android:$gdxVersion"
natives "com.badlogicgames.gdx:gdx-platform:$gdxVersion:natives-x86"
natives "com.badlogicgames.gdx:gdx-bullet-platform:$gdxVersion:natives-x86"
compile fileTree(dir: 'libs', include: '*.jar')
}
}
then just clean/build your project and you are good to go.
LibGdx uses gradle for dependency management.
You can inject dependency from repository.
repositories {
maven { url "https://jitpack.io" }
}
add these lines in your core module of root build.gradle file.
compile 'com.github.arcnor:universal-tween-engine:6.3.4'
compile 'com.github.arcnor:universal-tween-engine:6.3.4:sources'
For me changing:
compile fileTree(dir: 'libs', include: '*.jar')
to:
compile fileTree(dir: '../libs/tween-engine-api-6.3.3 2', include: '*.jar')
did the trick. (Obviously your file name may be different (no 2 on the end for example))
Related
I am trying to build sample hello application using gradle build in Spring tool suite facing below design time error.
I have grade version 4.10.2 installed on my machine.
Error Msg:
Description Resource Path Location Type
Could not run build action using Gradle distribution 'https://services.gradle.org/distributions/gradle-4.10.2-bin.zip'.
Build file 'C:\TFS\Study\Springboot\GradleExamples\workspace\Gradle_Hello\build.gradle' line: 14
Plugin [id: 'org.springframework.boot', version: '2.1.2.RELEASE'] was not found in any of the following sources:
- Gradle Core Plugins (plugin is not in 'org.gradle' namespace)
- Plugin Repositories (could not resolve plugin artifact 'org.springframework.boot:org.springframework.boot.gradle.plugin:2.1.2.RELEASE')
Searched in the following repositories:
Gradle Central Plugin Repository
Plugin [id: 'org.springframework.boot', version: '2.1.2.RELEASE'] was not found in any of the following sources:
- Gradle Core Plugins (plugin is not in 'org.gradle' namespace)
- Plugin Repositories (could not resolve plugin artifact 'org.springframework.boot:org.springframework.boot.gradle.plugin:2.1.2.RELEASE')
Searched in the following repositories:
Gradle Central Plugin Repository build.gradle /Gradle_Hello line 14 Gradle Error Marker
Next time, please include your build.gradle file.
I believe your problem is caused by the fact you are trying to apply the plugin:'org.springframework.boot' without telling your gradle script where to find that plugin. Your buildscript (build.gradle file) actually depends on the org.springframework.boot plugin, however since it can't find it (and doesn't even know what it is), you are getting this issue.
you can fix that issue by adding the following code at the top of your file:
buildscript {
repositories {
mavenCentral()
}
dependencies {
// You are telling gradle that this script (Not the project) depends on the
// following plugin
classpath "org.springframework.boot:spring-boot-gradle-plugin:2.1.2.RELEASE"
}
}
apply plugin: "org.springframework.boot"
// The rest of your build.gradle file
I had the same problem, so I changed to Gradle 6.5 and also add settings.gradle file in the same dir as your build.gradle with the following info.
// settings.gradle
pluginManagement {
plugins {
id "org.springframework.cloud.contract" version "${verifierVersion}"
}
repositories {
// to pick from local .m2
mavenLocal()
// for snapshots
maven { url "https://repo.spring.io/snapshot" }
// for milestones
maven { url "https://repo.spring.io/milestone" }
// for GA versions
gradlePluginPortal()
}
}
In addition make sure that you can connect to your repositories. In my case if was a internal nexus server and gradle wasn't able to connect to the repositories because of SSL certificate missing from JDK truststore. I added the nexus SSL certificate in to the JDK truststore and it resolved
I think I have a minor problem with my Gradle build files in Android Studio. Since I have no experience with them, and the few research results didn't resolve my problem, I think, that some of you guys maybe know how to resolve that issue.
At first I want to explain how I "constructed" my project in case you need this information. At first I created a fresh Android Studio project to get the project/directory structure. When the creation was finished, I closed Android Studio and checked them manually out of our SVN. The reason is not really important for my issue, but I did it to leave the project structure of my company the way it is(the Android part is just a small part of it). Instead I checked my Android Studio project in and linked all necessary files with SVN externals. So it is able to checkout and commit without changing anything in the project structure. Anyways, by creating a new project my Gradle files have been the default ones, after creating a new project. Since all necessary files have been checked out in the correct Android Studio project directories, I started Android Studio again, deleted the previously created project from the list, and imported it again. After that all my new files have been displayed. Even the new libraries are included in my Gradle build file under dependencies, as you will see.
But when I am trying to Build my project (I tried "Rebuild" and "Make project") I receive following Gradle error message:
FAILURE: Build failed with an exception.
What went wrong: A problem was found with the configuration of task ':app:checkDebugManifest'. File
'D:\Workspace\MyProject\app\src\main\AndroidManifest.xml'
specified for property 'manifest' does not exist.
This is my build.gradle in my projects root directory:
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:1.1.0'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
jcenter()
}
}
and this is the build.gradle in my "app"-directory
apply plugin: 'com.android.application'
android {
compileSdkVersion 21
buildToolsVersion "22.0.0"
defaultConfig {
applicationId "de.giessen.advenco.key2operate"
minSdkVersion 15
targetSdkVersion 21
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:22.0.0'
}
If you guys need more information (settings.gradle, .properties-files, AndroidManifest.xml) just tell me.
I don't know if this is important but, this is what the Gradle Console shows, before the error occurs:
Configuration on demand is an incubating feature.
:app:preBuild UP-TO-DATE
:app:preDebugBuild UP-TO-DATE
:app:checkDebugManifest FAILED
Gradle is looking for the manifest at \src\main\AndroidManifest.xml, which is the default for new Gradle projects.
If you are using a different folder, you can specify a different location in your build.gradle using something like this:
android {
// ...
sourceSets {
main {
manifest.srcFile 'AndroidManifest.xml'
java.srcDirs = ['src']
resources.srcDirs = ['src']
aidl.srcDirs = ['src']
renderscript.srcDirs = ['src']
res.srcDirs = ['res']
assets.srcDirs = ['assets']
}
}
What should i do to fix this issue?
I am getting this error when i ever i run my project in android studio0.9.1
android {compileSdkVersion 17
buildToolsVersion "19.1.0"
defaultConfig {
applicationId "com.example.nearby"
minSdkVersion 11
targetSdkVersion 19
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
}
}}dependencies {
compile 'com.android.support:support-v4:19.0.0'
compile 'com.google.android.gms:play-services:+'
compile 'com.android.support:appcompat-v7:19.0.0'
compile files('libs/google-play-services.jar')}
I just ran into this same error. Make sure you don't have an android block in the top-level build.gradle for the project, only in the module's build.gradle file.
This happened to me when AndroidStudio tried to import and existing, buildable Eclipse/ADT project–I had to cut and paste the android block from one gradle file to the other. I don't know if this has been fixed in more recent versions of AndroidStudio.
I ran into the same problem. My fix was adding "apply plugin: 'android'" before android block...
Hope it helps anyone.
Inspired by Ionoclast Brigham's answer I've checked both gradle files. I had android() in both of them... but instead of moving android() from the root one to module one I've just added
apply plugin: 'android'
to root one and build works fine.
in my case i had to delete these lines from the top-level build.gradle file as it's a bug in the android studio which inserts this
android {
compileSdkVersion 23
buildToolsVersion '23.0.1'
}
Solution is found here under runProguard section. In short, it says;
To update your project, edit your build.gradle file as follows:
}
release {
runProguard true
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
}
So I currently have the following build.gradle file:
apply plugin: 'java'
sourceSets {
main {
java {
srcDir 'src/model'
}
}
test {
srcDirs = ["tests/model"]
}
}
dependencies {
compile files('libs/mnist-tools.jar', 'libs/gson-2.2.4.jar')
runtime fileTree(dir: 'libs', include: '*.jar')
testCompile group: 'junit', name: 'junit', version: '4.+'
}
that builds successfully when I type "gradle test" into the command line.
However I do the following error when running gradle test:
Creating properties on demand(a.k.a dynamic properties) has been deprecated.
As you can see, my junit tests are all in the folder test/model/ but I was wondering how do I see the results of if my junit tests passed?
You can view my repository here: https://github.com/quinnliu/WalnutiQ
Chingy,
I had to update a couple of things in your build.gradle:
source set for tests
added Maven repository to get JUnit library
apply plugin: 'java'
repositories {
mavenCentral()
}
sourceSets {
main {
java {
srcDir 'src/model'
}
}
test {
java {
srcDir 'tests/model'
}
}
}
dependencies {
compile files('libs/mnist-tools.jar', 'libs/gson-2.2.4.jar')
runtime fileTree(dir: 'libs', include: '*.jar')
testCompile group: 'junit', name: 'junit', version: '4.+'
}
Now, the results of $ gradle build:
bender:WalnutiQ demo$ gradle build
:compileJava UP-TO-DATE
:processResources UP-TO-DATE
:classes UP-TO-DATE
:jar UP-TO-DATE
:assemble UP-TO-DATE
:compileTestJava
Note: Some input files use unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
:processTestResources UP-TO-DATE
:testClasses
:test
model.RetinaTest > test_seeBMPImage FAILED
java.lang.IllegalArgumentException at RetinaTest.java:25
model.MARK_I.SpatialPoolerTest > test_performSpatialPoolingOnRegion FAILED
java.lang.IllegalArgumentException at SpatialPoolerTest.java:60
model.util.JsonFileInputOutputTest > test_saveRegionObject FAILED
java.lang.IllegalArgumentException at JsonFileInputOutputTest.java:69
model.util.SynapsePermanencesViewerTest > test_saveRegionToBeOpenedInSynapsePermanencesViewer FAILED
java.lang.IllegalArgumentException at SynapsePermanencesViewerTest.java:45
49 tests completed, 4 failed
:test FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':test'.
> There were failing tests. See the report at: file:///Users/demo/development/tmp/WalnutiQ/build/reports/tests/index.html
I think you can take it from here :o)
PS: I would recommend to refactor your project structure to match Maven/Gradle structure, so you don't have to deal with source sets and it will make your build.gradle cleaner.
src/main/java Production Java source
src/main/resources Production resources
src/test/java Test Java source
src/test/resources Test resources
src/sourceSet/java Java source for the given source set
src/sourceSet/resources Resources for the given source set
When you run gradle build or gradle test, there is a build directory that is created.
This directory is where all the build artifacts are placed.
Inside the build directory is a reports directory. This directory is where reports are placed.
For example, pmd reports, junit reports, etc.
The JUnit reports are located in the tests directory. Open up the index.html file in a browser to view the report.
You can specify where the JUnit test results go with the following command within your test block.
test {
reports.junitXml.destination = file('build/test-results/folder')
}
Are there any ready-to-use Gradle plugins to use for UglifyJs? We are trying to configure Uglify something similar to what has been done here, but the owner of that project seems to have his own private artifactory to which he points to, thereby getting access to UglifyAntTask, which is a github-hosted project not following Gradle/Maven etc. (basically non-managed) JAR. We tried downloading this JAR to our project and tried configuring using the options suggested in gradle page as follows:
dependencies {
compile fileTree(dir: 'libs', include: '*.jar') (or)
compile files('uglifyjs-java-v1.0.jar')
}
Note: The (or) is not there in actual code, I mentioned only to indicate that we tried both options but it was not picking the JAR.
So at a later step, when we gave
ant.taskdef(name: "uglify", classname: "uglify.ant.UglifyTask", classpath: configurations.uglifyjs.asPath)
Gradle throws the following errror:
taskdef class uglify.ant.UglifyTask cannot be found
using the classloader AntClassLoader[]
I am hoping that at least some one must have had the need to include non-managed 3rd party JAR and have figured out how to do this, if so, please point the solution/mistake we have made.
Thanks,
Paddy
Here is how the offical Gradle documentation describe it:
configurations {
uglifyjs
}
dependencies {
uglifyjs files('uglifyjs-java-v1.0.jar')
}
task uglifyjs << {
ant.taskdef(name: 'uglifyjs', classname: 'uglify.ant.UglifyTask', classpath: configurations.uglifyjs.asPath)
ant.uglifyjs( ... UglifyJS Ant Task parameters ... )
}
See http://www.gradle.org/docs/current/userguide/ant.html#N11416
HTH