-1

Android Version: 7.0 (Nougat)

Hi,

I'm beginner developers on mobile in Android. I had a problem on 04.21. This problem is ‘Not found Activity’ and I need help in understanding it.

I'm experiencing the issue by following this flow:

  1. New Project ‘A’ created in Android Studio;
  2. Build a project and run the app on an Android device (Galaxy Note5, Galaxy Note4, etc.);
  3. Verify the app is running successfully;
  4. Remove the app from the device;
  5. Find app-debug.apk file in project directory (e.g.: A/app/build/outputs/apk/app-debug.apk);
  6. I’m move the .apk file from Notebook to device and install the .apk on the device using: adb install app-debug.apk
  7. Check the app's complete installation on the device;
  8. App crashes due to NotFound MainActivity.java files error, found in the log.

I've found a quick fix to my issue, by adding the following:

jackOptions, gradle 
    jackOptions {
     enabled true
    }

But now, I have no idea why the above snipped in fixing my problem. Can someone please help me debug this issue, or find a workaround to my problem?

Thanks!

 <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">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />

                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
    </application>
iamdanchiv
  • 4,052
  • 4
  • 37
  • 42
Park
  • 401
  • 4
  • 10

3 Answers3

0

Have you checked the manifest file and define your main Activity.

<intent-filter>
        <action android:name="android.intent.action.MAIN" />
        <category android:name="android.intent.category.LAUNCHER" />
    </intent-filter>
Juliyanage Silva
  • 2,529
  • 1
  • 21
  • 33
0

Try this

GoTo>>Build>>Generate Signed APK

Now you will have a form like this enter image description here

Click on Create new, and create key store for your apk enter image description here

Fill out the form as in the picture. And use these credentials to generate signed .apkenter image description here

Like this, Hope it solves your problem, Follow the link if you want to know the more details

Abdul Kawee
  • 2,687
  • 1
  • 14
  • 26
0

It doesn't look like a problem. Are you sure the adb installation has been successful? Maybe you need to pack the release version,the debug version can run directly ,and the installation may need to be signed.

yeyuzhou
  • 11
  • 1