Failed app building due to NativeTemplate missing file

Viewed 93

When I tried to Build the app it gave me this error :

The error

A problem was found with the configuration of task ':nativetemplates:generateDebugRFile' (type 'GenerateLibraryRFileTask'). File 'D:\MyAppTest\nativetemplates\build\intermediates\local_only_symbol_list\debug\R-def.txt' specified for property 'localResourcesFile' does not exist.

The Project build.gradle

buildscript {
    repositories {
        google()
        jcenter()
        
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:4.1.3'
        classpath 'com.google.gms:google-services:4.3.4'

        //'com.android.tools.build:gradle:3.5.3'
        //'com.google.gms:google-services:4.2.0'

        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}

allprojects {
    repositories {
        google()
        jcenter()
        maven {
            url "https://maven.google.com"
        }
        maven { url "https://www.jitpack.io" }
        maven {
            url  "https://adcolony.bintray.com/AdColony"
        }
        mavenCentral()
        
    }
}

task clean(type: Delete) {
    delete rootProject.buildDir
}

The Module:MyAppTest.app build.gradle

apply plugin: 'com.android.application'
apply plugin: 'com.google.gms.google-services'

android {
    compileSdkVersion 29
    defaultConfig {
        applicationId "name.com.myapptest"
        minSdkVersion 17
        targetSdkVersion 29
        versionCode 21
        versionName "APT 20.1"
        testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
        multiDexEnabled true
    }
    buildTypes {
        release {
            minifyEnabled true
            shrinkResources true
            proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
        }
    }
}

dependencies {
    implementation fileTree(dir: 'libs', include: ['*.jar'])
    implementation 'androidx.appcompat:appcompat:1.3.1'
    ///1.1.3
    implementation 'androidx.constraintlayout:constraintlayout:2.1.1'
    implementation 'com.google.firebase:firebase-ads:19.5.0'
    testImplementation 'junit:junit:4.12'
    androidTestImplementation 'androidx.test.ext:junit:1.1.3'
    androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'
    implementation 'com.tomer:fadingtextview:2.5'
    implementation 'com.github.lguipeng:BubbleView:1.0.1'
    implementation 'pl.droidsonroids.gif:android-gif-drawable:1.2.15'
    implementation 'com.android.support:multidex:1.0.3'
    implementation project(':nativetemplates')
    implementation 'com.google.ads.mediation:adcolony:4.3.0.0'
    implementation 'com.google.ads.mediation:facebook:6.2.0.0'
    implementation 'com.google.android.gms:play-services-ads-identifier:17.0.0'

    implementation 'com.ogaclejapan.arclayout:library:1.1.0@aar'


}

apply plugin: 'com.google.gms.google-services'

The Module:MyAppTest.nativetemplates build.gradle:

apply plugin: 'com.android.library'

android {
    compileSdkVersion 28

    defaultConfig {
        minSdkVersion 16
        targetSdkVersion 28
        versionCode 1
        versionName "1.0"

        testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"

    }

    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pgcfg'
            consumerProguardFiles 'proguard-rules.pgcfg'
        }
    }

    lintOptions {
        resourcePrefix 'gnt_'
    }
}



dependencies {
    implementation fileTree(dir: 'libs', include: ['*.jar'])
    implementation 'androidx.appcompat:appcompat:1.3.1'
    testImplementation 'junit:junit:4.12'
    androidTestImplementation 'androidx.test:runner:1.4.0'
    androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'
    implementation 'com.google.android.gms:play-services-ads:18.3.0'
    implementation 'androidx.constraintlayout:constraintlayout:2.1.1'
}

I tried to clean the project and locate the missing file but it didn't solve it. Any idea or advice on how to fix it would be greatly appreciated.

0 Answers
Related