1

I had a project in Android Studio. After reinstalling my OS I want to import my project again to Android Studio but I am getting this error:

LogCat error:

01-17 12:10:03.567 
13228-13228/com.nimaroid.introsliderproject 
E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.nimaroid.introsliderproject, PID: 13228
java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{com.nimaroid.introsliderproject/com.nimaroid.introsliderproject.IntroSliderActivity}: 
    java.lang.ClassNotFoundException: Didn't find class "com.nimaroid.introsliderproject.IntroSliderActivity" on path: 
    DexPathList[[zip file "/data/app/com.nimaroid.introsliderproject-1/base.apk", 
    zip file "/data/app/com.nimaroid.introsliderproject-1/split_lib_slice_9_apk.apk"],
    nativeLibraryDirectories=[/data/app/com.nimaroid.introsliderproject-1/lib/arm64, /vendor/lib64, /system/lib64]]
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2345)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2494)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
Caused by: java.lang.ClassNotFoundException: Didn't find class "com.nimaroid.introsliderproject.IntroSliderActivity" on path: 
    DexPathList[[zip file "/data/app/com.nimaroid.introsliderproject-1/base.apk", 
    zip file "/data/app/com.nimaroid.introsliderproject-

AndroidManifest:

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.nimaroid.introsliderproject">
<application
    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=".MainActivity"/>
    <activity android:name=".IntroSliderActivity"
        android:theme="@style/ads">
    <intent-filter>
        <action android:name="android.intent.action.MAIN" />

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

DawidJ
  • 1,245
  • 12
  • 19
Nima Khalili
  • 360
  • 4
  • 20

1 Answers1

0

I solved my problem, but maybe it will not worked for everyone.

In similar situations, the problem will sometimes be solved by updating Android Studio following the steps below.

  1. update Android Studio;

  2. open project;

  3. update Gradle(if the project is build in old version);

  4. update compileSdkVersion & targetSdkVersion to last version;

  5. update libraries to last version.

Note: The steps above are manual, but by default, Android Studio gives you the necessary messages to perform these steps.

JorgeAmVF
  • 1,660
  • 3
  • 21
  • 32
Nima Khalili
  • 360
  • 4
  • 20