我已将GDX项目导入到现有的Android App项目中,并且它们都可以单独构建。但是,当我尝试创建一个Intent以从原始应用程序中的另一个活动启动GDX活动时。在我添加GDX项目的依赖项并从该项目导入活动类后,我得到以下构建错误。
Warning:Dependency newRepo:android:1.0 on project app resolves to an APK archive which is not supported as a compilation dependency. File: C:\Users\Simon\Documents\workspace\newRepo\android\build\outputs\apk\android-release-unsigned.apk
...
Error:Execution failed for task ':app:prepareDebugDependencies'.
> Dependency Error. See console for details
我已阅读其他帖子,提到我需要更改gradle脚本以应用插件库而不是应用程序,但我找不到提及应用插件应用程序的行。
以下是两个相关的build.gradle文件。 build.grade(app)
apply plugin: 'com.android.application'
android {
signingConfigs {
config {
keyAlias 'debug'
keyPassword 'android'
storeFile file('./libs/Keys/LineTower_Debug.jks')
storePassword 'android'
}
}
compileSdkVersion 21
buildToolsVersion "21.1.2"
defaultConfig {
applicationId "com.towerfield"
minSdkVersion 15
targetSdkVersion 21
versionCode 1
versionName "1.0"
multiDexEnabled true //This is needed for Methods to be >64KB, which google play will do.
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
signingConfig signingConfigs.config
}
debug {
signingConfig signingConfigs.config
}
}
}
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
compile 'com.android.support:appcompat-v7:22.0.0'
compile 'com.google.android.gms:play-services:7.5.+'
compile project(':BaseGameUtils')
compile project(':android')
}
build.gradle(android)
apply plugin: 'com.android.application'
android {
signingConfigs {
config {
keyAlias 'debug'
keyPassword 'android'
storeFile file('./libs/Keys/LineTower_Debug.jks')
storePassword 'android'
}
}
compileSdkVersion 21
buildToolsVersion "21.1.2"
defaultConfig {
applicationId "com.towerfield"
minSdkVersion 15
targetSdkVersion 21
versionCode 1
versionName "1.0"
multiDexEnabled true //This is needed for Methods to be >64KB, which google play will do.
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
signingConfig signingConfigs.config
}
debug {
signingConfig signingConfigs.config
}
}
}
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
compile 'com.android.support:appcompat-v7:22.0.0'
compile 'com.google.android.gms:play-services:7.5.+'
compile project(':BaseGameUtils')
compile project(':android')
}
build.gradle(core)
apply plugin: "java"
sourceCompatibility = 1.6
[compileJava, compileTestJava]*.options*.encoding = 'UTF-8'
sourceSets.main.java.srcDirs = [ "src/" ]
eclipse.project {
name = appName + "-core"
}