私はアンドロイドスタジオにアプリケーションコードを持っています。これをライブラリプロジェクトに変換して、他のアプリケーションのライブラリとして使うことができます。
エラー:私はアンドロイドスタジオ2.2.1およびJDK 1.8を使用していますandroid library projectのjackOptionsの使い方
apply plugin: 'com.android.library'
apply plugin: 'com.google.gms.google-services'
android {
compileSdkVersion 24
buildToolsVersion "24.0.3"
defaultConfig {
//applicationId "com.example"
minSdkVersion 16
targetSdkVersion 24
versionCode 1
versionName "1.0"
jackOptions {
enabled true
}
multiDexEnabled true
}
dexOptions {
javaMaxHeapSize "4g"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
testCompile 'junit:junit:4.12'
/* support libraries*/
compile 'com.android.support:appcompat-v7:23.1.0'
compile 'com.android.support:design:23.1.0'
compile 'com.android.support:recyclerview-v7:23.1.0'
compile 'com.android.support:support-v4:23.1.0'
compile 'com.android.support:support-annotations:23.1.0'
/* google play services libraries*/
compile 'com.google.android.gms:play-services-location:9.0.0'
}
、
JDK 1.8がjackOptions
それは言うを必要とし、次のようにライブラリプロジェクトの
build.gradleがある図書館プロジェクトはジャックを有効にすることはできません。 Jackはデフォルト設定で有効になっています。 もし私がjackOptionsを無効にすると、私のライブラリはjdk 1.8のために動作していません。それはjackOptionsが必要で、次のエラーが出るということです。 Olivier M.へ
app:generateDebugSources
app:mockableAndroidJar
app:prepareDebugUnitTestDependencies
app:generateDebugAndroidTestSources
myapplication:generateDebugSources
myapplication:generateDebugAndroidTestSources
myapplication:mockableAndroidJar
myapplication:prepareDebugUnitTestDependencies
モジュールまたはプロジェクト内。 ? – jenuine