In my Android project i have a few modules. Some of them is android module and some java module. Now i want to convert java module to android module. Is Android studio has standard way for this?
A Java module uses apply plugin: 'java'
in its build.gradle, whereas an Android module uses apply plugin: 'com.android.library'
.
Change this in your Java module, along with compileSdkVersion, buildToolsVersion, defaultConfig, and buildTypes.
With all these changes your build.gradle file will look like this:
apply plugin: 'com.android.library'
android {
compileSdkVersion 25
buildToolsVersion '25.0.0'
defaultConfig {
minSdkVersion 15
targetSdkVersion 22
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(include: ['*.jar', '*.aar'], dir: 'libs')
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:25.1.0'
compile 'com.android.support:design:25.1.0'
compile 'com.android.support:support-v4:25.1.0'
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With