netdur
netdur

Reputation: 121

RuntimeException: Unable to instantiate activity ComponentInfo ... ClassNotFoundException

I'm getting the following error:

java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{com..chat/com..login.LoginActivity}: java.lang.ClassNotFoundException: Didn't find class "com..login.LoginActivity" on path: DexPathList[[zip file "/data/app/com..chat-1/base.apk"],nativeLibraryDirectories=[/data/app/com.*.chat-1/lib/arm, /vendor/lib, /system/lib]]

I have tried everything I could find online without success. The only way I could get around this by this inefficient script I made:

#!/usr/bin/env bash

./gradlew app:clean
./gradlew app:installDebug
./gradlew app:clean
./gradlew app:installDebug

/home/adel/Android/Sdk/platform-tools/adb shell am start -n com.*.chat/com.*.login.LoginActivity

notify-send -i icon.png "gradle task done" "check your phone"

It works, but takes around 7 minutes to get done. Is there a faster, more efficient way of doing this?

Upvotes: 1

Views: 992

Answers (2)

Rajesh N
Rajesh N

Reputation: 6693

I have stopped the Instant run from Android studio and its working.

File->Setting->Build->Instant Run->Disble checkbox of Enable instant run to hotswap code/resource changes

Upvotes: 0

klimat
klimat

Reputation: 24991

Use just this:

./gradlew --offline clean assembleDebug

To send .apk to your device use something like that:

adb install app/build/output/apk/appDebug.apk

Ensure your apk filename and the path are correct.

Upvotes: 1

Related Questions