This is the gradle file
…
This is the main activity
Targeting API is 29 therefore I cannot use android.support.v4 packages instead of that I had to use andoidX packages.
I think the error is still showing there because they have not updated the processing.core.jar to support the new androidx packages but since the content of androidx and support.v4 packages are same the program worked without any problems.
Thanks for Helping me.