Ich bin wirklich hier fest. Also folge ich Schritt für Schritt dieser tutorial: aber es funktioniert immer noch nicht.Android Studio mit Gradle und Google Maps v2
ich alle Schritte von der Tutorial getan haben und herausfinden, was neues Modul (GooglePlayServices) nicht in Module, wenn offene run->edit
Konfigurationen in general->module
i, nicht GooglePlayServices
sehe ich nehme an, das ist das Problem, aber ich kann nicht finde, was ich tun muss, um es zu reparieren.
Tag früh versuchte ich gleich, aber in diesem Fall (ich erinnere mich wirklich nicht, was ich tue) GooglePlayServices
in Module und ich habe nicht mehr Problem mit cannot resolve symbol 'maps'
, aber es immer noch nicht funktioniert, löst Fehler Error inflating class fragment
meine Tätigkeit erstreckt FragmentActivity
import android.os.Bundle;
import android.support.v4.app.FragmentActivity;
public class MainActivity extends FragmentActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
}
}
in beiden Fällen build.gradle
wie in Tutorial:
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:0.4'
}
}
apply plugin: 'android'
dependencies {
compile files('libs/android-support-v4.jar')
compile project(':GooglePlayServices')
}
android {
compileSdkVersion 17
buildToolsVersion "17.0.0"
defaultConfig {
minSdkVersion 9
targetSdkVersion 17
}
}
und settings.gradle
:
include ':Roadatus', ':GooglePlayServices'
main.xml:
<?xml version="1.0" encoding="utf-8"?>
<fragment xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/map"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:name="com.google.android.gms.maps.SupportMapFragment"/>
Was ist Ihr main.xml? –
In main.xml habe ich Fragment von Google-Dokumentation, aber SupportMapFragment anstelle von MapFragment. Fügen Sie Code zum Posten hinzu. – Naitro