Question: If a kakfa topic has more than one partition , in java , those many consumer instances/threads would be instantiated at consumer side.

How it could be handled in spark-streaming consumer side ? I dont find much information regarding the same. Any sample for the same i.e. invoking multiple consumers at spark-streaming-consumer of a topic.

Any design suggestion/examples around would be highly thankful.

Regards,
Shyam

Answer: 
Definitively your problem is the Calligraphy library, I've got the same problem and there are 2 ways to solve it:

1. Go back to target version 28, and wait a possible update of the
Calligraphy library. 2
2. Remove the library

**About the exception:**

The exception error in Calligraphy comes from the use of the reflection in the library. See the last line of this exception:

```
E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.example, PID: 8220
android.view.InflateException: Binary XML file line #17 in com.example:layout/abc_screen_simple: Binary XML file line #17 in com.example/abc_screen_simple: Error inflating class androidx.appcompat.widget.FitWindowsLinearLayout
Caused by: android.view.InflateException: Binary XML file line #17 in com.example/abc_screen_simple: Error inflating class androidx.appcompat.widget.FitWindowsLinearLayout
Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.Object java.lang.reflect.Field.get(java.lang.Object)' on a null object reference

```

Android in your documentation explain that some reflection methods (non-SDK interfaces) are restricted in the API 29 platform.

> 
> Reflection via Class.getDeclaredField() or Class.getField() --------> NoSuchFieldException thrown
> 
> 
> Reflection via Class.getDeclaredMethod(), Class.getMethod() ----> NoSuchMethodException thrown.
> 
> 
> Reflection via Class.getDeclaredFields(), Class.getFields() --------> Non-SDK members not in results.
> 
> 
> Reflection via Class.getDeclaredMethods(), Class.getMethods() -> Non-SDK members not in results
> 
> 
> 

[Source: Restrictions on non-SDK interfaces](https://developer.android.com/distribute/best-practices/develop/restrictions-non-sdk-interfaces#results-of-keeping-non-sdk)
Update your **calligraphy** import in your **build.gradle(:app)** file with this **below**

implementation 'io.github.inflationx:viewpump:2.0.3'

implementation 'io.github.inflationx:calligraphy3:3.1.1'

and use **ViewPumpContextWrapper** instead of **CalligraphyContextWrapper**