gpt4 book ai didi

java - 除非您更新 Google Play 服务,否则 com.tools.fd.runtime.BootstrapApplication 不会运行

转载 作者:塔克拉玛干 更新时间:2023-11-02 20:25:55 27 4
gpt4 key购买 nike

我尝试制作一个按钮(在我的例子中是 ImageButton),它将在 Google map 上找到用户的位置。到目前为止,我已经这样做了,当我按下应用程序模拟器中的按钮时,显示; “除非您更新 Google Play 服务,否则 com.tools.fd.runtime.BootstrapApplication 将不会运行”。这是我的代码:

built.gradle

apply plugin: 'com.android.application'

android {
compileSdkVersion 23
buildToolsVersion "25.0.0"

defaultConfig {
applicationId "com.example.konarx.a11042016"
minSdkVersion 14
targetSdkVersion 23
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}

dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:23.4.0'
compile 'com.google.android.gms:play-services:9.8.0'
testCompile 'junit:junit:4.12'
compile 'com.google.android.gms:play-services-maps:9.8.0'
}

MapsActivity.class

package com.example.konarx.a11042016;

import android.os.Bundle;

import com.google.android.gms.maps.CameraUpdateFactory;
import com.google.android.gms.maps.GoogleMap;
import com.google.android.gms.maps.OnMapReadyCallback;
import com.google.android.gms.maps.SupportMapFragment;
import com.google.android.gms.maps.model.LatLng;
import com.google.android.gms.maps.model.MarkerOptions;

public class MapsActivity extends MainScreen implements OnMapReadyCallback {

private GoogleMap mMap;

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_maps);
SupportMapFragment mapFragment = (SupportMapFragment) getSupportFragmentManager()
.findFragmentById(R.id.map);
mapFragment.getMapAsync(this);
}

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

LatLng sydney = new LatLng(-34, 151);
mMap.addMarker(new MarkerOptions().position(sydney).title("Marker in Sydney"));
mMap.moveCamera(CameraUpdateFactory.newLatLng(sydney));
}
}

最佳答案

我刚刚遇到了同样的问题。

在你的build.gradle中,将play服务的版本降级到9.6.0

dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
compile 'com.android.support:appcompat-v7:25.0.0'
compile 'com.google.android.gms:play-services:9.6.0'
testCompile 'junit:junit:4.12'
}

关于java - 除非您更新 Google Play 服务,否则 com.tools.fd.runtime.BootstrapApplication 不会运行,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40429402/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com