AnyChart / AnyChart-Android

AnyChart Android Chart is an amazing data visualization library for easily creating interactive charts in Android apps. It runs on API 19+ (Android 4.4) and features dozens of built-in chart types.
2.31k stars 369 forks source link

Use AnyChart with API 27 #71

Open ghost opened 5 years ago

ghost commented 5 years ago

The app that I am building must use compileSdkVersion 27 however I am using buildToolsVersion '28.0.3'. Gradle syncs fine, however on build i get

Android resource linking failed
Output:  \app\build\intermediates\incremental\mergeDemoDebugResources\merged.dir\values-v28\values-v28.xml:7: error: resource android:attr/dialogCornerRadius not found.
\app\build\intermediates\incremental\mergeDemoDebugResources\merged.dir\values-v28\values-v28.xml:11: error: resource android:attr/dialogCornerRadius not found.
\app\build\intermediates\incremental\mergeDemoDebugResources\merged.dir\values\values.xml:1238: error: resource android:attr/fontVariationSettings not found.
\app\build\intermediates\incremental\mergeDemoDebugResources\merged.dir\values\values.xml:1239: error: resource android:attr/ttcIndex not found.
error: failed linking references.

Which appears to be due to AnyChart being built against API 28. Is there a previous version that was built against API 27 so that I do not have this problem? Or is there a way to force it to ignore the API 28 dependencies?

Shestac92 commented 5 years ago

@TimothyJimothy The AnyChart Android library runs on API 19+. So, it's compatible with both 27 and 28 API versions.

ghost commented 5 years ago

How would I resolve those build failures/linking failures then? They only occur when I add the AnyChart dependency to gradle, and after digging into it it appears to be an issue with API 28. Downgrade my build tools to 27.1.1?

Shestac92 commented 5 years ago

@TimothyJimothy We recommend to use 28 API for target and compiled sdk version.

ghost commented 5 years ago

Using 28.0.0 breaks contraintlayouts and drawerlayouts. If it’s compatible with 27 surely there is a way to make it work, or else this lib only works with API 28+

Shestac92 commented 5 years ago

@TimothyJimothy Ok, I see. Try to add the implementation with an option like this:

implementation ('com.github.AnyChart:AnyChart-Android:1.1.2') {
    exclude group: 'com.android.support'
}
ghost commented 5 years ago

@Shestac92 that seems to have done the trick, but I will update once i'm able to fully verify that it works. It actually builds now so that's a good first step 💯

Tasfiya commented 5 years ago

Master

Tasfiya commented 5 years ago

Hello-word