MichaelRocks / paranoid

String obfuscator for Android applications.
Apache License 2.0
673 stars 79 forks source link

compileSdkVersion is not specified. Please add it to build.gradle #46

Closed trafficteam7 closed 3 years ago

trafficteam7 commented 3 years ago

After I click Sync Now I get next error: Executing tasks: [:app:assembleDebug] in project /Users/macbook/AndroidStudioProjects/ObfuscationTest

FAILURE: Build failed with an exception.

BUILD FAILED in 99ms`

My build.gradle (project):

// Top-level build file where you can add configuration options common to all sub-projects/modules. buildscript { repositories { google() jcenter() } dependencies { classpath "com.android.tools.build:gradle:4.1.2" classpath "io.michaelrocks:paranoid-gradle-plugin:0.3.2"

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

}

apply plugin: 'com.android.application' apply plugin: 'io.michaelrocks.paranoid'

allprojects { repositories { google() jcenter() } }

My build.gradle (module): plugins { id 'com.android.application' }

android { compileSdkVersion 30 buildToolsVersion "30.0.3"

defaultConfig {
    applicationId "com.artem.obfuscationtest"
    minSdkVersion 24
    targetSdkVersion 30
    versionCode 1
    versionName "1.0"

    testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}

buildTypes {
    release {
        minifyEnabled false
        proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
    }
}
compileOptions {
    sourceCompatibility JavaVersion.VERSION_1_8
    targetCompatibility JavaVersion.VERSION_1_8
}

}

dependencies {

implementation 'androidx.appcompat:appcompat:1.2.0'
implementation 'com.google.android.material:material:1.3.0'
implementation 'androidx.constraintlayout:constraintlayout:2.0.4'
testImplementation 'junit:junit:4.13.2'
androidTestImplementation 'androidx.test.ext:junit:1.1.2'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0'

}

MichaelRocks commented 3 years ago

I think you should apply the plugin in the app module and not in the root module.