【Android Studio】 Caused by: java.lang.ClassNotFoundException: Didn't find class "de.hdodenhof.circle

【版本】

win10

【Android Studio】 Caused by: java.lang.ClassNotFoundException: Didn't find class

【报错代码】

Caused by: android.view.InflateException: Binary XML file line #69 in org.tensorflow.lite.examples.classification:layout/activity_main: Binary XML file line #69 in org.tensorflow.lite.examples.classification:layout/activity_main: Error inflating class de.hdodenhof.circleimageview.CircleImageView
     Caused by: android.view.InflateException: Binary XML file line #69 in org.tensorflow.lite.examples.classification:layout/activity_main: Error inflating class de.hdodenhof.circleimageview.CircleImageView
     Caused by: java.lang.ClassNotFoundException: de.hdodenhof.circleimageview.CircleImageView
。。。省略
Caused by: java.lang.ClassNotFoundException: Didn't find class "de.hdodenhof.circleimageview.CircleImageView" on path: DexPathList[[zip file "/data/app/org.tensorflow.lite.examples.classification-E5i9WwoioJPd24r5bRoL4A==/base.apk"],nativeLibraryDirectories=[/data/app/org.tensorflow.lite.examples.classification-E5i9WwoioJPd24r5bRoL4A==/lib/x86, /data/app/org.tensorflow.lite.examples.classification-E5i9WwoioJPd24r5bRoL4A==/base.apk!/lib/x86, /system/lib, /system/product/lib]]

【错误原因】

我的是app闪退,网上有同样报错的人说是因为加了android:scaleType="fitCenter",但是我的代码里并没有这个,如果你的代码里有这一句那你可以把它删了然后重新sync一下再运行试试。我的错误原因不在xml里面。但具体错因我也不知道,我是这样的,在另一个项目里用这个circleimageview就没得问题,但是把他们拼到另一个项目里就报错了quq

【解决办法】

在build.gradle里面的dependencies中加入

implementation 'de.hdodenhof:circleimageview:1.3.0'

【Android Studio】 Caused by: java.lang.ClassNotFoundException: Didn't find class

然后在重新sync一下就没问题了。

 

你可能感兴趣的:(Android,Studio)