# AgentWeb-master **Repository Path**: hszcxl/agent-web-master ## Basic Information - **Project Name**: AgentWeb-master - **Description**: Agent 官方的例子 2021年5月22日 https://github.com/Justson/AgentWeb。 将官方的demo转为Androidx版本的。使用的版本为:com.github.Justson.AgentWeb:agentweb-core:v4.1.9-androidx - **Primary Language**: Android - **License**: Apache-2.0 - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 1 - **Forks**: 1 - **Created**: 2021-05-22 - **Last Updated**: 2023-10-18 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README ## AgentWeb 介绍 Agent 官方的例子 2021年5月22日 https://github.com/Justson/AgentWeb。 将官网的demo转为Androidx版本的。使用的版本为:com.github.Justson.AgentWeb:agentweb-core:v4.1.9-androidx ## support项目迁移到Androidx 遇到的问题 android.useAndroidX=true:表示当前项目启用 AndroidX android.enableJetifier=true :表示将依赖包也迁移到AndroidX。由support迁移到Androidx的项目可能需要这个配置,如果没有,可能会报以下的错误: ``` Execution failed for task ':sample:checkDebugDuplicateClasses'. > A failure occurred while executing com.android.build.gradle.internal.tasks.CheckDuplicatesRunnable > Duplicate class android.support.v4.app.INotificationSideChannel found in modules core-1.3.1-runtime (androidx.core:core:1.3.1) and support-compat-26.1.0-runtime (com.android.support:support-compat:26.1.0) Duplicate class android.support.v4.app.INotificationSideChannel$Stub found in modules core-1.3.1-runtime (androidx.core:core:1.3.1) and support-compat-26.1.0-runtime (com.android.support:support-compat:26.1.0) Duplicate class android.support.v4.app.INotificationSideChannel$Stub$Proxy found in modules core-1.3.1-runtime (androidx.core:core:1.3.1) and support-compat-26.1.0-runtime (com.android.support:support-compat:26.1.0) Duplicate class android.support.v4.os.IResultReceiver found in modules core-1.3.1-runtime (androidx.core:core:1.3.1) and support-compat-26.1.0-runtime (com.android.support:support-compat:26.1.0) Duplicate class android.support.v4.os.IResultReceiver$Stub found in modules core-1.3.1-runtime (androidx.core:core:1.3.1) and support-compat-26.1.0-runtime (com.android.support:support-compat:26.1.0) Duplicate class android.support.v4.os.IResultReceiver$Stub$Proxy found in modules core-1.3.1-runtime (androidx.core:core:1.3.1) and support-compat-26.1.0-runtime (com.android.support:support-compat:26.1.0) Duplicate class android.support.v4.os.ResultReceiver found in modules core-1.3.1-runtime (androidx.core:core:1.3.1) and support-compat-26.1.0-runtime (com.android.support:support-compat:26.1.0) Duplicate class android.support.v4.os.ResultReceiver$1 found in modules core-1.3.1-runtime (androidx.core:core:1.3.1) and support-compat-26.1.0-runtime (com.android.support:support-compat:26.1.0) Duplicate class android.support.v4.os.ResultReceiver$MyResultReceiver found in modules core-1.3.1-runtime (androidx.core:core:1.3.1) and support-compat-26.1.0-runtime (com.android.support:support-compat:26.1.0) Duplicate class android.support.v4.os.ResultReceiver$MyRunnable found in modules core-1.3.1-runtime (androidx.core:core:1.3.1) and support-compat-26.1.0-runtime (com.android.support:support-compat:26.1.0) * Try: Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights. ``` ## gradle.properties 可以在这个文件中声明一些变量,在build.gradle中使用。例如: gradle.properties文件中的内容: ``` org.gradle.jvmargs=-Xmx1536m android.useAndroidX=true android.enableJetifier=true //以下三行在build.gradle文件中使用 COMPILE_SDK_VERSION=30 MIN_SDK_VERSION=21 BUILD_TOOL_VERSION=30.0.3 ``` build.gradle ``` android { compileSdkVersion COMPILE_SDK_VERSION.toInteger() buildToolsVersion BUILD_TOOL_VERSION defaultConfig { applicationId "com.just.agentweb.sample" minSdkVersion MIN_SDK_VERSION targetSdkVersion COMPILE_SDK_VERSION versionCode 4 versionName "4.1.9" } ..... } ```