问题
I am newbie to android development. I have just started setting up my device to debug my application. while going through android develop tools it says to set buildTypes
debuggable
to true in build.gradle file . I am not sure which grade file to use gradle.build(Module) or gradle.build(project)?
回答1:
There are two gradle files in your project -
- Top level
- App level
You need to add it to your app level gradle file -
YourApplicationRootFolder -> app -> build.gradle
You need to add it like this -
buildTypes {
debug {
debuggable true
}
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
Look at this image to get a better idea -
回答2:
Debug buildType makes build debuggable by default; instead, Release buildType makes build not debuggable by default. If you want to change this behaviour, you can define in your module app the property debuggable (boolean) as you need. Gradle properties
来源:https://stackoverflow.com/questions/32687046/which-gradle-file-to-use-to-set-the-application-as-debuggable