0

我有这个https://github.com/grantland/android-autofittextview,在我的应用程序上运行良好。

然后我尝试将 WizardPage 添加到我的应用程序中,然后删除了有关 WizardPage 的所有内容。

现在,我无法打开包含 me.grantland.widget.AutofitTextView 的活动。

我没有触摸任何布局,我删除了有关 WizardPager 的所有内容。

我的摇篮;

dependencies {
    compile 'me.grantland:autofittextview:0.2.+'
..
..
.

错误;

04-21 03:01:06.530 21398-21398/com.gor.hocam E/ActivityThread: Failed to inflate
                                                               android.view.InflateException: Binary XML file line #181: Error inflating class me.grantland.widget.AutofitTextView
                                                                   at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:707)
                                                                   at android.view.LayoutInflater.rInflate(LayoutInflater.java:755)
                                                                   at android.view.LayoutInflater.rInflate(LayoutInflater.java:758)
                                                                   at android.view.LayoutInflater.rInflate(LayoutInflater.java:758)
                                                                   at android.view.LayoutInflater.rInflate(LayoutInflater.java:758)
                                                                   at android.view.LayoutInflater.inflate(LayoutInflater.java:492)
                                                                   at android.view.LayoutInflater.inflate(LayoutInflater.java:397)
                                                                   at android.view.LayoutInflater.inflate(LayoutInflater.java:353)
                                                                   at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:343)
                                                                   at android.app.Activity.setContentView(Activity.java:1929)
                                                                   at com.gor.hocam.Timer_questions.onCreate(Timer_questions.java:145)
                                                                   at android.app.Activity.performCreate(Activity.java:5231)
                                                                   at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1087)
                                                                   at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2169)
                                                                   at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2264)
                                                                   at android.app.ActivityThread.access$800(ActivityThread.java:144)
                                                                   at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1205)
                                                                   at android.os.Handler.dispatchMessage(Handler.java:102)
                                                                   at android.os.Looper.loop(Looper.java:136)
                                                                   at android.app.ActivityThread.main(ActivityThread.java:5139)
                                                                   at java.lang.reflect.Method.invokeNative(Native Method)
                                                                   at java.lang.reflect.Method.invoke(Method.java:515)
                                                                   at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:796)
                                                                   at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:612)
                                                                   at dalvik.system.NativeStart.main(Native Method)
                                                                Caused by: java.lang.ClassNotFoundException: Didn't find class "me.grantland.widget.AutofitTextView" on path: DexPathList[[zip file "/data/app/com.gor.hocam-2.apk"],nativeLibraryDirectories=[/data/app-lib/com.gor.hocam-2, /vendor/lib, /system/lib]]
                                                                   at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:56)
                                                                   at java.lang.ClassLoader.loadClass(ClassLoader.java:497)
                                                                   at java.lang.ClassLoader.loadClass(ClassLoader.java:457)
                                                                   at android.view.LayoutInflater.createView(LayoutInflater.java:559)
                                                                   at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:696)
                                                                   at android.view.LayoutInflater.rInflate(LayoutInflater.java:755) 
                                                                   at android.view.LayoutInflater.rInflate(LayoutInflater.java:758) 
                                                                   at android.view.LayoutInflater.rInflate(LayoutInflater.java:758) 
                                                                   at android.view.LayoutInflater.rInflate(LayoutInflater.java:758) 
                                                                   at android.view.LayoutInflater.inflate(LayoutInflater.java:492) 
                                                                   at android.view.LayoutInflater.inflate(LayoutInflater.java:397) 
                                                                   at android.view.LayoutInflater.inflate(LayoutInflater.java:353) 
                                                                   at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:343) 
                                                                   at android.app.Activity.setContentView(Activity.java:1929) 
                                                                   at com.gor.hocam.Timer_questions.onCreate(Timer_questions.java:145) 
                                                                   at android.app.Activity.performCreate(Activity.java:5231) 
                                                                   at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1087) 
                                                                   at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2169) 
                                                                   at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2264) 
                                                                   at android.app.ActivityThread.access$800(ActivityThread.java:144) 
                                                                   at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1205) 
                                                                   at android.os.Handler.dispatchMessage(Handler.java:102) 
                                                                   at android.os.Looper.loop(Looper.java:136) 
                                                                   at android.app.ActivityThread.main(ActivityThread.java:5139) 
                                                                   at java.lang.reflect.Method.invokeNative(Native Method) 
                                                                   at java.lang.reflect.Method.invoke(Method.java:515) 
                                                                   at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:796) 
                                                                   at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:612) 
                                                                   at dalvik.system.NativeStart.main(Native Method) 
04-21 03:01:06.530 21398-21398/com.gor.hocam D/AndroidRuntime: Shutting down VM
04-21 03:01:06.530 21398-21398/com.gor.hocam W/dalvikvm: threadid=1: thread exiting with uncaught exception (group=0x41724ce0)
04-21 03:01:10.538 21398-21398/com.gor.hocam W/GAv4: syncDispatchLocalHits timed out: java.util.concurrent.TimeoutException
04-21 03:01:10.546 21398-21398/com.gor.hocam E/AndroidRuntime: FATAL EXCEPTION: main
                                                               Process: com.gor.hocam, PID: 21398
                                                               java.lang.RuntimeException: Unable to start activity ComponentInfo{com.gor.hocam/com.gor.hocam.Timer_questions}: android.view.InflateException: Binary XML file line #181: Error inflating class me.grantland.widget.AutofitTextView
                                                                   at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2215)
                                                                   at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2264)
                                                                   at android.app.ActivityThread.access$800(ActivityThread.java:144)
                                                                   at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1205)
                                                                   at android.os.Handler.dispatchMessage(Handler.java:102)
                                                                   at android.os.Looper.loop(Looper.java:136)
                                                                   at android.app.ActivityThread.main(ActivityThread.java:5139)
                                                                   at java.lang.reflect.Method.invokeNative(Native Method)
                                                                   at java.lang.reflect.Method.invoke(Method.java:515)
                                                                   at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:796)
                                                                   at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:612)
                                                                   at dalvik.system.NativeStart.main(Native Method)
                                                                Caused by: android.view.InflateException: Binary XML file line #181: Error inflating class me.grantland.widget.AutofitTextView
                                                                   at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:707)
                                                                   at android.view.LayoutInflater.rInflate(LayoutInflater.java:755)
                                                                   at android.view.LayoutInflater.rInflate(LayoutInflater.java:758)
                                                                   at android.view.LayoutInflater.rInflate(LayoutInflater.java:758)
                                                                   at android.view.LayoutInflater.rInflate(LayoutInflater.java:758)
                                                                   at android.view.LayoutInflater.inflate(LayoutInflater.java:492)
                                                                   at android.view.LayoutInflater.inflate(LayoutInflater.java:397)
                                                                   at android.view.LayoutInflater.inflate(LayoutInflater.java:353)
                                                                   at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:343)
                                                                   at android.app.Activity.setContentView(Activity.java:1929)
                                                                   at com.gor.hocam.Timer_questions.onCreate(Timer_questions.java:145)
                                                                   at android.app.Activity.performCreate(Activity.java:5231)
                                                                   at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1087)
                                                                   at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2169)
                                                                   at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2264) 
                                                                   at android.app.ActivityThread.access$800(ActivityThread.java:144) 
                                                                   at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1205) 
                                                                   at android.os.Handler.dispatchMessage(Handler.java:102) 
                                                                   at android.os.Looper.loop(Looper.java:136) 
                                                                   at android.app.ActivityThread.main(ActivityThread.java:5139) 
                                                                   at java.lang.reflect.Method.invokeNative(Native Method) 
                                                                   at java.lang.reflect.Method.invoke(Method.java:515) 
                                                                   at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:796) 
                                                                   at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:612) 
                                                                   at dalvik.system.NativeStart.main(Native Method) 
                                                                Caused by: java.lang.ClassNotFoundException: Didn't find class "me.grantland.widget.AutofitTextView" on path: DexPathList[[zip file "/data/app/com.gor.hocam-2.apk"],nativeLibraryDirectories=[/data/app-lib/com.gor.hocam-2, /vendor/lib, /system/lib]]
                                                                   at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:56)
                                                                   at java.lang.ClassLoader.loadClass(ClassLoader.java:497)
                                                                   at java.lang.ClassLoader.loadClass(ClassLoader.java:457)
                                                                   at android.view.LayoutInflater.createView(LayoutInflater.java:559)
                                                                   at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:696)
                                                                   at android.view.LayoutInflater.rInflate(LayoutInflater.java:755) 
                                                                   at android.view.LayoutInflater.rInflate(LayoutInflater.java:758) 
                                                                   at android.view.LayoutInflater.rInflate(LayoutInflater.java:758) 
                                                                   at android.view.LayoutInflater.rInflate(LayoutInflater.java:758) 
                                                                   at android.view.LayoutInflater.inflate(LayoutInflater.java:492) 
                                                                   at android.view.LayoutInflater.inflate(LayoutInflater.java:397) 
                                                                   at android.view.LayoutInflater.inflate(LayoutInflater.java:353) 
                                                                   at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:343) 
                                                                   at android.app.Activity.setContentView(Activity.java:1929) 
                                                                   at com.gor.hocam.Timer_questions.onCreate(Timer_questions.java:145) 
                                                                   at android.app.Activity.performCreate(Activity.java:5231) 
                                                                   at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1087) 
                                                                   at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2169) 
                                                                   at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2264) 
                                                                   at android.app.ActivityThread.access$800(ActivityThread.java:144) 
                                                                   at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1205) 
                                                                   at android.os.Handler.dispatchMessage(Handler.java:102) 
                                                                   at android.os.Looper.loop(Looper.java:136) 
                                                                   at android.app.ActivityThread.main(ActivityThread.java:5139) 
                                                                   at java.lang.reflect.Method.invokeNative(Native Method) 
                                                                   at java.lang.reflect.Method.invoke(Method.java:515) 
                                                                   at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:796) 
                                                                   at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:612) 
                                                                   at dalvik.system.NativeStart.main(Native Method) 

我的 AutoFitTextView 的一个例子

 <me.grantland.widget.AutofitTextView
                    android:id="@+id/taOpt6"
                    android:layout_width="match_parent"
                    android:layout_height="match_parent"
                    android:layout_gravity="center_vertical"
                    android:layout_span="0"
                    android:gravity="center|left"
                    android:text="Option"
                    android:padding="3dp"
                    android:singleLine="false"
                    android:textColor="@color/Black"
                    android:textSize="15sp"
                    android:maxLines="3"
                    android:typeface="serif"
                    android:visibility="visible" />

谢谢你的帮助。

4

0 回答 0