它在牛轧糖及以下工作正常。但是Error type 3
- 在Oreo
中启动活动时出错。我该如何解决?
清单
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.zzz.com.z">
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<application
android:allowBackup="false"
android:icon="@mipmap/logo_launcher"
android:label="@string/app_name"
android:largeHeap="true"
android:roundIcon="@mipmap/logo_round_launcher"
android:supportsRtl="true"
android:theme="@style/AppTheme">
<activity
android:name=".MainActivity"
android:label="@string/app_name"
android:screenOrientation="portrait"
android:theme="@style/AppTheme.NoActionBar">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name=".LiveTrack"
android:label="@string/title_activity_live_track"
android:screenOrientation="portrait"
android:theme="@style/AppTheme.NoActionBar" />
<receiver
android:name=".YourActivityRunOnStartup"
android:enabled="true"
android:exported="true">
<intent-filter>
<action android:name="android.intent.action.BOOT_COMPLETED" />
</intent-filter>
</receiver>
<receiver
android:name=".ShutDownReceiver"
android:enabled="true"
android:exported="true">
<intent-filter>
<action android:name="android.intent.action.ACTION_SHUTDOWN" />
</intent-filter>
</receiver>
<service
android:name=".MyJobService"
android:permission="android.permission.BIND_JOB_SERVICE" />
</application>
</manifest>
的build.gradle
apply plugin: 'com.android.application'
android {
compileSdkVersion 26
buildToolsVersion "26.0.1"
defaultConfig {
applicationId "com.zzz.com.z"
minSdkVersion 21
targetSdkVersion 26
versionCode 1
versionName "1.01"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
compile 'com.android.support:appcompat-v7:26.+'
compile 'com.android.support.constraint:constraint-layout:1.0.2'
compile 'com.android.support:design:26.+'
compile 'com.google.android.gms:play-services-location:11.0.4'
compile 'com.android.support:support-vector-drawable:26.+'
testCompile 'junit:junit:4.12'
}
错误:
执行时出错:am start -n &#34; com.zzz.com.z / com.zzz.com.z.MainActivity&#34; -一个 android.intent.action.MAIN -c android.intent.category.LAUNCHER 开始:Intent {act = android.intent.action.MAIN cat = [android.intent.category.LAUNCHER] cmp = com.zzz.com.z / .MainActivity 错误类型3错误:活动类 {com.zzz.com.z / com.zzz.com.z.MainActivity}不存在。
启动活动时出错
答案 0 :(得分:2)
可能对某人有帮助:-
有时在设备上进行测试时,该应用无法正确卸载。要验证并解决此问题:
答案 1 :(得分:0)
问题可能出在您的清单文件中。检查 AndroidManifest.xml 文件。
检查“活动”声明中是否存在那些意图过滤器。如下所示。
<activity
android:name=".main.SplashScreenActivity"
android:label="@string/app_name"
android:screenOrientation="portrait">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
如果存在此信息,则可能发生了某些缓存问题。然后,尝试以下方法:
转到文件->使缓存无效/重新启动...