나는 정말로 여기에서 붙어 있습니다. 그래서, 나는 이것을 tutorial 단계별로 따르지만, 여전히 작동하지 않습니다.gradle 및 Google지도 v2가 포함 된 Android Studio
내가 튜토리얼의 모든 단계를 수행하고 발견 한 general->module
에서 열린 run->edit
구성은 내가 GooglePlayServices
이 표시되지 않는 경우, 나는이 문제 겠지,하지만 새로운 모듈 (GooglePlayServices)하지 모듈, 그럴 수 없어 그것을 고치기 위해해야 할 일을 찾아라.
날 일찍 내가 같은 시도하지만,이 경우 모듈에 GooglePlayServices
(나는 실제로 내가 무슨 짓을했는지 기억이 안나요) 내가 cannot resolve symbol 'maps'
에 더 이상 문제가되지 않습니다,하지만 여전히 작동하지 않는 오류 Error inflating class fragment
를 발생
내 활동은 튜토리얼처럼 두 경우 build.gradle
에 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);
}
}
를 확장 :
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
}
}
및 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"/>
당신의 main.xml에 무엇입니까? –
main.xml에는 Google 설명서의 조각이 있지만 MapFragment 대신 SupportMapFragment가 있습니다. 게시 할 코드를 추가하십시오. – Naitro