Andorid Studio - KorGE plugin - build.gradle

做~自己de王妃 提交于 2021-01-28 21:20:02

问题


I would like to use Open Source KorGE Game Engine. I'm using Android studio now and I would like to know if anyone know how to import the library. I've installed the plugin followind the setup documentation. Could anyone show me how to setup right my build.gradle? Thanks in Advance

UPDATE: Following @soywiz suggestion this problem occurred:

UPDATE Thanks to soywiz , now I can use KorGe In my Androdi Project. Just set in build gradle:

buildscript {
repositories {
    google()
    jcenter()
    maven {
        url = uri("https://plugins.gradle.org/m2/")
    }
    maven { url = uri("https://dl.bintray.com/kotlin/kotlin-dev") }
}
dependencies {
        ...
  }
}

   allprojects {
    repositories {
        mavenLocal()
        maven { url = 'https://dl.bintray.com/korlibs/korlibs' }
        google()
        jcenter()
        maven { url = uri("https://dl.bintray.com/kotlin/kotlin-dev") }
        }
    }

and in build.gradle (app):

dependencies {

    implementation 'com.android.support:multidex:1.0.3'
    implementation 'com.soywiz.korlibs.korge:korge-android:1.13.3'
    implementation 'com.soywiz.korlibs.klock:klock-android:1.11.12'
    implementation 'com.soywiz.korlibs.kmem:kmem-android:1.10.5'
    implementation 'com.soywiz.korlibs.kds:kds-android:1.10.12'
    implementation 'com.soywiz.korlibs.korma:korma-android:1.11.16'
    implementation 'com.soywiz.korlibs.korio:korio-android:1.11.7'
    implementation 'com.soywiz.korlibs.korim:korim-android:1.12.24'
    implementation 'com.soywiz.korlibs.korau:korau-android:1.11.9'
    implementation 'com.soywiz.korlibs.korgw:korgw-android:1.12.18'
    implementation 'com.soywiz.korlibs.krypto:krypto-android:1.11.1'
    implementation 'com.soywiz.korlibs.korinject:korinject-android:1.10.1'
    implementation 'com.soywiz.korlibs.klogger:klogger-android:1.10.1'
}

回答1:


The easiest way / most up-to-date way to find out the build.gradle requirements is to actually build a project using KorGE.

If you download this repo: https://github.com/korlibs/korge-hello-world

Then execute:

./gradlew installAndroidDebug

This will create a folder called build/platforms/android containing a build.gradle file with all the details.

The important parts:

repositories {
    // ...
    maven { url = 'https://dl.bintray.com/korlibs/korlibs' }
    // ...
}

dependencies {
    implementation fileTree(dir: 'libs', include: ['*.jar'])
    implementation 'org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.3.72'
    implementation 'com.android.support:multidex:1.0.3'
    implementation 'com.soywiz.korlibs.korge:korge-android:1.13.3'
    implementation 'com.soywiz.korlibs.klock:klock-android:1.11.12'
    implementation 'com.soywiz.korlibs.kmem:kmem-android:1.10.5'
    implementation 'com.soywiz.korlibs.kds:kds-android:1.10.12'
    implementation 'com.soywiz.korlibs.korma:korma-android:1.11.16'
    implementation 'com.soywiz.korlibs.korio:korio-android:1.11.7'
    implementation 'com.soywiz.korlibs.korim:korim-android:1.12.24'
    implementation 'com.soywiz.korlibs.korau:korau-android:1.11.9'
    implementation 'com.soywiz.korlibs.korgw:korgw-android:1.12.18'
    implementation 'com.soywiz.korlibs.krypto:krypto-android:1.11.1'
    implementation 'com.soywiz.korlibs.korinject:korinject-android:1.10.1'
    implementation 'com.soywiz.korlibs.klogger:klogger-android:1.10.1'
    implementation 'com.android.support:appcompat-v7:28.0.0'
    implementation 'com.android.support.constraint:constraint-layout:1.1.3'
    testImplementation 'junit:junit:4.12'
    androidTestImplementation 'com.android.support.test:runner:1.0.2'
    androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
}

All the dependencies might change in the future, so my advice is to trigger the hello world android build, so you get an up-to-date build.gradle file.



来源:https://stackoverflow.com/questions/62636588/andorid-studio-korge-plugin-build-gradle

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!