问题描述
我想使用开源
更新感谢soywiz,现在我可以在Androdi项目中使用KorGe了.只需设置构建gradle :
buildscript {储存库{谷歌()jcenter()专家{url = uri("https://plugins.gradle.org/m2/")}maven {url = uri("https://dl.bintray.com/kotlin/kotlin-dev")}}依赖项{...}}所有项目{储存库{mavenLocal()maven {url ='https://dl.bintray.com/korlibs/korlibs'}谷歌()jcenter()maven {url = uri("https://dl.bintray.com/kotlin/kotlin-dev")}}}
以及在build.gradle(应用程序)中:
依赖项{实现'com.android.support:multidex:1.0.3'实施'com.soywiz.korlibs.korge:korge-android:1.13.3'实现'com.soywiz.korlibs.klock:klock-android:1.11.12'实现'com.soywiz.korlibs.kmem:kmem-android:1.10.5'实施'com.soywiz.korlibs.kds:kds-android:1.10.12'实现'com.soywiz.korlibs.korma:korma-android:1.11.16'实施'com.soywiz.korlibs.korio:korio-android:1.11.7'实现'com.soywiz.korlibs.korim:korim-android:1.12.24'实现'com.soywiz.korlibs.korau:korau-android:1.11.9'实施'com.soywiz.korlibs.korgw:korgw-android:1.12.18'实现'com.soywiz.korlibs.krypto:krypto-android:1.11.1'实现'com.soywiz.korlibs.korinject:korinject-android:1.10.1'实施'com.soywiz.korlibs.klogger:klogger-android:1.10.1'}
找出build.gradle要求的最简单方法/最新方法是使用KorGE实际构建项目.
如果您下载此仓库: https://github.com/korlibs/korge-hello-world
然后执行:
./gradlew installAndroidDebug
这将创建一个名为 build/platforms/android
的文件夹,其中包含带有所有详细信息的 build.gradle
文件.
重要部分:
存储库{//...maven {url ='https://dl.bintray.com/korlibs/korlibs'}//...}依赖项{实现fileTree(dir:'libs',包括:['* .jar'])实施'org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.3.72'实现'com.android.support:multidex:1.0.3'实施'com.soywiz.korlibs.korge:korge-android:1.13.3'实现'com.soywiz.korlibs.klock:klock-android:1.11.12'实现'com.soywiz.korlibs.kmem:kmem-android:1.10.5'实施'com.soywiz.korlibs.kds:kds-android:1.10.12'实现'com.soywiz.korlibs.korma:korma-android:1.11.16'实施'com.soywiz.korlibs.korio:korio-android:1.11.7'实现'com.soywiz.korlibs.korim:korim-android:1.12.24'实现'com.soywiz.korlibs.korau:korau-android:1.11.9'实施'com.soywiz.korlibs.korgw:korgw-android:1.12.18'实现'com.soywiz.korlibs.krypto:krypto-android:1.11.1'实现'com.soywiz.korlibs.korinject:korinject-android:1.10.1'实施'com.soywiz.korlibs.klogger:klogger-android:1.10.1'实施'com.android.support:appcompat-v7:28.0.0'实现'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'}
将来所有依赖关系可能会发生变化,所以我的建议是触发Hello World android构建,以便您获取最新的 build.gradle
文件.
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:
UPDATEThanks 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'
}
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.
这篇关于Andorid Studio-KorGE插件-build.gradle的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!