0

Android starting activity not found while running the app. I have tested on other devices and it's working fine but not on Android Oreo.

 <application
    android:name=".network.NetworkController"
    android:allowBackup="true"
    android:icon="@mipmap/ic_launcher"
    android:label="@string/app_name"
    android:roundIcon="@mipmap/ic_launcher_round"
    android:supportsRtl="true"
    android:theme="@style/AppTheme">
    <activity android:name=".activities.SplashActivity"
        android:screenOrientation="portrait">
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />

            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
    </activity>

here is error

Error: Activity class {com.alch.outfi.outfi/com.alch.outfi.outfi.activities.SplashActivity} does not exist.

here is theme style.

   <!-- Base application theme. -->
<style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar">
    <!-- Customize your theme here. -->
    <item name="colorPrimary">@color/colorPrimary</item>
    <item name="colorPrimaryDark">@color/colorPrimaryDark</item>
    <item name="colorAccent">@color/colorAccent</item>
    <item name="android:windowNoTitle">true</item>
    <item name="android:windowFullscreen">true</item>
</style>

Note: I have tried invalidate-cache and restart android studio, plus rename activity and then revert it but same issue.

M.ArslanKhan
  • 3,640
  • 8
  • 34
  • 56

1 Answers1

0

I had the same issue using a splash screen in android o. It was caused by the custom theme I was using before O. Are you using a custom theme for that activity?

If so, this solution might help you.

The custom theme had this code

 <item name="android:windowBackground">@drawable/background_splash</item>

but android O seems to crash with it so try this solution that I used to solve my issue

Create a new value-v26/styles.xml then add the code below in that xml

<style name="Splashscreen" parent="Theme.AppCompat.NoActionBar">
    <item name="android:windowSplashscreenContent">@drawable/splashscreen</item>

Replace the background drawable with your own.

Umer Farooq
  • 168
  • 1
  • 12
  • @I have mentioned theme style , i have not used any drawable but just colors, so I think it is not issue in my applicaton – M.ArslanKhan Aug 07 '18 at 08:28