Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

React Native activity class does not exist

build.gradle file:

apply plugin: 'com.android.application'

android {
compileSdkVersion 23
buildToolsVersion "22.0.1"

defaultConfig {
    applicationId "com.fish"
    minSdkVersion 16
    targetSdkVersion 22
    versionCode 1
    versionName "1.0"
    ndk {
        abiFilters "armeabi-v7a", "x86"
    }
}
buildTypes {
    release {
        minifyEnabled false
        proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
    }
}
}

dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:23.0.1'
compile 'com.facebook.react:react-native:0.12.+'
}

I tried many ways to fix this, but nothing seems to work. Maybe somebody got this error, too. I'm using node stable (4.0.0).

Yesterday it worked(the app was opening with a white screen, but still it worked) but i don't know what happened meanwhile.

L.e.: Sorry, i forgot to write the error :)

Starting the app (/Users/matei/Library/Android/sdk//platform-tools/adb shell am start -n com.fish/.MainActivity)...
Starting: Intent { cmp=com.fish/.MainActivity }
Error type 3
Error: Activity class {com.fish/com.fish.MainActivity} does not exist.

I'm new to react native and I don't know what to do.

L.e. 2: The project is the init one from react-native android command. Nothing added.

like image 841
Matei Avatar asked Oct 31 '22 17:10

Matei


2 Answers

If you are sure that there is nothing wrong with your AndroidManifest.xml and build.gradle files, run the follow command on terminal:

adb uninstall <package_name>
like image 72
João Mainka Avatar answered Nov 02 '22 22:11

João Mainka


I spent a day for this problem.

Finally, I solved it.

If You have facing this problem, check the application has removed completely.

You could go to Settings menu and go to Apps and check that application was removed.

like image 38
Juwon Avatar answered Nov 03 '22 00:11

Juwon