[英]Class referenced in the manifest, was not found in the project or libraries
我想知道为什么在清单中它在 com.yalantis.ucrop.UCropActivity 有错误,尽管我已经正确放置了依赖项和存储库。 什么地方出了错?
<activity
android:name="*com.yalantis.ucrop.UCropActivity*"
android:screenOrientation="portrait"
android:theme="@style/Theme.AppCompat.Light.NoActionBar"/>
<activity
android:name=".UCropActivity"
android:screenOrientation="portrait"
android:theme="@style/Theme.AppCompat.Light.NoActionBar"/>
类名UCropActivity
前面的路径是包。 包在类中定义,在顶部,在清单中,也在顶部。 如果是同一个包,不需要在manifest的类名中包含; 您可以只输入带有句点的类名: .UCropActivity
。
在活动名称中包含包是没有错误的,但不应使用星号。 因此,表达式android:name="*com.yalantis.ucrop.UCropActivity*"
是无效的。
如果类和清单中有不同的包,则包必须包含在活动名称中。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.