Java Question android/support/v4/graphics/drawable/TintAwareDrawable

Johan Schoeman

Expert
Licensed User
Longtime User
....where are they hiding this....? I added the class (code found on the web) in my Java project and when I compile the B4A project I get an error:
B4X:
Uncaught translation error: java.lang.IllegalArgumentException: already added: Landroid/support/v4/graphics/drawable/TintAwareDrawable;

If I remove the class (code) from my project then I get a SLC error when I try to compile the lib with SCL
B4X:
Starting step: Compiling Java code.
javac 1.8.0_66
C:\Users\----------2\Documents\Basic 4 Android\AnimatedStarRating\Animated-Star-Rating\animatedstar\src\com\neberox\library\animatedstar\vector\VectorDrawableCommon.java:35: error: cannot find symbol
import android.support.v4.graphics.drawable.TintAwareDrawable;
                                           ^
  symbol:   class TintAwareDrawable
  location: package android.support.v4.graphics.drawable
Note: C:\Users\----------2\Documents\Basic 4 Android\AnimatedStarRating\Animated-Star-Rating\animatedstar\src\com\neberox\library\animatedstar\vector\VectorDrawableCompat.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
1 error


Error.

Anyone with a solution for this?

I have com.android.support:support-v4 (Google Maven) installed - Version 27.1.1

My folder....
extras\android\m2repository\com\android\support\support-v4
....only shows 26.0.0-alpha1 as the latest version and the next most recent one being 25.3.1
 

DonManfred

Expert
Licensed User
Longtime User
extras\android\m2repository\com\android\support\support-v4
you are looking in the wrong path

I would start searching for the right maven artifacts in
[path to sdk]\extras\b4a_remote\com\android\support
and it´s subfolders

Edit: It is com.android.support:support-compat

belongs to Maven artifact com.android.support:support-compat:28.0.0-alpha1

https://developer.android.com/reference/android/support/v4/graphics/drawable/DrawableCompat

Add a reference to com.android.support:support-compat

B4X:
@DependsOn(values={"com.android.support:support-compat"})
 
Last edited:
Top