AnyChart-Android icon indicating copy to clipboard operation
AnyChart-Android copied to clipboard

I can't find aar file

Open ashivakarthik opened this issue 6 years ago • 7 comments

I can't find aar file in this also

https://github.com/AnyChart/AnyChart-Android/raw/master/builds/anychart-library.aar

ashivakarthik avatar Mar 06 '19 17:03 ashivakarthik

@ashivakarthik All you need to make the AnyChart Android work is right here: https://github.com/AnyChart/AnyChart-Android/tree/master. This is the actual build, please use it.

imaximova avatar Mar 07 '19 10:03 imaximova

wait @imaximova ... i don't get it ... u mean we need to build it? or what?

Aelafseged avatar Apr 21 '19 06:04 Aelafseged

@ashivakarthik There's no need in building the repo. All you need is to add the repository to the project build.gradle and add the dependency to the module build.gradle. For details, check the Getting Started article.

Shestac92 avatar Apr 22 '19 09:04 Shestac92

Doesnt work.

ghost avatar Feb 27 '20 21:02 ghost

@diaconori Please, can you provide more details about the issue? We will check it.

Shestac92 avatar Feb 28 '20 07:02 Shestac92

@Shestac92, I'll list it as following:


Build.Gradle (:app):

apply plugin: 'com.android.application'

android {
    compileSdkVersion 28
    defaultConfig {
        applicationId "com.XXXXXX.XXXX"
        minSdkVersion 19
        targetSdkVersion 28
        versionCode 1
        versionName "1.0"

        testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
        multiDexEnabled true
    }

    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
        }
    }

}

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

    implementation 'androidx.appcompat:appcompat:1.1.0'
    implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
    implementation 'androidx.legacy:legacy-support-v4:1.0.0'
    testImplementation 'junit:junit:4.12'
    androidTestImplementation 'androidx.test.ext:junit:1.1.1'
    androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
    implementation 'com.google.android.material:material:1.1.0'
    implementation 'com.github.AnyChart:AnyChart-Android:1.1.2'
    implementation 'com.android.support:multidex:1.0.3'
}

Build.Gradle (project):

// 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.6.0'
        

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

allprojects {
    repositories {
        google()
        jcenter()
        maven { url 'https://jitpack.io' }
    }
}

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


fragment_home.xml:

<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" tools:context=".home.HomeFragment">

<com.anychart.AnyChartView android:id="@+id/any_chart_view"
android:layout_width="match_parent"
android:layout_height="wrap_content" />

MainActivity.java:

@Override
   protected void onCreate(Bundle savedInstanceState) {
       super.onCreate(savedInstanceState);
       setContentView(R.layout.activity_main);

       Toolbar toolbar = findViewById(R.id.toolbar);
       setSupportActionBar(toolbar);

       AnyChartView chart = findViewById(R.id.any_chart_view);
       Pie pie = AnyChart.pie();

       List<DataEntry> data = new ArrayList<>();
       data.add(new ValueDataEntry("John", 10000));
       data.add(new ValueDataEntry("Jake", 12000));
       data.add(new ValueDataEntry("Peter", 18000));

       chart.setChart(pie);

       BottomNavigationView bottomNavigationView = findViewById(R.id.bottom_navigation);
       bottomNavigationView.setOnNavigationItemSelectedListener(navListener);
       getSupportFragmentManager().beginTransaction().replace(R.id.fragment_container, new HomeFragment()).commit();
   }

Exception: Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'com.anychart.AnyChartView$JsListener com.anychart.AnyChartView.getJsListener()' on a null object reference at com.anychart.APIlib.addJSLine(APIlib.java:27) at com.anychart.charts.Pie.(Pie.java:34) at com.anychart.AnyChart.pie(AnyChart.java:130)

NONE of the StackOverflow answers have a solution to this fix. It throws the NullPointerException at: Pie pie = AnyChart.pie();

image

ghost avatar Feb 28 '20 10:02 ghost

A similar issue I am facing... I had added their dependency but anychart is not at all invoking in the xml and in the main activity. @diaconori you got the answer???

kushalsharma12 avatar Mar 17 '22 11:03 kushalsharma12