0

最近,我想对我的 android 应用程序实施 Flurry 分析但是,在我按照说明运行程序后,我遇到了如下所示的错误。

非常感谢您的帮助和感谢!

程序类型已经存在:com.flurry.android.Consent

Message{kind=ERROR, text=Program type already present: com.flurry.android.Consent, sources=[Unknown source file], tool name=Optional.of(D8)}

应用级 gradle 代码在这里:

apply plugin: 'com.android.application'

android {
    compileSdkVersion 26
    defaultConfig {
        applicationId "com.falcontech.falcontech"
        minSdkVersion 14
        targetSdkVersion 26
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
    }
    buildTypes {
        release {
            minifyEnabled true
            proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
        }
    }
}

dependencies
        {
            implementation fileTree(include: ['*.jar'], dir: 'libs')
            implementation 'com.android.support:appcompat-v7:26.1.0'
            implementation 'com.android.support.constraint:constraint-layout:1.0.2'
            //implementation 'com.google.android.gms:play-services-plus:15.0.0'
            //$
            testImplementation 'junit:junit:4.12'
            androidTestImplementation 'com.android.support.test:runner:1.0.1'
            androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1'
            implementation files('/Users/Frank/Desktop/Desktop/flurry_Android_sdk 2/Flurry-Analytics/flurryAnalytics_10.0.0.jar')
            implementation 'com.google.android.gms:play-services-analytics:15.0.0'
        }

应用程序级别的 gradle 在这里:

// Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {

    repositories {
        google()
        jcenter()
    }
    dependencies {

        classpath 'com.android.tools.build:gradle:3.1.1'
        // Add this line
        classpath 'com.google.gms:google-services:3.2.0'

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

allprojects {
    repositories {
        google()
        jcenter()
    }
}

task clean(type: Delete) {
    delete rootProject.buildDir
}
4

2 回答 2

1

您可以通过 aar 在主应用程序的 Gradle 配置文件中添加以下内容来集成:

repositories {
    jcenter()
  }

dependencies {
    // Required for Flurry Analytics integration
    compile 'com.flurry.android:analytics:10.0.0@aar'
}

删除您添加到 Manifest 文件和 jar 文件的权限,然后同步您的 gradle 文件。在您的应用程序类中,请确保包含以下内容:

import com.flurry.android.FlurryAgent;
import static android.util.Log.VERBOSE;
于 2018-04-24T19:18:48.703 回答
0

您可能在错误的 gradle 文件中列出了依赖项。它们应该与您的 jar 包含在发布的原始代码中的位置相同。

此外,您需要将 minSdkVersion 更新为 16,这是 10.0.0 中支持的最低版本。

于 2018-04-27T16:12:51.477 回答