gpt4 book ai didi

android - 错误类型 3 - 启动 Activity 时出错

转载 作者:行者123 更新时间:2023-11-29 19:01:49 24 4
gpt4 key购买 nike

它在牛轧糖及以下效果很好。但是给出 错误类型 3 - 在 Oreo 中启动 Activity 时出错。我该如何解决?

list

<?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>

构建.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'
}

错误:

Error while executing: am start -n "com.zzz.com.z/com.zzz.com.z.MainActivity" -a android.intent.action.MAIN -c android.intent.category.LAUNCHER Starting: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] cmp=com.zzz.com.z/.MainActivity } Error type 3 Error: Activity class {com.zzz.com.z/com.zzz.com.z.MainActivity} does not exist.

启动 Activity 时出错

最佳答案

问题可能出在您的 list 文件中。检查 AndroidManifest.xml 文件。

检查您的 Activity 声明中是否存在这些 intent-filters。如下所示。

<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>

如果存在此信息,则可能发生了缓存问题。然后,试试这个:

Go to File -> Invalidate Caches / Restart...

关于android - 错误类型 3 - 启动 Activity 时出错,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48780499/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com