【问题标题】:com.tools.fd.runtime.BootstrapApplication won't run unless you update Google Play servicescom.tools.fd.runtime.BootstrapApplication 不会运行,除非您更新 Google Play 服务
【发布时间】:2017-03-18 16:25:58
【问题描述】:

我尝试制作一个按钮(在我的例子中是 ImageButton),它可以在 Google 地图上发现用户的位置。到目前为止,我已经这样做了,当我按下应用程序模拟器中的按钮时; “除非您更新 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));
}
}

【问题讨论】:

  • compilesdk 25 and targetsdk 25 ...试试这个

标签: java android google-maps google-maps-api-3


【解决方案1】:

当这发生在我身上时,我正在使用 Nougat (API 25)。使用不同的 API 包(我最终在新模拟器上使用 Marshmallow API 23)为我修复了它。我在我的项目中使用的是播放服务版本 10.0.1,由于 Firebase 需要 10.0.1,因此无法降级我的播放服务版本。

【讨论】:

    【解决方案2】:

    我刚遇到同样的问题。

    在你的 build.gradle 中,将 play services 的版本降级到 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'
    }
    

    【讨论】:

    • 在我进行更改后同步时,我尝试过并收到错误消息(红色下划线)。感谢您的回答...
    猜你喜欢
    • 2017-08-06
    • 2017-11-24
    • 1970-01-01
    • 2013-09-23
    • 1970-01-01
    • 1970-01-01
    • 2013-10-21
    • 2017-12-08
    相关资源
    最近更新 更多