Search code examples
javaandroiddependenciesachartengine

Android Studio 3.X update and lost connection with AChartEngine (can't find symbol class ChartFactory)


I'm using AChartEngine in my project and connected it in build.gradle via

allprojects {
    repositories {
        jcenter()
        maven {
            url = "https://repository-achartengine.forge.cloudbees.com/snapshot/"
        }
    }
}

After update Android Studio and Gradle\Building mechanisms i can't build\make a project with set of similar errors like -

Error:(53, 24) error: cannot find symbol class ChartFactory

for every java class, where i do the "import org.achartengine.ChartFactory"

I have tryed add "compile group: 'org.achartengine', name: 'achartengine', version: '1.2.0'" I have tryed Invalidate caches\Restart and Clean\Rebuild project, i have changed syntax in tag maven and add symbol "=" after url. It doesn't work still.

Gradle 3.X or 4.X do not see including of libs in way of: maven { url = "https://repository-achartengine.forge.cloudbees.com/snapshot/"

Please help me with that issue.


Solution

  • I have solved a problem. Thanks to @YaronRecher for hint about missing a real maven dependency on adress - https://repository-achartengine.forge.cloudbees.com/snapshot/

    After every Studio \ Gradle Engine update your project do repeat its import from Maven repository. So if you're using AChartEngine and have updated Android Studio to 3.X your project wouldn't find anything on "https://repository-achartengine.forge.cloudbees.com/snapshot/"

    Solution: 1) take JAR from https://github.com/ddanny/achartengine/files/460139/achartengine-1.2.0.zip and put in folder "app/lib" in your project; 2) Add jar in Studio via "File-Project Scructure", after - menu Modules-app and dependencies (button "plus") 3) Delete real folder .gradle in project and after use Clean and Rebuild (in "Build" Menu) 4) Look your build.gladle file (Module:App) and make sure that you have:

    dependencies {
        compile 'com.android.support.constraint:constraint-layout:1.0.0-alpha2'
        implementation files('libs/achartengine-1.2.0.jar')
    }
    

    and

    dependencies {
            implementation fileTree(dir: 'libs', include: ['*.jar'])
    ...
            testCompile 'junit:junit:4.12'
    
        }
    

    Enjoy!