2017-03-28 26 views
0

Here is screen of my app, this working before i upgrade some of gradle files version谷歌地圖是停止顯示升級後gradle這個版本

貝婁是我的艙單文件元數據

<meta-data 
     android:name="com.google.android.gms.version" 
     android:value="@integer/google_play_services_version" /> 
    <meta-data 
     android:name="com.google.android.maps.v2.API_KEY" 
     android:value="HERE IS MY API KEY" /> 

這裏是我的搖籃文件

compileSdkVersion 24 
buildToolsVersion "24.0.0" 


dependencies { 
compile fileTree(include: ['*.jar'], dir: 'libs') 
compile project(':DatePicker') 
compile project(':agendacalendarview') 
compile files('libs/acra-4.5.0.jar') 
compile project(':MaterialCalenderView') 
compile 'com.getbase:floatingactionbutton:1.10.1' 
compile 'com.sothree.slidinguppanel:library:3.3.0' 
compile 'com.getbase:floatingactionbutton:1.10.1' 
compile 'com.sothree.slidinguppanel:library:3.3.0' 
compile 'com.android.support:design:24.2.1' 
compile 'de.hdodenhof:circleimageview:2.0.0' 
compile 'com.android.support:cardview-v7:24.2.1' 
compile 'com.hbb20:ccp:1.4' 
compile 'com.github.scottyab:showhidepasswordedittext:0.8' 
compile 'com.vistrav:ask:2.4' 
compile 'com.nostra13.universalimageloader:universal-image-loader:1.9.5' 
compile 'com.android.volley:volley:1.0.0' 
compile 'org.apache.httpcomponents:httpcore:4.4.1' 
compile 'org.apache.httpcomponents:httpclient:4.5' 
compile 'org.apache.httpcomponents:httpmime:4.2.3' 

compile 'com.squareup.retrofit2:retrofit:2.0.2' 
compile 'com.squareup.retrofit2:converter-gson:2.0.2' 
compile 'com.squareup.okio:okio:1.7.0' 
compile 'com.squareup.okhttp3:okhttp:3.2.0' 
compile 'com.google.code.gson:gson:2.7' 
compile 'org.apmem.tools:layouts:[email protected]' 
compile 'com.google.firebase:firebase-messaging:10.0.1' 
compile 'com.android.support:support-v4:24.2.1' 
compile 'com.mani:ThinDownloadManager:1.2.4' 
compile 'com.jakewharton:butterknife:7.0.0' 
compile 'com.google.android.gms:play-services-maps:10.0.1' 
compile 'com.github.lzyzsd:circleprogress:[email protected]' 
compile 'com.squareup.okhttp3:logging-interceptor:3.2.0' 
compile 'com.tbuonomo:slidingpuzzleloading:1.0.1' 
testCompile 'junit:junit:4.12' 

}

應用插件: 'com.google.gms.google服務'

這裏是我的項目搖籃

dependencies { 
    classpath 'com.android.tools.build:gradle:2.2.3' 
    classpath 'com.google.gms:google-services:3.0.0' 
    classpath 'me.tatarka:gradle-retrolambda:3.1.0' 

    // NOTE: Do not place your application dependencies here; they belong 
    // in the individual module build.gradle files 
} 

我試圖從MAP API

升級所有最新的代碼,但它現在不工作。另外我用的Android Studio版本2.3

這裏是我的應用程序代碼只有MAP

公共類MapsActivity擴展FragmentActivity實現OnMapReadyCallback {

private GoogleMap mMap; 

@Override 
protected void onCreate(Bundle savedInstanceState) { 
    super.onCreate(savedInstanceState); 
    setContentView(R.layout.activity_maps); 
    // Obtain the SupportMapFragment and get notified when the map is ready to be used. 
    SupportMapFragment mapFragment = (SupportMapFragment) getSupportFragmentManager() 
      .findFragmentById(R.id.map); 
    mapFragment.getMapAsync(this); 
} 

@Override 
public void onMapReady(GoogleMap googleMap) { 
    mMap = googleMap; 

    // Add a marker in Sydney and move the camera 
    LatLng sydney = new LatLng(-34, 151); 
    mMap.addMarker(new MarkerOptions().position(sydney).title("Marker in Sydney")); 
    mMap.moveCamera(CameraUpdateFactory.newLatLng(sydney)); 
} 

}

XML的地圖查看

<fragment xmlns:android="http://schemas.android.com/apk/res/android" 
xmlns:map="http://schemas.android.com/apk/res-auto" 
xmlns:tools="http://schemas.android.com/tools" 
android:id="@+id/map" 
android:name="com.google.android.gms.maps.SupportMapFragment" 
android:layout_width="match_parent" 
android:layout_height="match_parent" 
tools:context="com.squincy.inhup.Activity.MapsActivity" /> 
+0

添加顯示地圖的代碼。 –

+0

我認爲你改變了你的電腦,對吧? –

+0

添加您的谷歌地圖代碼。 –

回答

0

嗨@ pmrajnai13你的谷歌地圖API密鑰缺失在你的AndroidManifest.xml文件中。添加該谷歌地圖API密鑰。

+0

您好@vinod我已經把我的原始代碼的關鍵。 – pmrajnai13