Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

com.android.tools.build:gradle:7.2.1 插件 导入问题 #103

Open
TianyaHelp opened this issue Jul 1, 2022 · 6 comments
Open

com.android.tools.build:gradle:7.2.1 插件 导入问题 #103

TianyaHelp opened this issue Jul 1, 2022 · 6 comments

Comments

@TianyaHelp
Copy link

TianyaHelp commented Jul 1, 2022

pluginManagement {
repositories {
gradlePluginPortal()
google()
jcenter()
mavenCentral()
maven { url 'https://repo1.maven.org/maven2/' }
maven { url 'https://storage.googleapis.com/r8-releases/raw' }
}

}
dependencyResolutionManagement {
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
repositories {
google()
jcenter()
mavenCentral()
maven { url 'https://repo1.maven.org/maven2/' }
maven { url 'https://storage.googleapis.com/r8-releases/raw' }
}

}

plugins {
id 'com.android.application' version '7.2.1' apply false
id 'com.android.library' version '7.2.1' apply false
//添加神策分析 android-gradle-plugin2 依赖
id 'com.sensorsdata.analytics.android' version 'android-gradle-plugin2:3.4.6' apply false

}

### 报以下错误

Build file 'D:\AAA\TESTCODE\test\build.gradle' line: 6

Plugin [id: 'com.sensorsdata.analytics.android', version: 'android-gradle-plugin2:3.4.6', apply: false] was not found in any of the following sources:

  • Try:

Run with --info or --debug option to get more log output.
Run with --scan to get full insights.

  • Exception is:
    org.gradle.api.plugins.UnknownPluginException: Plugin [id: 'com.sensorsdata.analytics.android', version: 'android-gradle-plugin2:3.4.6', apply: false] was not found in any of the following sources:
  • Gradle Core Plugins (plugin is not in 'org.gradle' namespace)
  • Plugin Repositories (could not resolve plugin artifact 'com.sensorsdata.analytics.android:com.sensorsdata.analytics.android.gradle.plugin:android-gradle-plugin2:3.4.6')
    Searched in the following repositories:
    Gradle Central Plugin Repository
    Google
    BintrayJCenter
    MavenRepo
    maven(https://repo1.maven.org/maven2/)
    maven2(https://storage.googleapis.com/r8-releases/raw)
    at org.gradle.plugin.use.internal.DefaultPluginRequestApplicator.resolveToFoundResult(DefaultPluginRequestApplicator.java:221)

修改后的代码 单元测试 也不行
test.zip

@TianyaHelp TianyaHelp changed the title gradle-7.2 以上插件导入问题 com.android.tools.build:gradle:7.2.1 插件 导入问题 Jul 1, 2022
@TianyaHelp
Copy link
Author

change

@dengshiwei
Copy link
Contributor

@TianyaHelp 你的问题解决了吗

@TianyaHelp
Copy link
Author

单元测试 无法使用 FAILURE: Build failed with an exception.

  • What went wrong:
    Execution failed for task ':app:transformClassesWithSensorsAnalyticsAutoTrackForAirmoreDebugAndroidTest'.

δ��⵽��� Android SDK����ο������ĵ���鼯�ɲ����Ƿ���ȷ��
https://manual.sensorsdata.cn/sa/latest/tech_sdk_client_android_basic-32506144.html
����رմ���ʾ������Ӳ������: disableCheckSdk=true

  • 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.

BUILD FAILED in 1m 14s

Deprecated Gradle features were used in this build, making it incompatible with Gradle 8.0.

You can use '--warning-mode all' to show the individual deprecation warnings and determine if they come from your own scripts or plugins.

See https://docs.gradle.org/7.5/userguide/command_line_interface.html#sec:command_line_warnings
206 actionable tasks: 30 executed, 176 up-to-date

@TianyaHelp
Copy link
Author

demo

@igilbert
Copy link

sensorsdata/sa-sdk-android-plugin2# 貌似目前不支持gradle.properties里配disableCheckSDK

@liuweiqiang2016
Copy link
Collaborator

插件 v4.0.0-beta 自持 DSL 集成,请升级插件到 v4.0.0-beta 检查是否还有该问题

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants