Java Question Simple Library Compiler Error - MPAndroidCharts

jtare

Active Member
Licensed User
Longtime User
Hi , In the MPAndroidCharts library thread some of the posts had the java code, and since the feature combinedCharts was not how I liked it, I changed the java code( now it can draw candlesticks, lines and scatter), then compiled it with the Simple Library Compiler tool and it works fine.
But now looking in the original library github, there was a major change in how you enter the data, now you can enter (x,y), it used to be (y, index).
I downloaded the update, replaced all the files and try to compile but I got the following error while compiling with the Simple Library Compiler tool:
B4X:
Starting step: Compiling Java code.
javac 1.8.0_161
C:\Users\...\Desktop\MPChartLib - Copy\src\com\github\mikephil\charting\animation\ChartAnimator.java:6: error: package android.support.annotation does not exist
import android.support.annotation.RequiresApi;
                                 ^
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: Some input files use unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
Note: Some messages have been simplified; recompile with -Xdiags:verbose to get full output
1 error

Hopefuly the user that created the MPAndroidCharts library thread may have the answer.

Thanks
 

Johan Schoeman

Expert
Licensed User
Longtime User
It says that you are missing a reference to android.support.annotations.

You need the correct jar file in the libs folder of your java project to compile it.

Search the forum. There is a way to do it via a simple B4A project any then copy the (I think it is called stans.jar) jar file in the objects folder of your simple B4A project to the libs folder of your java project.

The are some posts by @Erel about how to for e.g. include com.android.support:support-v4 in a B4A project and then by simpling compiling the B4A project you get a jar that you then need to copy to the libs folder of you java project. I have personally never done it that way so suggest you search the forum how to go about it.

To include com.android.support:support-annotations should be the same sort of exercise.
 
Last edited:

jtare

Active Member
Licensed User
Longtime User
correct jar file in the libs folder of your java project
Thanks for the reply. By java project you mean an Eclipse project or Android Studio project? Because I'm not using those.

I found the android-support-annotations.jar file and copied it to a "libs" folder right next to the "src" and "bin" folders but didn't work.
 
Top