Open rockakassh opened 2 years ago
Error says:
Caused by: java.lang.NullPointerException: Attempt to read from null array at com.tomer.fadingtextview.FadingTextView.startAnimation(FadingTextView.java:289)
This error is relative to the older version of the library which was the message pointed FadingTextView.java:289
.
This might be starting animation before checking the length of the texts.
version 3.1
fixes the error in FadingTextView.kt:218
(#22)
@rockakassh Can you check that the latest version fixes the problem?
activity_main.xml
<?xml version="1.0" encoding="utf-8"?> <androidx.drawerlayout.widget.DrawerLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:orientation="vertical" android:layout_height="match_parent" android:id="@+id/drawerid" android:background="@color/background" tools:context=".MainActivity">
</androidx.drawerlayout.widget.DrawerLayout>
loagcat
java.lang.RuntimeException: Unable to start activity ComponentInfo{com.curiousminds.ytcreatorszone/com.curiousminds.ytcreatorszone.MainActivity}: android.view.InflateException: Binary XML file line #2 in com.curiousminds.ytcreatorszone:layout/activity_main: Attempt to read from null array at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3704) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3871) at android.app.ActivityThread.handleRelaunchActivityInner(ActivityThread.java:5809) at android.app.ActivityThread.handleRelaunchActivity(ActivityThread.java:5712) at android.app.servertransaction.ActivityRelaunchItem.execute(ActivityRelaunchItem.java:69) at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:140) at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:100) at android.app.ClientTransactionHandler.executeTransaction(ClientTransactionHandler.java:58) at android.app.ActivityThread.handleRelaunchActivityLocally(ActivityThread.java:5765) at android.app.ActivityThread.access$3400(ActivityThread.java:292) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2318) at android.os.Handler.dispatchMessage(Handler.java:106) at android.os.Looper.loop(Looper.java:257) at android.app.ActivityThread.main(ActivityThread.java:8239) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:612) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1006) Caused by: android.view.InflateException: Binary XML file line #2 in com.curiousminds.ytcreatorszone:layout/activity_main: Attempt to read from null array Caused by: java.lang.NullPointerException: Attempt to read from null array at com.tomer.fadingtextview.FadingTextView.startAnimation(FadingTextView.java:289) at com.tomer.fadingtextview.FadingTextView.resume(FadingTextView.java:62) at com.tomer.fadingtextview.FadingTextView.onAttachedToWindow(FadingTextView.java:104) at android.view.View.dispatchAttachedToWindow(View.java:20731) at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:3516) at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:3516) at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:3516) at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:3516) at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:3516) at android.view.ViewGroup.addViewInner(ViewGroup.java:5359) at android.view.ViewGroup.addView(ViewGroup.java:5137) at android.view.ViewGroup.addView(ViewGroup.java:5109) at android.view.LayoutInflater.inflate(LayoutInflater.java:689) at android.view.LayoutInflater.inflate(LayoutInflater.java:532) at android.view.LayoutInflater.inflate(LayoutInflater.java:479) at androidx.appcompat.app.AppCompatDelegateImpl.setContentView(AppCompatDelegateImpl.java:699) at androidx.appcompat.app.AppCompatActivity.setContentView(AppCompatActivity.java:195) at com.curiousminds.ytcreatorszone.MainActivity.onCreate(MainActivity.java:131) at android.app.Activity.performCreate(Activity.java:8146) at android.app.Activity.performCreate(Activity.java:8130) at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1310) at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3673) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3871) at android.app.ActivityThread.handleRelaunchActivityInner(ActivityThread.java:5809) at android.app.ActivityThread.handleRelaunchActivity(ActivityThread.java:5712) at android.app.servertransaction.ActivityRelaunchItem.execute(ActivityRelaunchItem.java:69) at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:140) at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:100) 2021-11-19 16:20:11.849 30665-30665/com.curiousminds.ytcreatorszone E/AndroidRuntime: at android.app.ClientTransactionHandler.executeTransaction(ClientTransactionHandler.java:58) at android.app.ActivityThread.handleRelaunchActivityLocally(ActivityThread.java:5765) at android.app.ActivityThread.access$3400(ActivityThread.java:292) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2318) at android.os.Handler.dispatchMessage(Handler.java:106) at android.os.Looper.loop(Looper.java:257) at android.app.ActivityThread.main(ActivityThread.java:8239) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:612) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1006)