简体   繁体   English

com.google.android.gms.measurement.AppMeasurementContentProvider.onCreate(未知来源)

[英]com.google.android.gms.measurement.AppMeasurementContentProvider.onCreate(Unknown Source)

I had to enable MultiDex in my Android App, it appears to be working in all SDK except the ones related to 4.4 and 4.2 which unfortunately are the most popular Android versions for my app at the moment. 我必须在我的Android应用程序中启用MultiDex,它似乎可以在所有SDK中使用,但与4.4和4.2相关的那些除外,不幸的是,这是我的应用程序当前最受欢迎的Android版本。

Here is the crash report in Play Dev Console 这是Play Dev Console中的当机报告

java.lang.VerifyError: com/google/android/gms/measurement/internal/zzw
at com.google.android.gms.measurement.AppMeasurementContentProvider.onCreate(Unknown Source)
at android.content.ContentProvider.attachInfo(ContentProvider.java:1058)
at android.app.ActivityThread.installProvider(ActivityThread.java:5022)
at android.app.ActivityThread.installContentProviders(ActivityThread.java:4607)
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4547)
at android.app.ActivityThread.access$1300(ActivityThread.java:156)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1400)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:153)
at android.app.ActivityThread.main(ActivityThread.java:5293)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:511)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:833)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:600)
at dalvik.system.NativeStart.main(Native Method)

Here is the Gradle 这是摇篮

apply plugin: 'com.android.application'

android {

dexOptions {
    javaMaxHeapSize "4g"
}

signingConfigs {
    release {
        keyAlias 'XXXXX'
        keyPassword 'XXXXXX'
        storeFile file('C:/XXXXXXX')
        storePassword 'XXXXXXX'
    }
}
compileSdkVersion 23
buildToolsVersion "23.0.2"
useLibrary 'org.apache.http.legacy'
defaultConfig {
    applicationId "net.digitalageservices.minecraftyourself"
    minSdkVersion 16
    targetSdkVersion 23
    versionCode 42
    versionName "4.7.1"
    multiDexEnabled true
}
buildTypes {
    release {
        minifyEnabled false
        proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        signingConfig signingConfigs.release
        shrinkResources true
    }
}
}

dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
compile files('libs/apache-commons-httpmime.jar')
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:23.0.0'
//compile 'com.google.android.gms:play-services-ads:8.4.0'
compile 'com.google.android.gms:play-services:8.4.0'
compile 'com.google.code.gson:gson:2.2.4'
compile 'com.mcxiaoke.volley:library:1.0.19'
compile 'com.github.bumptech.glide:glide:3.7.0'
//  compile 'com.android.support:multidex:1.0.1'
compile files('libs/easyandroidanimationslibrary-v0.5.jar')
compile ('com.adincube.sdk:AdinCube-Java-3fff:1.+@aar') {
    transitive = true
}
}

repositories {
maven {
    url 'http://repository.adincube.com/maven'
}
}

Here is the Manifest 这是清单

<?xml version="1.0" encoding="utf-8" ?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="net.digitalageservices.minecraftyourself">

<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="com.android.vending.BILLING" />
<uses-permission android:name="com.android.vending.READ_CONTACTS" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />


<!-- To access accounts configured on device -->
<uses-permission android:name="android.permission.GET_ACCOUNTS" />
<!-- To use account credentials -->
<uses-permission android:name="android.permission.USE_CREDENTIALS" />

<application
    android:allowBackup="true"
    android:icon="@mipmap/ic_launcher"
    android:label="@string/app_name"
    android:supportsRtl="true"
    android:name=".app.MyApplication">
    android:largeHeap="true"
    android:theme="@style/AppTheme">
    <!--This meta-data tag is required to use Google Play Services.-->
    <meta-data
        android:name="com.google.android.gms.version"
        android:value="@integer/google_play_services_version" />

    <activity android:name="com.chartboost.sdk.CBImpressionActivity"
        android:excludeFromRecents="true"
        android:hardwareAccelerated="true"
        android:theme="@android:style/Theme.Translucent.NoTitleBar.Fullscreen"
        android:configChanges="keyboardHidden|orientation|screenSize" />

    <activity
        android:name=".LoginPage"
        android:label="@string/app_name"
        android:screenOrientation="portrait">
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />
            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
    </activity>
    <activity
        android:name=".MineCraftActivit_"
        android:label="@string/app_name"
        android:screenOrientation="portrait">
        <!--<intent-filter>-->
            <!--<action android:name="android.intent.action.MAIN" />-->
            <!--<category android:name="android.intent.category.LAUNCHER" />-->
        <!--</intent-filter>-->
    </activity>
    <activity
        android:name=".StartActivity"
        android:label="@string/app_name"
        android:screenOrientation="portrait">

    </activity>

    <activity
        android:name=".SplashActivity"
        android:label="@string/app_name"
        android:screenOrientation="portrait"
        android:theme="@android:style/Theme.Translucent.NoTitleBar"/>

    <activity
        android:name=".MainActivity"
        android:label="@string/app_name"
        android:screenOrientation="portrait"/>

    <activity
        android:name=".AboutUsPage"
        android:label="@string/app_name"
        android:screenOrientation="portrait"/>
    <activity
        android:name=".ListImageActivity"
        android:label="@string/app_name"
        android:screenOrientation="portrait"/>
    <activity
        android:name=".ViewPagerActivity"
        android:label="@string/app_name"
        android:screenOrientation="portrait"/>
  <activity
        android:name=".NewsActivity"
        android:label="@string/app_name"
        android:screenOrientation="portrait"/>

    <!--Include the AdActivity configChanges and theme. -->
    <activity
        android:name="com.google.android.gms.ads.AdActivity"
        android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|uiMode|screenSize|smallestScreenSize"
        android:theme="@android:style/Theme.Translucent" />

    <!--
     Optionally, register AnalyticsReceiver and AnalyticsService to support background
     dispatching on non-Google Play devices
   -->
    <receiver
        android:name="com.google.android.gms.analytics.AnalyticsReceiver"
        android:enabled="true">
        <intent-filter>
            <action android:name="com.google.android.gms.analytics.ANALYTICS_DISPATCH" />
        </intent-filter>
    </receiver>

    <service
        android:name="com.google.android.gms.analytics.AnalyticsService"
        android:enabled="true"
        android:exported="false" />

    <!--
         Optionally, register CampaignTrackingReceiver and CampaignTrackingService to enable
         installation campaign reporting
    -->
    <receiver
        android:name="com.google.android.gms.analytics.CampaignTrackingReceiver"
        android:exported="true">
        <intent-filter>
            <action android:name="com.android.vending.INSTALL_REFERRER" />
        </intent-filter>
    </receiver>

    <service android:name="com.google.android.gms.analytics.CampaignTrackingService" />

    <activity android:name="com.purplebrain.adbuddiz.sdk.AdBuddizActivity"
        android:theme="@android:style/Theme.Translucent" />
</application>

I know I need to do something in the Manifest, Activity with extends or something, and Gradle, but everything I have tried is failing or only partially works. 我知道我需要在清单中做一些事情,在带有扩展的活动中做些什么,然后在Gradle中做些什么,但是我尝试过的一切都失败了或者只能部分起作用。 I just don't know where or how to properly fix it. 我只是不知道在哪里或如何正确修复它。

Turn MultiDex off and read below :) 关闭MultiDex,然后阅读以下内容:)

here is your problem: 这是你的问题:

compile 'com.google.android.gms:play-services:8.4.0'

play services are very huge lib that contains tons of child libs remove this line and go and read here and add ONLY libraries that you use. 播放服务非常庞大,其中包含大量子lib,请删除此行,然后在此处阅读并仅添加您使用的库。 99% guarantee will be no need to use MultiDex :) 99%的保证将不需要使用MultiDex :)

for example if you use only maps then compile only: 例如,如果仅使用地图,则仅编译:

compile 'com.google.android.gms:play-services-maps:8.4.0'

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 无法获得提供商com.google.android.gms.measurement.AppMeasurementContentProvider - Unable to get provider com.google.android.gms.measurement.AppMeasurementContentProvider 未知源文件:com.android.dex.DexException:多个dex文件定义了Lcom / google / android / gms / internal / zzpq; - Unknown source file : com.android.dex.DexException: Multiple dex files define Lcom/google/android/gms/internal/zzpq; 元件 <com.google.android.gms.ads.AdView> 未知 - element <com.google.android.gms.ads.AdView> is unknown 无法解决以下问题:位于com.google.firebase.storage.FirebaseStorage.getInstance的Lcom / google / android / gms / common / internal / zzbq;(未知来源) - Failed resolution of: Lcom/google/android/gms/common/internal/zzbq;at com.google.firebase.storage.FirebaseStorage.getInstance(Unknown Source) 由java.lang.ClassNotFoundException引起找不到类“ com.google.android.gms.measurement.AppMeasurementInstallReferrerReceiver - Caused by java.lang.ClassNotFoundException Didn't find class "com.google.android.gms.measurement.AppMeasurementInstallReferrerReceiver 已存在的程序类型:com.google.android.gms.internal.measurement.zzea - Program type already present: com.google.android.gms.internal.measurement.zzea 编译未能完成:程序类型已存在:com.google.android.gms.internal.measurement.zzabn - Compilation failed to complete:Program type already present: com.google.android.gms.internal.measurement.zzabn 某些设备出错 - 无法找到“com.google.android.gms.measurement.internal.zzz”类 - Error on some devices - couldn't find class 'com.google.android.gms.measurement.internal.zzz' 无法从我的Android应用com.google.android.gms.auth.GoogleAuthException上传到Google驱动器:未知 - cannot upload to google drive from my android app com.google.android.gms.auth.GoogleAuthException: Unknown java.lang.ClassNotFoundException:在路径上找不到类“com.google.android.gms.measurement.AppMeasurementJobService”:DexPathList - java.lang.ClassNotFoundException: Didn't find class "com.google.android.gms.measurement.AppMeasurementJobService" on path: DexPathList
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM