How do I resolve a “'generateDebugSources' not found in project” error?

前端 未结 8 1166
囚心锁ツ
囚心锁ツ 2021-02-07 07:36

I was trying to add a dependency to my application and I accidentally modified the wrong build.gradle file and now my application no longer builds correctly.

This is my

8条回答
  •  渐次进展
    2021-02-07 08:17

    I had this same issue and luckily I had made a recent backup and I figured out that the build.gradle file was missing from the App Folder. I copied that back into my project under the /AppName/app/build.gradle and the error went away.

    apply plugin: 'com.android.application'
    
    
    android {
        compileSdkVersion 25
        buildToolsVersion "25.0.2"
    
        defaultConfig {
            applicationId "com.company.appname"
            minSdkVersion 15
            targetSdkVersion 25
            versionCode 25
            versionName "2.0"
        }
        buildTypes {
            release {
                minifyEnabled false
                proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
            }
        }
    }
    
    dependencies {
        compile fileTree(dir: 'libs', include: ['*.jar'])
        testCompile 'junit:junit:4.12'
        compile 'com.android.support:appcompat-v7:25.1.0'
        compile project(':BaseGameUtils')
        compile 'com.google.android.gms:play-services:10.0.1'
        compile 'com.google.android.gms:play-services-plus:10.0.1'
        compile 'com.google.android.gms:play-services-ads:10.0.1'
        compile 'com.google.firebase:firebase-ads:10.0.1'
    }
    apply plugin: 'com.google.gms.google-services'
    

提交回复
热议问题