【发布时间】:2015-05-24 16:09:40
【问题描述】:
我在设备上运行项目时遇到这些错误:
Launching application:.Splash_Activity.
DEVICE SHELL COMMAND: am start -n ".Splash_Activity" -a android.intent.action.MAIN -c android.intent.category.LAUNCHER
Starting: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] cmp=.Splash_Activity }
Error type 3
Error: Activity class {.Splash_Activity} does not exist.
我检查了我的 Android-Manifest 文件
<activity
android:name=".SplashActivity"
android:screenOrientation="portrait"
android:theme="@android:style/Theme.NoTitleBar.Fullscreen">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
Gradle 是这样的:
apply plugin: 'com.android.library'
android {
compileSdkVersion 21
buildToolsVersion "21.0.2"
defaultConfig {
minSdkVersion 14
targetSdkVersion 21
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
allprojects {
tasks.withType(JavaCompile) {
options.compilerArgs << "-Xlint:deprecation" << "-Xlint:unchecked"
}
}
repositories {
jcenter()
}
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
compile 'com.android.support:cardview-v7:+'
compile 'com.google.android.gms:play-services:4.3.+'
compile files('libs/GraphView-3.1.3.jar')
compile files('libs/google-play-services.jar')
compile files('libs/android-support-v4.jar')
compile files('libs/bolts-android-1.1.2.jar')
compile 'com.github.navasmdc:MaterialDesign:1.+@aar'
compile files('libs/nineoldandroids-2.4.0.jar')
compile 'com.android.support:appcompat-v7:22.0.0'
}
我也通过更改包名称等尝试了很多.. 我应该怎么做才能解决这个问题?
【问题讨论】:
-
SplashActivity这是你的启动画面类名。 -
是的,如果我按下 ctr 按钮并在 AndroidManifest 文件中单击它的名称,它也会打开
-
你能发布整个清单编码吗?
-
你正确的班级名称拼写是什么?在 logcat 中,它显示
.Splash_Activity(带下划线)并在您的清单中显示SplashActivity(不带下划线)。
标签: android android-activity android-manifest