First, this is a demo. In the process of learning how to use gradle,I wanna add the custom buildTypes for apk,this is my application module app-> build.gradle
apply plugin: 'com.android.application'
apply plugin: 'android-aspectjx'
apply plugin: 'patcher'
apply plugin: 'kotlintest'
apply plugin: 'javaTest'
android {
compileSdkVersion 28
defaultConfig {
applicationId "com.person.ermao.aoptest"
minSdkVersion 15
targetSdkVersion 28
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
debug {
applicationIdSuffix ".debug"
debuggable true
}
staging {
initWith debug
manifestPlaceholders = [hostName:"internal.example.com"]
applicationIdSuffix ".debugStaging"
}
}
// splits {
// // Settings to build multiple APKs based on screen density.
// density {
//
// // Enable or disable building multiple APKs.
// enable true
//
// // Exclude these densities when building multiple APKs.
// exclude "ldpi", "tvdpi", "xxxhdpi", "400dpi", "560dpi"
// }
// }
patcher {
sourceApk "com.person.ermao"
ignoreWarning true
useSign true
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
}
aspectjx {
//排除所有package路径中包含`android.support`的class文件及库(jar文件)
exclude 'android.support'
}
dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation 'com.android.support:appcompat-v7:28.0.0'
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
androidTestImplementation('io.mockk:mockk-android:1.9.3') { exclude module: 'objenesis' }
androidTestImplementation 'org.objenesis:objenesis:2.6'
implementation project(':aop')
}
i got some error:
Unable to resolve dependency for ':app@staging/compileClasspath': Could not resolve project :aop. Open File Show Details
Unable to resolve dependency for ':app@stagingUnitTest/compileClasspath': Could not resolve project :aop. Open File Show Details