在设备上运行项目时,我得到了这些错误:
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'
}
我还尝试了很多方法,比如更改包名称等等。我应该怎么做才能解决这个问题?
发布于 2018-11-05 23:46:48
2018年...确保设备完全卸载了该应用程序。转到您的设置中的应用程序,并删除对您尝试安装的应用程序的引用。
发布于 2015-03-21 15:44:13
要解决此问题:
安卓工作室清理Project
我认为关键是重启你的IDE。
或者尝试添加
com.package.name.SplashActivity在这里,相应地更改包名称
发布于 2019-12-26 21:34:35
如果应用程序是在之前安装的,那么您需要确保为所有用户删除应用程序。(旧版本的Android导致了这个错误。)
你可以在手机设置->应用程序和通知->应用程序信息中查看你的应用程序名称,然后单击右上角菜单中的delete -> all users按钮。
https://stackoverflow.com/questions/29180269
复制相似问题