标签: google-play-services

如何区分 Google Fit Api 中手动添加的步数和传感器记录的步数

我在我的项目中使用 Google Fit Api 来获取用户的每日步数。但问题是,用户可以通过添加活动来手动输入步骤。当我检索每日步数时,Google Fit Api 还会返回手动添加的步数。有什么方法可以区分手动添加的步骤和传感器记录的步骤。

android google-play-services google-fit-sdk google-fit

1
推荐指数
1
解决办法
2846
查看次数

错误:无法访问 zzbgl。未找到 com.google.android.gms.internal.zzbgl 的类文件

我想在我的应用程序中显示地点的位置。

我收到无法访问 zzbgl的编译错误

这是我的 gradle 文件:

dependencies {
    implementation fileTree(dir: 'libs', include: ['*.jar'])
    //noinspection GradleCompatible
    implementation 'com.android.support:appcompat-v7:26.1.0'
    implementation 'com.android.support:support-v4:26.1.0'
    implementation 'com.android.support:design:26.1.0'
    implementation 'com.android.support.constraint:constraint-layout:1.1.3'
    implementation 'com.android.support:cardview-v7:26.1.0'
    implementation 'com.android.support:recyclerview-v7:26.1.0'
    implementation 'com.google.firebase:firebase-core:16.0.9'
    implementation 'com.google.firebase:firebase-messaging:18.0.0'
    implementation 'com.google.firebase:firebase-auth:17.0.0'
    implementation 'com.google.code.gson:gson:2.8.1'
    //noinspection UseOfBundledGooglePlayServices
    implementation 'com.google.android.gms:play-services:12.0.1'
    implementation 'com.google.android.gms:play-services-location:16.0.0'
    implementation 'com.android.volley:volley:1.1.0'
    implementation 'com.squareup.picasso:picasso:2.5.2'
    implementation 'de.hdodenhof:circleimageview:1.3.0'
    implementation 'com.google.maps.android:android-maps-utils:0.5'
    implementation 'com.whiteelephant:monthandyearpicker:1.3.0'
    implementation 'com.daimajia.slider:library:1.1.5@aar'
    implementation 'com.nineoldandroids:library:2.4.0'
    implementation 'com.tarun0.zxing-standalone:zxing-standalone:1.0.0'
    implementation 'com.edwardvanraak:MaterialBarcodeScanner:0.0.6-ALPHA'
    implementation "ru.tinkoff.scrollingpagerindicator:scrollingpagerindicator:1.0.6"
    testImplementation 'junit:junit:4.12'
    androidTestImplementation 'com.android.support.test:runner:1.0.2'
    androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
    implementation('com.crashlytics.sdk.android:crashlytics:2.10.1@aar') {
        transitive = true;
    }
}
apply plugin: 'com.google.gms.google-services' 
Run Code Online (Sandbox Code Playgroud)

它显示编译错误

错误:无法访问 …

android firebase google-play-services gmsmapview gmsplace

1
推荐指数
1
解决办法
4792
查看次数

附近连接 API:Android 12 无法通告和发现状态代码未知的设备(8037、8038、8039)

我正在开发一个使用附近连接 API 和基本 P2P 策略的应用程序。突然间,很奇怪的是,我无法在我的 Pixel 3a 上宣传和发现配备最新 Android 12 和 Play 服务的设备。OnFailureListeners抛出这些异常:

  • 用于发现:8037: unknown status code: 8037
  • 用于广告:8038: unknown status code: 8038

事实上,它们在文档和源代码中找不到。我还检查了谷歌的“剪刀石头布”官方示例,它抛出了相同的错误代码。

当然,我重新安装了应用程序并重新启动并更新了我的手机。编辑:我也恢复了出厂设置,但没有帮助。但当我使用 Android Flash Tool 降级到最新的 Android 11 后,它又开始工作了。此外,使用不同的手机在 Android 11、10 和 9 上一切仍然运行良好。

有什么想法导致这个问题吗?过去两周一直运行良好,今天停止运行。我相信它需要对源代码进行一些深入的调查(Xlythe,如果我可以寻求你的帮助,那就太好了)。

android google-play-services google-nearby google-nearby-connections

1
推荐指数
1
解决办法
1343
查看次数

无法加载Android谷歌地图V2

我已经在我的应用程序中实现了android谷歌地图V2,它在我测试的大多数设备(Galaxy Ace Plus,Galaxy 7inch Tab,Sony Xperia Z)上运行良好.但它不适用于HTC Desire.我已经交叉验证了该设备中安装的Google Play服务.我很乐意找到解决方案.以下是我的实施.

public class MainActivity extends FragmentActivity {

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);
        SupportMapFragment fragment = new SupportMapFragment();
        getSupportFragmentManager().beginTransaction()
                .add(android.R.id.content, fragment).commit();        
}
}
Run Code Online (Sandbox Code Playgroud)

下面是activity_main.xml

<?xml version="1.0" encoding="utf-8"?>
<fragment xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:map="http://schemas.android.com/apk/res-auto"
android:id="@+id/the_map"
android:name="com.google.android.gms.maps.SupportMapFragment"
android:layout_width="match_parent"
android:layout_height="match_parent"
map:cameraTilt="45"
map:cameraZoom="2" />
Run Code Online (Sandbox Code Playgroud)

这是清单文件.

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.raj.googlemapsv2test"
android:versionCode="1"
android:versionName="1.0" >

<permission
    android:name="com.raj.googlemapsv2test.permission.MAPS_RECEIVE"
    android:protectionLevel="signature" />

<uses-permission android:name="com.raj.googlemapsv2test.permission.MAPS_RECEIVE" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" …
Run Code Online (Sandbox Code Playgroud)

android google-maps google-play-services google-maps-android-api-2

0
推荐指数
1
解决办法
1288
查看次数

"common_google_play_services_install_title"错误

我正在尝试导出使用Google Play服务库的应用程序.但是有一个lint警告,即使我已经清理了项目,也会阻止我导出应用程序.但它在模拟器中运行良好.这是它显示的警告:

"common_google_play_services_install_title" is translated here but not found in default locale
Issue: Checks for translations that appear to be unused (no default language string)
Id: ExtraTranslation
If a string appears in a specific language translation file, but there is no corresponding string in the default locale, then this string is probably unused. (It's technically possible that your application is only intended to run in a specific locale, but it's still a good idea to provide a fallback.).
Note that …
Run Code Online (Sandbox Code Playgroud)

android google-play-services

0
推荐指数
1
解决办法
1919
查看次数

谷歌播放服务

我试图检查,google play services但它给出了错误.这是我的清单文件.

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.example.gmapapp"
    android:versionCode="1"
    android:versionName="1.0" >

    <uses-sdk
        android:minSdkVersion="8"
        android:targetSdkVersion="18" />

    <permission 
        android:name="com.example.gmapapp.permission.MAPS_RECEIVE"
        android:protectionLevel="signature"/>

    <uses-permission android:name="com.example.gmapapp.permission.MAPS_RECEIVE"/>
    <uses-permission android:name="android.permission.INTERNET"/>
    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
    <uses-permission
        android:name="com.google.android.providers.gsf.permission.READ_GSERVICES"/>
    <uses-feature 
        android:glEsVersion="0x00020000"
        android:required="true"/>
    <application
        android:allowBackup="true"
        android:icon="@drawable/ic_launcher"
        android:label="@string/app_name"
        android:theme="@style/AppTheme" >
        <activity
            android:name="com.example.gmapapp.MainActivity"
            android:label="@string/app_name" >
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />

                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>

        <meta-data 
            android:name="com.google.android.maps.v2.API_KEY"
            android:value="GOOGLE_API_KEY"/>

    </application>

</manifest>
Run Code Online (Sandbox Code Playgroud)

这是我的主要活动.

public class MainActivity extends Activity {

    private static final int GPS_ERRORDIALOG_REQUEST = 9001;
    GoogleMap mMap;
    @Override
    protected void onCreate(Bundle savedInstanceState) { …
Run Code Online (Sandbox Code Playgroud)

android google-maps android-manifest google-play-services

0
推荐指数
1
解决办法
2108
查看次数

Google Play服务GameHelper NPE createApiClientBuilder(此API不允许使用空选项)

自最新的Google Play服务和Android Studio更新(0.5.9)后,我发现了这个恼人的错误.当我使用GameHelper开始活动时,应用程序崩溃了.这些错误是我放弃制作应用程序的兴趣的原因.我从Googles GitHub页面获得了最新版本的GameHelper.

活动:

mmmHelper = new GameHelper(this, GameHelper.CLIENT_ALL);

GameHelper.GameHelperListener listener = new GameHelper.GameHelperListener() {
            @Override
            public void onSignInSucceeded() {
                // handle sign-in succeess
            }
            @Override
            public void onSignInFailed() {
                // handle sign-in failure (e.g. show Sign In button)
            }

        };
        mmmHelper.setup(listener);


        mGoogleApiClient = new GoogleApiClient.Builder(this)
                .addApi(Games.API)
                .build();
        mGoogleApiClient.connect();

        Log.d(TAG, "Starting setup.");
        mHelper.startSetup(new IabHelper.OnIabSetupFinishedListener() {
            public void onIabSetupFinished(IabResult result) {
                Log.d(TAG, "Setup finished.");

                if (!result.isSuccess()) {
                    // Oh noes, there was a problem.
                    Log.d(TAG, "Problem setting up In-app Billing: …
Run Code Online (Sandbox Code Playgroud)

crash android google-play-services

0
推荐指数
1
解决办法
2156
查看次数

具有Gradle不兼容性的Android Studio(Google Play服务问题)

我正在使用Android Studio 0.8.9开发Android应用程序.我正在使用Gradle来构建我的项目.

我想将google-play-services.jar文件包含到我的项目中以使用推送通知api.

我已将这些语句添加到我的gradle(应用程序层)文件中,如下所示:

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    compile files('libs/google-play-services.jar')
    compile files('libs/android-support-v4.jar')
    compile files('libs/gson-2.2.3.jar')
    compile files('libs/volley_23042014.jar')
    compile 'com.google.android.gms:play-services:5.2.08'
}
Run Code Online (Sandbox Code Playgroud)

但它永远不会奏效.我收到以下错误:

Multiple dex files define Lcom/google/ads/AdRequest$ErrorCode;
Run Code Online (Sandbox Code Playgroud)

我检查了很多网站(包括Stackoverflow.com).他们都没有为我工作.

我的最新版本Google Support Library,Google Support Repository,Google Play Services.

这是我的libs目录

lbs目录

我的SDK版本如下:

<uses-sdk
    android:minSdkVersion="14"
    android:targetSdkVersion="20" />
Run Code Online (Sandbox Code Playgroud)

我做错了什么?如果有人有任何想法,请告诉我.

android admob google-play-services android-studio android-gradle-plugin

0
推荐指数
1
解决办法
831
查看次数

在sdk manager/eclipse中没有google play服务库

我开发了两个应用程序.我想用ad-mob(谷歌广告服务)将它们两者货币化.我知道传统的广告暴徒已经结束,我们需要使用谷歌播放服务在我们的应用程序中包含广告.

问题是在sdk manager/extras文件夹中没有google play服务库.我正在使用adt捆绑eclipse ...我更新了构建工具和其他东西,但仍然无法找到它.

有人可以发布谷歌播放服务5.0 zip文件的链接.

我试图谷歌是我发现的4.xx没有广告服务.每一个帮助都会提前感谢.

eclipse sdk admob google-play-services

0
推荐指数
1
解决办法
7959
查看次数

android是google play服务需要的支持库v4吗?

我知道它之前被要求在这里,但是这是机器人工作室抱怨:

在此输入图像描述

我确信我没有在gradle构建中的任何地方引用支持库,但android studio抱怨它是谷歌播放服务所需要的.

编辑:

dependencies {
    compile project(':comgizmogadgetsappzproductivity')
    compile 'com.google.android.gms:play-services-ads:+'
    compile files('libs/Parse-1.3.8.jar')
    compile files('libs/crashlytics.jar')
}
Run Code Online (Sandbox Code Playgroud)

comgizmogadgetsappzproductivity没有依赖关系.

编辑2:

问题是我早先将支持库作为依赖项,但我删除了它,因为我不再需要它了.从构建错误中我可以看到它说"配置:app:_debugCompile"需要它.也许我需要从_debugCompile配置中手动删除支持库?"_debugCompile"是一个文件吗?我尝试在项目文件夹中使用find和grep搜索它,但没有找到任何内容.

android admob android-support-library google-play-services

0
推荐指数
1
解决办法
1636
查看次数