【发布时间】:2023-04-04 06:48:01
【问题描述】:
我似乎遇到了与无数社区类似的问题;但是,我似乎没有相同的症状(或者至少,我的 Google-fu 不允许我找到它)。
长话短说:该应用程序正在给我java.lang.RuntimeException: Unable to instantiate activity。
据我了解,这只能是由于加载库的顺序不正确或缺少 AndroidManifest.xml 中的文件造成的。
这是我的 AndroidManifest.xml
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="net.alexanderlyons.livingpokedex">
<uses-permission android:name="android.permission.INTERNET" />
<application
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:supportsRtl="true"
android:theme="@style/AppTheme">
<activity android:name=".MainActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
Here is a link to my repository for those wanting to build it themselves.如果有人能告诉我可能出了什么问题。
注意:这可能是由于我的 .gitignore,因为我上次构建时,它位于我的主塔上。我只是在远程机器上遇到这个问题。
TL:DR - 我的 MainActivity 没有加载,它存在于 AndriodManifest.xml 中,我只使用 gradles 加载文件,而不是本地 jar。
【问题讨论】:
标签: android android-studio android-activity android-manifest