gradle mysql dependency syncs but doesnt work - java

So I am adding a mysql dependency to my build.gradle, and it syncs perfect, but the problem is that I cant use the dependency code.
for instance, I added mysql.jar as a dependency, and it loaded, but trying to import com.mysql.jdbc.driver wont work.
Notice that Im using libgdx library
My build.gradle:
buildscript {
repositories {
mavenLocal()
mavenCentral()
maven { url "https://oss.sonatype.org/content/repositories/snapshots/" }
jcenter()
}
dependencies {
classpath 'de.richsource.gradle.plugins:gwt-gradle-plugin:0.6'
classpath 'com.android.tools.build:gradle:1.5.0'
classpath 'com.mobidevelop.robovm:robovm-gradle-plugin:2.3.0'
}
}
allprojects {
apply plugin: "eclipse"
apply plugin: "idea"
version = '1.0'
ext {
appName = "Baladiya"
gdxVersion = '1.9.6'
roboVMVersion = '2.3.0'
box2DLightsVersion = '1.4'
ashleyVersion = '1.7.0'
aiVersion = '1.8.0'
}
repositories {
mavenLocal()
mavenCentral()
maven { url "https://oss.sonatype.org/content/repositories/snapshots/" }
maven { url "https://oss.sonatype.org/content/repositories/releases/" }
}
}
project(":desktop") {
apply plugin: "java"
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-box2d-platform:$gdxVersion:natives-desktop"
compile "com.badlogicgames.gdx:gdx-tools:$gdxVersion"
compile files("libs/mysql.jar")
}
}
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-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.gdx:gdx-box2d:$gdxVersion"
natives "com.badlogicgames.gdx:gdx-box2d-platform:$gdxVersion:natives-armeabi"
natives "com.badlogicgames.gdx:gdx-box2d-platform:$gdxVersion:natives-armeabi-v7a"
natives "com.badlogicgames.gdx:gdx-box2d-platform:$gdxVersion:natives-arm64-v8a"
natives "com.badlogicgames.gdx:gdx-box2d-platform:$gdxVersion:natives-x86"
natives "com.badlogicgames.gdx:gdx-box2d-platform:$gdxVersion:natives-x86_64"
compile files("libs/mysql.jar")
}
}
project(":ios") {
apply plugin: "java"
apply plugin: "robovm"
dependencies {
compile project(":core")
compile "com.mobidevelop.robovm:robovm-rt:$roboVMVersion"
compile "com.mobidevelop.robovm:robovm-cocoatouch:$roboVMVersion"
compile "com.badlogicgames.gdx:gdx-backend-robovm:$gdxVersion"
compile "com.badlogicgames.gdx:gdx-platform:$gdxVersion:natives-ios"
compile "com.badlogicgames.gdx:gdx-box2d-platform:$gdxVersion:natives-ios"
compile files("libs/mysql.jar")
}
}
project(":html") {
apply plugin: "gwt"
apply plugin: "war"
dependencies {
compile project(":core")
compile "com.badlogicgames.gdx:gdx-backend-gwt:$gdxVersion"
compile "com.badlogicgames.gdx:gdx:$gdxVersion:sources"
compile "com.badlogicgames.gdx:gdx-backend-gwt:$gdxVersion:sources"
compile "com.badlogicgames.gdx:gdx-box2d:$gdxVersion:sources"
compile "com.badlogicgames.gdx:gdx-box2d-gwt:$gdxVersion:sources"
compile files("libs/mysql.jar")
}
}
project(":core") {
apply plugin: "java"
dependencies {
compile "com.badlogicgames.gdx:gdx:$gdxVersion"
compile "com.badlogicgames.gdx:gdx-box2d:$gdxVersion"
compile files("libs/mysql.jar")
}
}
tasks.eclipse.doLast {
delete ".project"
}
My import error:

Why do you need mysql.jar in the first place? Judging by what you showed us, you need just a driver - simply import a driver from jcenter or maven central for example:
compile group: 'mysql', name: 'mysql-connector-java', version: '6.0.6'
into the core.

I am not quite sure about how many projects have libs/mysql.jar, but if you include compile files("libs/mysql.jar") dependency under each project, you need the jar under the corresponding project like this:
desktop/
|- src/
|- libs/mysql.jar
android/
|- src/
|- libs/mysql.jar
ios/
|- src/
|- libs/mysql.jar
html/
|- src/
|- libs/mysql.jar
core/
|- src/
|- libs/mysql.jar
Since you have already require desktop, android, ios, html projects depending on core,
so the dependency of compile files("libs/mysql.jar") is actually redundant,
you only need it to be included in core/.
Let me know if this works.

Related

how to create executable java gradle project?

this is my build.gradle
this is what happens when i attempt to run the built jar.
plugins {
id 'java'
}
group 'org.example'
version '1.0-SNAPSHOT'
repositories {
mavenCentral()
}
dependencies {
testImplementation 'org.junit.jupiter:junit-jupiter-api:5.7.0'
testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.7.0'
implementation "net.dv8tion:JDA:5.0.0-alpha.6"
implementation group: 'org.seleniumhq.selenium', name: 'selenium-java', version: '4.1.2'
implementation"io.github.bonigarcia:webdrivermanager:5.1.0"
}
test {
useJUnitPlatform()
}
jar {
manifest {
attributes 'Main-Class': 'bullshitPackage.main'
}
exclude 'META-INF/*.RSA', 'META-INF/*.SF','META-INF/*.DSA'
}
You could use the shadowjar plugin to include all dependencies in your jar.
To use it in your build.gradle file, try:
buildscript {
repositories {
maven {
url "https://plugins.gradle.org/m2/"
}
}
dependencies {
classpath "gradle.plugin.com.github.jengelman.gradle.plugins:shadow:7.0.0"
}
}
plugins {
id 'java'
id 'com.github.johnrengelman.shadow' version '7.0.0'
}
group 'org.example'
version '1.0-SNAPSHOT'
repositories {
mavenCentral()
}
dependencies {
testImplementation 'org.junit.jupiter:junit-jupiter-api:5.7.0'
testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.7.0'
implementation "net.dv8tion:JDA:5.0.0-alpha.6"
implementation group: 'org.seleniumhq.selenium', name: 'selenium-java', version: '4.1.2'
implementation"io.github.bonigarcia:webdrivermanager:5.1.0"
}
test {
useJUnitPlatform()
}
jar {
manifest {
attributes 'Main-Class': 'bullshitPackage.main'
}
exclude 'META-INF/*.RSA', 'META-INF/*.SF','META-INF/*.DSA'
}
Then from your console, navigate to your project's root folder that contains the file gradlew, then run gradlew shadowjar to build the jar into the ./build/libs folder.

Getting Error while running code, I tried MultidexEnable but didnt work

Error:Execution failed for task ':app:transformClassesWithMultidexlistForDebug'.
java.io.IOException: Can't write [/home/android1/Android/projects/ezeparents/app/build/intermediates/multi-dex/debug/componentClasses.jar] (Can't read [/home/android1/.gradle/caches/modules-2/files-2.1/org.apache.httpcomponents/httpcore/4.3.2/31fbbff1ddbf98f3aa7377c94d33b0447c646b6e/httpcore-4.3.2.jar(;;;;;;**.class)] (Duplicate zip entry [httpcore-4.3.2.jar:org/apache/http/annotation/NotThreadSafe.class]))
build.gradle
buildscript {
repositories {
maven { url 'https://maven.fabric.io/public' }
}
dependencies {
classpath 'io.fabric.tools:gradle:1.+'
}
}
apply plugin: 'com.android.application'
apply plugin: 'io.fabric'
repositories {
maven { url 'https://maven.fabric.io/public' }
}
android {
compileSdkVersion 26
buildToolsVersion '26.0.2'
defaultConfig {
applicationId "com.ezeparents"
minSdkVersion 16
targetSdkVersion 22
versionCode 1
versionName "1.0"
multiDexEnabled = true
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
android {
packagingOptions {
exclude 'META-INF/DEPENDENCIES'
exclude 'META-INF/NOTICE'
exclude 'META-INF/LICENSE'
exclude 'META-INF/LICENSE.txt'
exclude 'META-INF/NOTICE.txt'
exclude 'META-INF/ECLIPSE_.SF'
exclude 'META-INF/ECLIPSE_.RSA'
exclude 'org/apache/http/annotation/NotThreadSafe.class'
}
}
}
configurations {
all*.exclude group: 'xpp3', module: 'xpp3'
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
compile('com.crashlytics.sdk.android:crashlytics:2.6.7#aar') {
transitive = true;
}
compile 'com.github.nguyenhoanglam:ImagePicker:1.2.1'
compile 'com.roomorama:caldroid:3.0.1'
compile 'com.android.support:appcompat-v7:26.0.1'
compile 'com.android.support:design:26.0.1'
compile 'com.github.scottyab:showhidepasswordedittext:0.8'
compile 'com.android.support:recyclerview-v7:26.0.1'
compile 'com.android.support:cardview-v7:26.0.1'
compile 'me.relex:circleindicator:1.2.2#aar'
compile 'com.hedgehog.ratingbar:app:1.1.2'
compile 'com.squareup.okhttp3:okhttp:3.8.1'
compile 'com.squareup.picasso:picasso:2.5.2'
compile 'com.facebook.android:facebook-android-sdk:4.+'
compile 'de.hdodenhof:circleimageview:2.1.0'
compile 'com.github.fiskurgit:ChipCloud:2.1.0'
compile 'com.squareup.retrofit2:converter-gson:2.3.0'
compile 'com.theartofdev.edmodo:android-image-cropper:2.3.+'
compile 'com.kyleduo.switchbutton:library:1.4.4'
compile 'com.getkeepsafe.taptargetview:taptargetview:1.9.1'
compile 'com.android.support.constraint:constraint-layout:1.0.1'
compile 'com.google.firebase:firebase-messaging:11.4.2'
compile 'com.google.android.gms:play-services-auth:11.4.2'
compile 'com.google.android.gms:play-services-location:11.4.2'
compile 'com.google.android.gms:play-services-places:11.4.2'
compile 'org.igniterealtime.smack:smack-android:4.1.0-rc1'
compile 'org.igniterealtime.smack:smack-tcp:4.1.0-rc1'
compile 'org.igniterealtime.smack:smack-android-extensions:4.1.0-rc1'
compile 'com.android.volley:volley:1.0.0'
compile 'com.googlecode.android-query:android-query:0.24.3'
compile 'org.jbundle.util.osgi.wrapped:org.jbundle.util.osgi.wrapped.org.apache.http.client:4.1.2'
compile 'com.google.firebase:firebase-auth:11.4.2'
compile 'uk.co.chrisjenx:calligraphy:2.3.0'
testCompile 'junit:junit:4.12'
compile 'com.github.nguyenhoanglam:ImagePicker:1.2.1'
compile 'com.github.hani-momanii:SuperNova-Emoji:1.1'
compile 'org.apache.commons:commons-lang3:3.5'
compile 'com.android.support:multidex:1.0.2'
}
apply plugin: 'com.google.gms.google-services'
Please clear you dependencies. You have an error, because you have a lot of libraries, that have same functionality.
Also
Warning:WARNING: Dependency org.apache.httpcomponents:httpclient:4.3.2 is ignored for release as it may be conflicting with the internal version provided by Android.
In my opinion the problem is in
compile 'com.squareup.retrofit2:retrofit:2.3.0'
compile 'org.apache.commons:commons-lang3:3.5'
This two libraries can have same classes, so you need to exclude one of them, or exclude this duplicates.
You can try
android {
...
packagingOptions {
exclude 'org/apache/http/annotation/NotThreadSafe.class'
}
}
Pretty the same topic(Gradle build error : Duplicate entry)
the above answer may also be correct, but it seems also an issue of the new google repo
add google as in below
In your root level gradle.build use below
buildscript {
repositories {
mavenCentral()
jcenter()
google()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.0.0'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
mavenCentral()
jcenter()
google()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
and in your gradle-wrapper.properties file change the wrapper version as below
distributionUrl=https\://services.gradle.org/distributions/gradle-4.2.1-all.zip

Android gradle Error:(69, 0) Gradle DSL method not found: 'compile()'

I'm having this very frustrating issue with my build.gradle file. It started when I decided to add new library to my project: "Deter-master" lib.
This is the error message:
Gradle sync failed: Could not find method compile() for arguments
[com.android.support:appcompat-v7:25.0.0] on
DefaultExternalModuleDependency{group='com.android.support',
name='support-v13', version='25.0.0', configuration='default'} of type
org.gradle.api.internal.artifacts.dependencies.DefaultExternalModuleDependency.
Consult IDE log for more details (Help | Show Log)
Below you can see all gradle files:
apply plugin: 'com.android.application'
ext {
libraries = [
support : "25.0.0",
location: "9.8.0"
]
}
def config = project.ext.libraries
repositories {
mavenCentral()
mavenLocal()
flatDir {
dirs 'libs'
}
maven { url 'https://maven.fabric.io/public' }
}
repositories {
maven {
url 'https://dl.bintray.com/blipinsk/maven/'
}
}
android {
compileSdkVersion 25
buildToolsVersion "25.0.0"
defaultConfig {
applicationId "com.airnauts.kaktus"
minSdkVersion 19
targetSdkVersion 25
versionCode 1
versionName "1.0"
}
signingConfigs {
debug {
storeFile file("../social_keystore.jks")
storePassword "social"
keyAlias "social"
keyPassword "social"
}
release {
storeFile file("../social_keystore.jks")
storePassword "social"
keyAlias "social"
keyPassword "social"
}
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
android {
packagingOptions {
exclude 'LICENSE.txt'
}
}
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
compile(name: 'toolkit', ext: 'aar')
compile "com.android.support:support-v13:${config.support}" compile "com.android.support:appcompat-v7:${config.support}" compile "com.android.support:support-v4:${config.support}" compile "com.android.support:recyclerview-v7:${config.support}" compile "com.android.support:design:${config.support}" compile "com.android.support:cardview-v7:${config.support}" compile "com.android.support:percent:${config.support}" compile "com.google.android.gms:play-services-location:${config.location}" compile "com.google.android.gms:play-services-maps:${config.location}"
//blipinsk
compile 'com.firebaseui:firebase-ui-auth:0.6.2'
compile 'com.bartoszlipinski:viewpropertyobjectanimator:1.2.0'
compile 'com.squareup.picasso:picasso:2.5.2'
compile 'com.jakewharton:butterknife:7.0.0'
compile 'com.makeramen:roundedimageview:2.2.0'
compile 'de.greenrobot:eventbus:2.4.0'
compile 'uk.co.chrisjenx:calligraphy:2.1.0'
compile 'com.facebook.android:facebook-android-sdk:4.7.0'
compile 'me.kaelaela:verticalviewpager:1.0.0#aar'
compile 'com.google.code.gson:gson:2.2.4'
compile 'com.google.firebase:firebase-auth:9.8.0'
compile 'com.firebaseui:firebase-ui:1.0.0'
compile 'com.android.support:support-v4:25.1.0'
compile 'com.karumi:dexter:4.1.0'
compile project('Libraries:Dexter-master')
}
apply plugin: 'com.google.gms.google-services'
Another part:
// 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:2.3.2'
classpath 'com.neenbedankt.gradle.plugins:android-apt:1.8'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
classpath 'com.google.gms:google-services:3.0.0'
}
}
allprojects {
repositories {
jcenter()
flatDir {
dirs 'libs'
}
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
And the last one:
include ':app'
include ':app:Libraries:Dexter-master'
Try replacing:
compile "com.android.support:support-v13:${config.support}" compile "com.android.support:appcompat-v7:${config.support}" compile "com.android.support:support-v4:${config.support}" compile "com.android.support:recyclerview-v7:${config.support}" compile "com.android.support:design:${config.support}" compile "com.android.support:cardview-v7:${config.support}" compile "com.android.support:percent:${config.support}" compile "com.google.android.gms:play-services-location:${config.location}" compile "com.google.android.gms:play-services-maps:${config.location}"
with:
compile "com.android.support:support-v13:${config.support}"
compile "com.android.support:appcompat-v7:${config.support}"
compile "com.android.support:support-v4:${config.support}"
compile "com.android.support:recyclerview-v7:${config.support}"
compile "com.android.support:design:${config.support}"
compile "com.android.support:cardview-v7:${config.support}"
compile "com.android.support:percent:${config.support}"
compile "com.google.android.gms:play-services-location:${config.location}"
compile "com.google.android.gms:play-services-maps:${config.location}"

Error:java.lang.NoClassDefFoundError: Could not initialize class org.gradle.internal.resource.transport.http.AlwaysRedirectRedirectStrategy

I have updated Android Studio to 2.3 recently. When I try to open existing project which was running in AS 2.2 giving me below error in gradle:
Error:java.lang.NoClassDefFoundError: Could not initialize class
org.gradle.internal.resource.transport.http.AlwaysRedirectRedirectStrategy
When I restart AS it show's below error
Error:Unable to load class 'org.apache.commons.logging.LogFactory'.
Possible causes for this unexpected error include:Gradle's dependency cache may be corrupt (this sometimes occurs after a network connection timeout.)
Re-download dependencies and sync project (requires network)The state of a Gradle build process (daemon) may be corrupt. Stopping all Gradle daemons may solve this problem.
Stop Gradle build processes (requires restart)Your project may be using a third-party plugin which is not compatible with the other plugins in the project or the version of Gradle requested by the project.In the case of corrupt Gradle processes, you can also try closing the IDE and then killing all Java processes.
My project gradle is :
// 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:2.3.0'
classpath 'com.google.gms:google-services:3.0.0'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
jcenter()
}
repositories {
maven { url "https://jitpack.io" }
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
My Module level gradle is:
buildscript {
repositories {
maven { url 'https://maven.fabric.io/public' }
}
dependencies {
classpath 'io.fabric.tools:gradle:1.+'
}
}
apply plugin: 'com.android.application'
apply plugin: 'io.fabric'
repositories {
maven { url 'https://maven.fabric.io/public' }
}
dependencies {
compile('com.crashlytics.sdk.android:crashlytics:2.6.6#aar') {
transitive = true;
}
compile 'com.android.support:support-v4:25.2.0'
compile 'com.android.support:leanback-v17:25.2.0'
compile 'com.android.support:cardview-v7:25.2.0'
}
android {
compileSdkVersion 25
buildToolsVersion '25.0.2'
defaultConfig {
applicationId 'com.example.app'
minSdkVersion 15
targetSdkVersion 25
versionCode 3
versionName "1.0.2"
multiDexEnabled true
}
signingConfigs {
release {
keyAlias 'asda'
keyPassword 'asdas'
storeFile file('/home/.playstore/asda/asd.jks')
storePassword 'asda'
}
}
buildTypes {
release {
//shrinkResources true
//minifyEnabled true
//proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
signingConfig signingConfigs.release
}
}
packagingOptions {
exclude 'META-INF/DEPENDENCIES'
exclude 'META-INF/NOTICE'
exclude 'META-INF/LICENSE'
exclude 'META-INF/LICENSE.txt'
exclude 'META-INF/NOTICE.txt'
exclude 'META-INF/ASL2.0'
}
useLibrary 'org.apache.http.legacy'
repositories {
mavenCentral()
maven { url "https://repo.commonsware.com.s3.amazonaws.com" }
maven {
url "https://jitpack.io"
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:25.2.0'
compile 'com.android.support:design:25.2.0'
compile 'com.android.support:multidex:1.0.1'
compile 'org.apache.commons:commons-io:1.3.2'
compile('org.apache.httpcomponents:httpmime:4.3.6') {
exclude module: "httpclient"
}
compile 'org.apache.httpcomponents:httpclient-android:4.3.5.1'
compile 'org.apache.commons:commons-lang3:3.4'
compile 'org.codehaus.jackson:jackson-mapper-asl:1.9.13'
//compile 'com.google.android.gms:play-services-gcm:8.3.0'
compile 'com.google.firebase:firebase-core:10.0.1'
compile 'com.google.firebase:firebase-messaging:10.0.1'
compile 'com.android.support:recyclerview-v7:25.2.0'
compile 'joda-time:joda-time:2.9.2'
compile 'com.squareup.picasso:picasso:2.5.2'
compile 'com.nostra13.universalimageloader:universal-image-loader:1.9.5'
compile 'io.reactivex:rxjava:1.1.6'
compile 'com.github.Cutta:TagView:1.3'
compile 'com.github.PhilJay:MPAndroidChart:v3.0.1'
}
productFlavors {
}
lintOptions {
checkReleaseBuilds false
// Or, if you prefer, you can continue to check for errors in release builds,
// but continue the build even when errors are found:
abortOnError false
}
}
apply plugin: 'com.google.gms.google-services'

Plugin with id 'gwt' not found

Building libgdx project
First time i got error re-download dependencies and sync project each time i build my project. Then i got the solution from this POST
I did change the following from as instructed from the post
file -> project structure -> project
i. gradle version from 3.3 to 2.14.1
ii. update android studio plugin to 2.2.3 (it was unset)
I did take the values from recent working android project
My build.gradle
buildscript {
repositories {
mavenCentral()
maven {
url "https://oss.sonatype.org/content/repositories/snapshots/"
}
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.2.3'
classpath 'org.robovm:robovm-gradle-plugin:1.14.0'
}
}
allprojects {
apply plugin: "eclipse"
apply plugin: "idea"
version = '1.0'
ext {
appName = 'FirstDemo'
gdxVersion = '1.6.4'
roboVMVersion = '1.14.0'
box2DLightsVersion = '1.4'
ashleyVersion = '1.4.0'
aiVersion = '1.5.0'
}
repositories {
mavenCentral()
maven { url "https://oss.sonatype.org/content/repositories/snapshots/" }
maven { url "https://oss.sonatype.org/content/repositories/releases/" }
}
}
project(":desktop") {
apply plugin: "java"
dependencies {
compile project(":core")
compile "com.badlogicgames.gdx:gdx-backend-lwjgl:$gdxVersion"
compile "com.badlogicgames.gdx:gdx-platform:$gdxVersion:natives-desktop"
}
}
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-armeabi"
natives "com.badlogicgames.gdx:gdx-platform:$gdxVersion:natives-armeabi-v7a"
natives "com.badlogicgames.gdx:gdx-platform:$gdxVersion:natives-x86"
}
}
project(":core") {
apply plugin: "java"
dependencies {
compile "com.badlogicgames.gdx:gdx:$gdxVersion"
}
}
project(":ios") {
apply plugin: "java"
apply plugin: "robovm"
dependencies {
compile project(":core")
compile "org.robovm:robovm-rt:$roboVMVersion"
compile "org.robovm:robovm-cocoatouch:$roboVMVersion"
compile "com.badlogicgames.gdx:gdx-backend-robovm:$gdxVersion"
compile "com.badlogicgames.gdx:gdx-platform:$gdxVersion:natives-ios"
}
}
project(":html") {
apply plugin: "gwt"
apply plugin: "war"
dependencies {
compile project(":core")
compile "com.badlogicgames.gdx:gdx-backend-gwt:$gdxVersion"
compile "com.badlogicgames.gdx:gdx:$gdxVersion:sources"
compile "com.badlogicgames.gdx:gdx-backend-gwt:$gdxVersion:sources"
}
}
tasks.eclipse.doLast {
delete ".project"
}
Now i am getting error "Plugin with id 'gwt' not found". Can someone please help!
add this dependency into your buildscript tag of your root build.gradle file
classpath 'de.richsource.gradle.plugins:gwt-gradle-plugin:0.6'
After addition your buildscript looks like this
buildscript {
repositories {
mavenCentral()
maven {
url "https://oss.sonatype.org/content/repositories/snapshots/"
}
jcenter()
}
dependencies {
classpath 'de.richsource.gradle.plugins:gwt-gradle-plugin:0.6'
classpath 'com.android.tools.build:gradle:2.2.3'
classpath 'org.robovm:robovm-gradle-plugin:1.14.0'
}
}

Categories