0

I am trying to run a simple test for my Application but I get a resource linking error for the androidTest Manifest.

Here is the error:

* What went wrong:
Execution failed for task ':mobile:processGoogleDebugAndroidTestResources'.
> A failure occurred while executing com.android.build.gradle.internal.res.LinkApplicationAndroidResourcesTask$TaskAction
   > Android resource linking failed
     C:\Users\de_ta\StudioProjects\BigOvenAndroid\BigOven\mobile\build\intermediates\packaged_manifests\googleDebugAndroidTest\AndroidManifest.xml:49: error: resource mipmap/ic_launcher (aka com.bigoven.android.debug.test:mipmap/ic_launcher) not found.

The thing is that the mipmap folder exists in the res and the application is running smoothly on release or debug.

Any help would be appreciated.

I am pasting the gradle and the Manifest files.

Gradle:

plugins {
    id 'com.android.application'
    id 'kotlin-android'
    id 'kotlin-android-extensions'
    id 'kotlin-kapt'
    id 'realm-android'
    id 'com.google.gms.google-services'
    id 'com.google.firebase.crashlytics'
}

android {
    compileSdkVersion 33

    defaultConfig {
        vectorDrawables.generatedDensities = ['ldpi', 'mdpi', 'hdpi', 'xhdpi', 'xxhdpi', 'xxxhdpi']
        applicationId = "com.bigoven.android"
        minSdkVersion 21
        targetSdkVersion 33
        versionName "6.1.38"
        versionCode 330
        multiDexEnabled true
        buildConfigField 'String', 'GIT_COMMIT', getGitCommit()
        buildConfigField 'String', 'GIT_BRANCH', getGitBranch()
        buildConfigField "String", "ACCOUNT_TYPE", "\"${applicationId}.account\""
        buildConfigField "String", "AUTHORITY", "\"${applicationId}.provider\""
        resValue "string", "account_type", "${applicationId}.account"
        resValue "string", "authority", "${applicationId}.provider"
        proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
        testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
    }

    signingConfigs {
        google {
            storeFile file('..\\keystore\\googleplay.keystore')
            storePassword "gatsby"
            keyAlias "lakefrontsoftware"
            keyPassword "gatsby"
            v1SigningEnabled true
            v2SigningEnabled true
        }
    }

    buildTypes {
        debug {
            debuggable true
            minifyEnabled false
            applicationIdSuffix ".debug"
            buildConfigField "String", "URL_AUTHORITY", "\"bigoven-api2-dev.azurewebsites.net\""
            signingConfig signingConfigs.google
        }

        release {
            debuggable false
            minifyEnabled true
            buildConfigField "String", "URL_AUTHORITY", "\"api2.bigoven.com\""
            signingConfig signingConfigs.google
        }

        staging {
            debuggable true
            minifyEnabled false
            versionNameSuffix ".staging"
            buildConfigField "String", "URL_AUTHORITY", "\"bigoven-api2-shadow.azurewebsites.net\""
            signingConfig signingConfigs.google
        }

        localRelease {
            debuggable true
            minifyEnabled false
            versionNameSuffix ".localRelease"
            buildConfigField "String", "URL_AUTHORITY", "\"api2.bigoven.com\""
            signingConfig signingConfigs.google
        }
    }

    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8
    }
    kotlinOptions {
        jvmTarget = '1.8'
    }
    dexOptions {
        javaMaxHeapSize "4g"
        jumboMode = true
    }

    flavorDimensions "market"
    productFlavors {
        uiTest {
            buildConfigField 'boolean', 'IS_GOOGLE', 'true'
            buildConfigField 'boolean', 'IS_KINDLE', 'false'
            buildConfigField "String", "HTTP_DEVICE_HEADER", "\"Android\""
            buildConfigField "String", "APP_MARKET", "\"Goog\""
            buildConfigField "String", "APP_CLIENT_NAME", "\"BO-Goog\""
            buildConfigField "boolean", "DISABLE_SERVICES", 'true'
        }

        google {
            buildConfigField 'boolean', 'IS_GOOGLE', 'true'
            buildConfigField 'boolean', 'IS_KINDLE', 'false'
            buildConfigField "String", "HTTP_DEVICE_HEADER", "\"Android\""
            buildConfigField "String", "APP_MARKET", "\"Goog\""
            buildConfigField "boolean", "DISABLE_SERVICES", 'false'
            buildConfigField "String", "APP_CLIENT_NAME", "\"BO-Goog\""
        }

//        //Prior to Jan 2015, IS_KINDLE was used to completely disable DFP ads for Amazon devices.
//        //Now, it is only used to block certain functionality not available on Amazon devices (like Google+ posting)
        amazon {
            buildConfigField 'boolean', 'IS_GOOGLE', 'false'
            buildConfigField 'boolean', 'IS_KINDLE', 'true'
            buildConfigField "String", "HTTP_DEVICE_HEADER", "\"KindleFire\""
            buildConfigField "String", "APP_MARKET", "\"Amzn\""
            buildConfigField "String", "APP_CLIENT_NAME", "\"BO-Amzn\""
            buildConfigField "boolean", "DISABLE_SERVICES", 'true'
        }
    }
    androidExtensions {
        experimental = true
    }
    packagingOptions {
        resources {
            excludes += ['META-INF/DEPENDENCIES', 'META-INF/NOTICE', 'META-INF/LICENSE', 'META-INF/services/javax.annotation.processing.Processor', 'META-INF/kotlin_module']
        }
    }
    lint {
        abortOnError false
        checkReleaseBuilds false
        disable 'InvalidPackage'
    }
    namespace 'com.bigoven.android'
}


configurations {
    all*.exclude group: 'commons-logging', module: 'commons-logging'
}

dependencies {


   

    // For push notifications & notifications from server
    implementation 'com.google.android.gms:play-services-gcm:17.0.0'
    implementation 'com.google.firebase:firebase-messaging-ktx:23.1.1'
    implementation 'com.google.firebase:firebase-analytics-ktx:21.2.0'
    implementation 'com.google.firebase:firebase-config:21.2.0'

    // Support libraries; for backwards compatibility in APIs and design
    implementation 'androidx.legacy:legacy-support-v13:1.0.0'
    implementation 'androidx.appcompat:appcompat:1.6.1'
    implementation 'androidx.palette:palette-ktx:1.0.0'
    implementation 'androidx.cardview:cardview:1.0.0'
    implementation 'androidx.recyclerview:recyclerview:1.2.1'
    implementation 'com.google.android.material:material:1.6.1'
    implementation 'androidx.legacy:legacy-support-core-ui:1.0.0'
    implementation 'androidx.dynamicanimation:dynamicanimation:1.0.0'
    implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
    implementation 'androidx.drawerlayout:drawerlayout:1.1.1'



    // Utility libraries
    implementation 'com.google.guava:guava:30.0-jre'
    implementation files('libs/in-app-purchasing-2.0.76.jar')
//    implementation 'com.google.android.exoplayer:exoplayer:2.16.1'

    // adds the @Generated annotation that Android lacks
    compileOnly 'org.glassfish:javax.annotation:10.0-b28'
    implementation 'net.danlew:android.joda:2.8.2'
    implementation 'com.jakewharton.timber:timber:4.7.1'
    implementation 'org.apache.commons:commons-lang3:3.4'
    implementation 'commons-validator:commons-validator:1.5.0'
    implementation 'org.slf4j:slf4j-api:1.7.30'
    implementation 'com.github.tony19:logback-android-core:1.1.1-6'
    implementation('com.github.tony19:logback-android-classic:1.1.1-6') {
//         workaround issue #73
        exclude group: 'com.google.android', module: 'android'
    }
    implementation('com.github.jkwiecien:EasyImage:2.0.3') {
        exclude(group: 'com.jakewharton.timber', module: 'timber')
    }

    // Unit/integration testing libraries
    testImplementation 'org.mockito:mockito-core:1.9.5'
    androidTestImplementation 'junit:junit:4.13.2'
    implementation 'androidx.annotation:annotation:1.5.0'
    androidTestImplementation 'androidx.annotation:annotation:1.5.0'
    androidTestImplementation 'androidx.test.uiautomator:uiautomator:2.2.0'
    androidTestImplementation 'org.hamcrest:hamcrest-library:2.2'
    androidTestImplementation('androidx.test.ext:junit:1.1.5') {
        exclude group: 'com.android.support', module: 'support-annotations'
    }
    androidTestImplementation('androidx.test:rules:1.5.0') {
        exclude group: 'com.android.support', module: 'support-annotations'
    }
    androidTestImplementation('androidx.test.espresso:espresso-core:3.5.1') {
        exclude group: 'com.android.support', module: 'support-annotations'
    }
    androidTestImplementation('androidx.test.espresso:espresso-intents:3.5.1') {
        exclude group: 'com.android.support', module: 'support-annotations'
    }
    androidTestImplementation('androidx.test.espresso:espresso-contrib:3.5.1') {
        exclude group: 'com.android.support', module: 'support-annotations'
        exclude group: 'com.android.support', module: 'support-v4'
        exclude group: 'com.android.support', module: 'recyclerview-v7'
    }
    implementation 'androidx.multidex:multidex:2.0.1'

//    // Database ORM
//    implementation 'com.michaelpardo:activeandroid:3.1.0-SNAPSHOT'

    // Design helper libraries
    implementation 'com.jakewharton:butterknife:10.0.0'
    kapt 'com.jakewharton:butterknife-compiler:10.0.0'
    implementation 'de.hdodenhof:circleimageview:1.3.0'
    implementation 'com.prolificinteractive:material-calendarview:1.1.0'
    implementation 'com.splitwise:tokenautocomplete:2.0.2@aar'
    implementation 'com.github.JakeWharton:ViewPagerIndicator:2.4.1'
    implementation 'com.longtailvideo.jwplayer:jwplayer-core:3.18.2'
    implementation('com.longtailvideo.jwplayer:jwplayer-common:3.18.2') {
        exclude group: 'com.google.android.gms.common'
    }

    //https://stackoverflow.com/a/69524560
    // (Java only)
    implementation "androidx.work:work-runtime:2.7.1"
    // Kotlin + coroutines
    implementation "androidx.work:work-runtime-ktx:2.7.1"


    implementation files('libs/org.apache.http.legacy.jar')
}

Manifest:

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:installLocation="auto">

    <uses-sdk tools:overrideLibrary="android.support.test.uiautomator.v18" />

    <supports-screens
        android:largeScreens="true"
        android:normalScreens="true"
        android:smallScreens="true"
        android:xlargeScreens="true" />

    <uses-permission android:name="android.permission.INTERNET" />
    <uses-permission
        android:name="android.permission.WRITE_EXTERNAL_STORAGE"
        android:maxSdkVersion="18" />

    <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />

    <uses-permission
        android:name="android.permission.ACCESS_WIFI_STATE"
        tools:node="remove" />

    <uses-permission android:name="com.google.android.providers.gsf.permission.READ_GSERVICES" />
    <uses-permission android:name="com.android.vending.BILLING" />
    <uses-permission android:name="com.google.android.c2dm.permission.RECEIVE" />

    <uses-permission
        android:name="${applicationId}.permission.C2D_MESSAGE"
        android:protectionLevel="signature" />

    <uses-feature
        android:name="android.hardware.camera"
        android:required="false" />

    <!--
     To retrieve OAuth 2.0 tokens or invalidate tokens to disconnect a user. This disconnect
     option is required to comply with the Google+ Sign-In developer policies
    -->
    <uses-permission android:name="android.permission.USE_CREDENTIALS" />
    <uses-permission android:name="android.permission.WAKE_LOCK" />

    <application
        android:name=".application.BigOvenApplication"
        android:allowBackup="true"
        android:hardwareAccelerated="true"
        android:icon="@mipmap/ic_launcher"
        android:label="@string/app_name"
        android:largeHeap="true"
        android:theme="@style/BigOvenTheme">
        <meta-data
            android:name="io.fabric.ApiKey"
            android:value="a54a1b26ddf11844cc2cdf64826296ab08a1fe93" />
        <meta-data
            android:name="com.google.android.gms.version"
            android:value="@integer/google_play_services_version" />

        <activity
            android:name=".HomescreenActivity"
            android:label="@string/app_name"
            android:launchMode="singleTop"
            android:theme="@style/BigOvenTheme"
            android:windowSoftInputMode="adjustResize"/>

        <activity
            android:name=".LauncherActivity"
            android:label="@string/app_name"
            android:launchMode="singleTop"
            android:exported="true"
            android:theme="@style/BigOvenTheme.Launcher"
            android:windowSoftInputMode="adjustResize">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />

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

        <activity
            android:name=".settings.SettingsActivity"
            android:exported="true"
            android:label="@string/title_settings"
            android:launchMode="singleTask"
            android:parentActivityName=".HomescreenActivity">
            <meta-data
                android:name="android.support.PARENT_ACTIVITY"
                android:value="com.bigoven.android.HomescreenActivity" />
        </activity>
        <activity
            android:name=".recipescan.controller.RecipeScanActivity"
            android:parentActivityName=".HomescreenActivity">
            <meta-data
                android:name="android.support.PARENT_ACTIVITY"
                android:value="com.bigoven.android.HomescreenActivity" />
        </activity>
        <activity
            android:name=".recipescan.controller.RecipeScanPurchaseActivity"
            android:parentActivityName=".recipescan.controller.RecipeScanActivity">
            <meta-data
                android:name="android.support.PARENT_ACTIVITY"
                android:value="com.bigoven.android.recipescan.controller.RecipeScanActivity" />
        </activity>
        <activity
            android:name=".recipeclipper.RecipeClipperActivity"
            android:icon="@drawable/ic_content_cut_white_24dp"
            android:label="@string/recipe_clipper_title"
            android:parentActivityName=".HomescreenActivity"
            android:windowSoftInputMode="stateHidden">
            <meta-data
                android:name="android.support.PARENT_ACTIVITY"
                android:value="com.bigoven.android.HomescreenActivity" />
        </activity>
        <activity
            android:name=".base.WebViewActivity"
            android:configChanges="orientation|screenSize" />

        <activity android:name=".settings.JavascriptWebviewActivity" />
        <activity
            android:name=".authentication.controller.AuthenticationActivity"
            android:label="@string/title_sign_in"
            android:launchMode="singleTask"
            android:windowSoftInputMode="adjustResize|stateHidden" />
        <activity
            android:name=".authentication.controller.AccountCreationActivity"
            android:label="@string/title_sign_in"
            android:windowSoftInputMode="adjustResize|stateHidden" />

        <!-- For Facebook OAuth login -->
        <activity
            android:name="com.facebook.FacebookActivity"
            android:configChanges="keyboard|keyboardHidden|screenLayout|screenSize|orientation"
            android:label="@string/app_name"
            android:theme="@android:style/Theme.Translucent.NoTitleBar" />

        <!-- android:theme="@style/FullyTranslucent" -->
        <meta-data
            android:name="com.facebook.sdk.ApplicationId"
            android:value="@string/app_id" />

        <!--
        <activity
            android:name="com.google.android.gms.ads.AdActivity"
            android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|uiMode|screenSize|smallestScreenSize"
            android:theme="@android:style/Theme.Translucent" />
        -->
        <activity
            android:name=".recipe.controller.RecipeDetailTabsActivity"
            android:parentActivityName=".HomescreenActivity"
            android:theme="@style/BigOvenTheme.TransparentBottomSheet">

            <meta-data
                android:name="android.support.PARENT_ACTIVITY"
                android:value=".HomescreenActivity" />

        </activity>
        <activity android:name=".search.controller.SearchResultsActivity" />
        <activity
            android:name=".search.controller.SearchActivity"
            android:windowSoftInputMode="stateVisible|adjustResize" />
        <activity
            android:name=".search.controller.RecipeCollectionsActivity"
            android:label="@string/title_activity_collections"
            android:parentActivityName=".search.controller.SearchActivity">
            <meta-data
                android:name="android.support.PARENT_ACTIVITY"
                android:value=".search.controller.SearchActivity" />
        </activity>
        <activity
            android:name=".social.UserProfileActivity"
            android:parentActivityName=".HomescreenActivity">
            <meta-data
                android:name="android.support.PARENT_ACTIVITY"
                android:value=".HomescreenActivity" />
        </activity>
        <activity android:name=".authentication.controller.ProUpsellActivity" />
        <activity
            android:name=".search.controller.AdvancedSearchActivity"
            android:parentActivityName=".search.controller.SearchActivity"
            android:windowSoftInputMode="stateUnchanged|adjustResize">
            <meta-data
                android:name="android.support.PARENT_ACTIVITY"
                android:value=".search.controller.SearchActivity" />
        </activity>
        <activity
            android:name=".search.controller.UseUpLeftoversActivity"
            android:parentActivityName=".search.controller.SearchActivity"
            android:windowSoftInputMode="adjustResize">
            <meta-data
                android:name="android.support.PARENT_ACTIVITY"
                android:value=".search.controller.SearchActivity" />
        </activity>



    </application>

</manifest>

I tried invalidate caches/restart, clean, and build again but I keep getting this error.

0 Answers0