Naprawdę utknąłem tutaj. Tak więc postępuję zgodnie z tym tutorial krok po kroku: ale nadal nie działa.Android Studio ze gradle i Google Maps v2
Zrobiłem wszystkie kroki z poradnika i dowiedzieć się, co nowego modułu (GooglePlayServices) nie w modułach, jeśli otwarte run->edit
konfiguracje w general->module
nie widzę GooglePlayServices
, jak sądzę jest to problem, ale nie mogę znajdź to, co muszę zrobić, aby to naprawić.
Dzień wcześnie Próbowałem sam, ale w tym przypadku (I rzeczywiście nie pamiętam co zrobiłem) GooglePlayServices
w modułach, a ja już nie mam problemu z cannot resolve symbol 'maps'
, ale to nadal nie działa, odpala błąd Error inflating class fragment
moja aktywność rozciąga 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);
}
}
zarówno w przypadku build.gradle
podobnie jak w tutorialu:
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
}
}
i 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"/>
Jaki jest Twój main.xml? –
W pliku main.xml mam fragment z dokumentacji google, ale SupportMapFragment zamiast MapFragment. Dodaj kod do opublikowania. – Naitro