Android Studio 3.X 更新并与 AChartEngine 失去连接(找不到符号 class ChartFactory)
Android Studio 3.X update and lost connection with AChartEngine (can't find symbol class ChartFactory)
我在我的项目中使用 AChartEngine 并通过
在 build.gradle 中连接它
allprojects {
repositories {
jcenter()
maven {
url = "https://repository-achartengine.forge.cloudbees.com/snapshot/"
}
}
}
更新 Android Studio 和 Gradle\Building 机制后,我无法 build\make 一个项目出现类似的错误集,例如 -
Error:(53, 24) error: cannot find symbol class ChartFactory
对于每个 java class,我在其中执行 "import org.achartengine.ChartFactory"
我试过添加 "compile group: 'org.achartengine', name: 'achartengine', version: '1.2.0'"
我试过 Invalidate caches\Restart 和 Clean\Rebuild project,
我已经更改了标记 Maven 中的语法并在 url 之后添加了符号 "="。
它仍然不起作用。
Gradle 3.X 或 4.X 看不到包含以下方式的库:
行家{
url = "https://repository-achartengine.forge.cloudbees.com/snapshot/"
请帮我解决这个问题。
我解决了一个问题。感谢@YaronRecher 提供关于缺少对地址的真正 Maven 依赖的提示 - https://repository-achartengine.forge.cloudbees.com/snapshot/
每次 Studio \ Gradle Engine 更新后,您的项目都会重复从 Maven 存储库导入。因此,如果您正在使用 AChartEngine 并将 Android Studio 更新为 3.X,您的项目将不会在“https://repository-achartengine.forge.cloudbees.com/snapshot/”
上找到任何内容
解决方法:
1) 从 https://github.com/ddanny/achartengine/files/460139/achartengine-1.2.0.zip 中获取 JAR 并将其放入项目中的文件夹 "app/lib" 中;
2) 通过 "File-Project Scructure" 在 Studio 中添加 jar,在 - 菜单 Modules-app 和依赖项之后(按钮 "plus")
3) 删除项目中的真实文件夹 .gradle 并在使用清理和重建后(在 "Build" 菜单中)
4) 查看你的 build.gladle 文件 (Module:App) 并确保你有:
dependencies {
compile 'com.android.support.constraint:constraint-layout:1.0.0-alpha2'
implementation files('libs/achartengine-1.2.0.jar')
}
和
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
...
testCompile 'junit:junit:4.12'
}
尽情享受吧!
我在我的项目中使用 AChartEngine 并通过
在 build.gradle 中连接它allprojects {
repositories {
jcenter()
maven {
url = "https://repository-achartengine.forge.cloudbees.com/snapshot/"
}
}
}
更新 Android Studio 和 Gradle\Building 机制后,我无法 build\make 一个项目出现类似的错误集,例如 -
Error:(53, 24) error: cannot find symbol class ChartFactory
对于每个 java class,我在其中执行 "import org.achartengine.ChartFactory"
我试过添加 "compile group: 'org.achartengine', name: 'achartengine', version: '1.2.0'" 我试过 Invalidate caches\Restart 和 Clean\Rebuild project, 我已经更改了标记 Maven 中的语法并在 url 之后添加了符号 "="。 它仍然不起作用。
Gradle 3.X 或 4.X 看不到包含以下方式的库: 行家{ url = "https://repository-achartengine.forge.cloudbees.com/snapshot/"
请帮我解决这个问题。
我解决了一个问题。感谢@YaronRecher 提供关于缺少对地址的真正 Maven 依赖的提示 - https://repository-achartengine.forge.cloudbees.com/snapshot/
每次 Studio \ Gradle Engine 更新后,您的项目都会重复从 Maven 存储库导入。因此,如果您正在使用 AChartEngine 并将 Android Studio 更新为 3.X,您的项目将不会在“https://repository-achartengine.forge.cloudbees.com/snapshot/”
上找到任何内容解决方法: 1) 从 https://github.com/ddanny/achartengine/files/460139/achartengine-1.2.0.zip 中获取 JAR 并将其放入项目中的文件夹 "app/lib" 中; 2) 通过 "File-Project Scructure" 在 Studio 中添加 jar,在 - 菜单 Modules-app 和依赖项之后(按钮 "plus") 3) 删除项目中的真实文件夹 .gradle 并在使用清理和重建后(在 "Build" 菜单中) 4) 查看你的 build.gladle 文件 (Module:App) 并确保你有:
dependencies {
compile 'com.android.support.constraint:constraint-layout:1.0.0-alpha2'
implementation files('libs/achartengine-1.2.0.jar')
}
和
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
...
testCompile 'junit:junit:4.12'
}
尽情享受吧!