Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
嘿伙计们,我更改了清单文件中的包名称,以便我为所有活动提供一个单独的包,并且当我的源文件夹中存在 log cat 中显示的类时,它给了我错误 classnotfoundexception。
我什至将包名称更改为前一个。仍然给我同样的错误。
在您的清单文件中,如果活动的包地址包含相对命名空间地址(以点开头),如下所示:
<activity android:name=".addr.MainActivity" </activity>
您可以通过将其更改为完整地址来使其工作,如下所示:
<activity android:name="com.pkg.addr.MainActivity" </activity>