I am trying to integrate react native and native android app.
applicationId in apps build.gradle is rcm.samapp
package in manifest tag is com.comp.android.
Line 1 in SplashActivity.kt is package com.comp.android.ui
activity is Manifest looks like:
 <activity
      android:name=".ui.SplashActivity"
      android:screenOrientation="portrait">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <category android:name="android.intent.category.LAUNCHER" />
                <category android:name="android.intent.category.DEFAULT" />
            </intent-filter>
 </activity>
After following the official RN doc, when I try to run it through react-native run-android --appId rcm.samapp --main-activity ui.SplashActivity command, it throws this error:
Starting: Intent { cmp=rcm.samapp/com.comp.android.ui.SplashActivity }
Error type 3
Error: Activity class {rcm.samapp/com.comp.android.ui.SplashActivity} does not exist.
What can be the reason and fix?
build.gradle
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-kapt'
apply plugin: 'kotlin-android-extensions'
apply from: 'appcenter.gradle'
apply from: 'version.gradle'
apply plugin: 'jacoco'
apply plugin: 'org.owasp.dependencycheck'
apply from: 'checkstyle.gradle'
project.afterEvaluate {
    preBuild.dependsOn 'checkstyle'
}
repositories {
    flatDir {
        dirs 'libs'
    }
}
project.ext.react = [
        entryFile: "index.js",
        enableHermes: false,  // clean and rebuild if changing
]
def jscFlavor = 'org.webkit:android-jsc:+'
def enableHermes = project.ext.react.get("enableHermes", false);
dependencyCheck {
    scanConfigurations += 'releaseCompileClasspath'
}
android {
    compileSdkVersion 29
    def versionNameValue = System.getProperty("suppliedVersionName", "1.0.0")
    def versionCodeValue = System.getProperty("suppliedVersionCode", calculatedVersionCode)
    packagingOptions {
        pickFirst '**/*.so'
    }
    dexOptions {
        javaMaxHeapSize "4g"
    }
    lintOptions {
        abortOnError false
        disable 'MissingTranslation'
    }
    defaultConfig {
        applicationId "rcm.samapp"
        minSdkVersion 21
        targetSdkVersion 28
        versionName versionNameValue
        versionCode (versionCodeValue.toInteger() + 10000)
        vectorDrawables.useSupportLibrary = true
        multiDexEnabled true
        def backend = backend()
        resValue 'bool', 'debugMenu', 'false'
    }
    dataBinding {
        enabled = true
    }
    kotlinOptions {
        jvmTarget = '1.8'
    }
    compileOptions {
        targetCompatibility JavaVersion.VERSION_1_8
        sourceCompatibility JavaVersion.VERSION_1_8
    }
    packagingOptions {
        exclude 'lib/mips64/**'
        exclude 'lib/mips/**'
        exclude 'lib/armeabi/**'
    }
    buildTypes {
        android.applicationVariants.all { variant ->
            variant.getAssembleProvider().configure() {
                it.doFirst {
                   
           ...
                }
                it.doLast {
                    ...
                }
            }
        }
 
        debug {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
            debuggable true
            testCoverageEnabled true
            applicationIdSuffix ".debug.dev"
            versionNameSuffix ".debug.$currentBranchName"
            signingConfig signingConfigs.debug
            buildConfigField 'boolean', 'SHOW_DEBUG_MENU', 'true'
        }
        development.initWith(release)
        development {
            debuggable true
            applicationIdSuffix '.debug'
            versionNameSuffix ".development.$currentBranchName"
            signingConfig signingConfigs.debug
            buildConfigField 'boolean', 'SHOW_DEBUG_MENU', 'true'
            resValues.remove 'debugMenu'
            resValue 'bool', 'debugMenu', 'true'
        }
    }
    sourceSets {
        debug.java.srcDirs        += 'src/environments_debug/java'
        development.java.srcDirs  += 'src/environments_debug/java'
     
        release.java.srcDirs      += 'src/environments_release/java'
        debug {
            jniLibs.srcDir 'src/jniLibsDebug'
        }
        development {
            jniLibs.srcDir 'src/jniLibsRelease'
        }
        release {
            jniLibs.srcDir 'src/jniLibsRelease'
        }
    }
    testOptions {
        animationsDisabled = true
        animationsDisabled true
        unitTests {
            includeAndroidResources = true
        }
    }
}
def backend() {
    return project.getProperties().get("backend")
}
ext {
      lifeCycle = '2.2.0'
    dagger = '2.27'
    retrofit = '2.4.0'
    room = '2.2.5'
    glide = '4.11.0'
    espresso = '3.2.0'
    databinding = '4.0.0'
    appCenterSdkVersion = '3.2.1'
}
dependencyCheck {
    // Only check for vulnerabilities in the dependencies of the production release
    scanConfigurations += 'releaseCompileClasspath'
}
jacoco {
    toolVersion = "$jacocoVersion"
}
tasks.withType(Test) {
    jacoco.includeNoLocationClasses = true
}
task jacocoTestReport(type: JacocoReport, dependsOn: ['testDebugUnitTest', 'createDebugCoverageReport']) {
}
dependencies {
    releaseImplementation files('libs/libidpmobile.jar')
    developmentImplementation files('libs/libidpmobile.jar')
    debugImplementation files('libs/libidpmobile-debug.jar')
    if (enableHermes) {
        def hermesPath = "../../node_modules/hermesvm/android/";
        debugImplementation files(hermesPath + "hermes-debug.aar")
        releaseImplementation files(hermesPath + "hermes-release.aar")
    } else {
        implementation jscFlavor
    }
    implementation 'com.android.support:appcompat-v7:27.1.1'
    ...implementations
 
    testImplementation 'junit:junit:4.13'
}
apply from: file("../../node_modules/@react-native-community/cli-platform-android/native_modules.gradle");
applyNativeModulesAppBuildGradle(project)
// THIS NEEDS TO BE IN THE BOTTOM
apply plugin: 'com.google.gms.google-services'
 
    