2017-02-16 6 views
1

Ich möchte GooglePlayServices zu einem bereits vorhandenen Projekt hinzufügen (Libgdx). Aber ich habe ein Problem, nachdem ich sie zur build.gradle Datei hinzugefügt habe, erscheinen sie nicht. Ich habe GooglePlayServices bereits mit dem SDK-Manager installiert. Was habe ich falsch gemacht ..?Android Studio - Keine Option zum Hinzufügen von Abhängigkeiten?

Wenn ich Struktur unter der Registerkarte Abhängigkeiten zum Projekt gibt es nur drei verschiedene Möglichkeiten:

  1. hinzufügen Jar oder Ordner (selfexplained)

  2. Bibliothek hinzufügen

  3. Modulabhängigkeiten hinzufügen (Wenn ich darauf klicke, kann ich mein Haupt- oder Kernmodul als Abhängigkeiten hinzufügen. Keine anderen Optionen)

Heres ein Bild von meinem Projektbaum:

ProjectTree

Heres ein Bild von meiner Projektstruktur:

Project Structure

Der einzige Dependencie i importieren kann, ist das Modul ein ... Das ist seltsam.

ModuleDependencie

Und heres, was meine ganze build.gradle (poste ich alles, weil ich wheres der Fehler Teil völlig keine Ahnung haben) ich die Linien markiert, die ich für GooglePlayService hinzugefügt:

buildscript { 
repositories { 
    mavenLocal() 
    mavenCentral() 
    maven { url "https://oss.sonatype.org/content/repositories/snapshots/" } 
    jcenter() 
} 
dependencies { 
    classpath 'com.android.tools.build:gradle:1.5.0' 
} 
} 

allprojects { 
apply plugin: "eclipse" 
apply plugin: "idea" 

version = '1.0' 
ext { 
    appName = "ParallelOrigin" 
    gdxVersion = '1.9.5' 
    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(":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 "com.badlogicgames.gdx:gdx-controllers:$gdxVersion" 
    compile "com.badlogicgames.gdx:gdx-controllers-android:$gdxVersion" 
    compile "com.badlogicgames.gdx:gdx-ai:$aiVersion" 
    compile "com.badlogicgames.gdx:gdx-freetype:$gdxVersion" 
    natives "com.badlogicgames.gdx:gdx-freetype-platform:$gdxVersion:natives-armeabi" 
    natives "com.badlogicgames.gdx:gdx-freetype-platform:$gdxVersion:natives-armeabi-v7a" 
    natives "com.badlogicgames.gdx:gdx-freetype-platform:$gdxVersion:natives-arm64-v8a" 
    natives "com.badlogicgames.gdx:gdx-freetype-platform:$gdxVersion:natives-x86" 
    natives "com.badlogicgames.gdx:gdx-freetype-platform:$gdxVersion:natives-x86_64" 
    compile "com.badlogicgames.ashley:ashley:$ashleyVersion" 
    compile "com.badlogicgames.box2dlights:box2dlights:$box2DLightsVersion" 
    compile "com.badlogicgames.gdx:gdx-bullet:$gdxVersion" 
    natives "com.badlogicgames.gdx:gdx-bullet-platform:$gdxVersion:natives-armeabi" 
    natives "com.badlogicgames.gdx:gdx-bullet-platform:$gdxVersion:natives-armeabi-v7a" 
    natives "com.badlogicgames.gdx:gdx-bullet-platform:$gdxVersion:natives-arm64-v8a" 
    natives "com.badlogicgames.gdx:gdx-bullet-platform:$gdxVersion:natives-x86" 
    natives "com.badlogicgames.gdx:gdx-bullet-platform:$gdxVersion:natives-x86_64" 
    compile "de.tomgrill.gdxdialogs:gdx-dialogs-android:1.2.0" 


    //----------------------------------------------------------------------------// 
    //--------------------------Added by myself-----------------------------------// 
    //----------------------------------------------------------------------------// 


    compile "com.android.support:support-core-utils:23.2.1" 
    compile 'com.android.support:appcompat-v7:25.1.1' 
    compile 'com.google.android.gms:play-services:10.0.1' 
} 
} 

project(":core") { 
apply plugin: "java" 


dependencies { 
    compile "com.badlogicgames.gdx:gdx:$gdxVersion" 
    compile "com.badlogicgames.gdx:gdx-box2d:$gdxVersion" 
    compile "com.badlogicgames.gdx:gdx-controllers:$gdxVersion" 
    compile "com.badlogicgames.gdx:gdx-ai:$aiVersion" 
    compile "com.badlogicgames.gdx:gdx-freetype:$gdxVersion" 
    compile "com.badlogicgames.ashley:ashley:$ashleyVersion" 
    compile "com.badlogicgames.box2dlights:box2dlights:$box2DLightsVersion" 
    compile "com.badlogicgames.gdx:gdx-bullet:$gdxVersion" 
    compile "com.underwaterapps.overlap2druntime:overlap2d-runtime-libgdx:0.1.0" 
    compile "net.dermetfan.libgdx-utils:libgdx-utils:0.13.4" 
    compile "net.dermetfan.libgdx-utils:libgdx-utils-box2d:0.13.4" 
    compile "de.tomgrill.gdxdialogs:gdx-dialogs-core:1.2.0" 

    //----------------------------------------------------------------------------// 
    //--------------------------Added by myself-----------------------------------// 
    //----------------------------------------------------------------------------// 

    compile "com.android.support:support-core-utils:23.2.1" 
    compile 'com.android.support:appcompat-v7:25.1.1' 
    compile 'com.google.android.gms:play-services:10.0.1' 
} 
} 

tasks.eclipse.doLast { 
delete ".project" 
} 

Danke für deine Hilfe und deine Zeit!

+0

sieht so aus, dass Sie es bereits hinzugefügt haben, versuchen Sie, Ihr Projekt erneut zu synchronisieren? – king

+0

@king schon getan, ich habe auch meinen PC neu gestartet. Diese GooglePlayService-Abhängigkeiten werden jedoch nicht angezeigt. Keine Abhängigkeiten, nur meine 2 Ordner (Android und Core) ... Ich habe dieses Projekt über den libgdx Generator erstellt. Es ist irgendwie komisch, ich habe das Android Studio-Projekt und das libgdx-Projekt verglichen. Das Android Studio hat viele andere Möglichkeiten. Dort kann ich auch Abhängigkeiten ohne irgendwelche Isses hinzufügen. – genaray

+0

Art von albern, aber versuchen, Kassen aus Dateimenü ungültig zu machen –

Antwort

0

Ich fand die Iusse!

Das ist nur passiert, weil mein Projekt nicht groß war. Ich musste es nur migrieren und dann konnte ich diese Maven-Abhängigkeiten importieren!

Verwandte Themen