我的应用程序有几种风格适用于多个市场的应用程序计费系统.
我有一个库,它共享我所有项目的基本代码.所以我决定将这些支付系统作为产品口味添加到这个库中.
问题是android库可以有产品口味吗?
如果是这样,我如何在应用程序的各自风格中包含不同的风格?
我搜索了很多,我找不到任何关于这种情况的信息.我在http://tools.android.com/tech-docs/new-build-system/user-guide中找到的唯一近似内容是:
dependencies {
flavor1Compile project(path: ':lib1', configuration: 'flavor1Release')
flavor2Compile project(path: ':lib1', configuration: 'flavor2Release')
}
Run Code Online (Sandbox Code Playgroud)
我将配置更改为不同的东西,但它不起作用!
我正在使用android studio 0.8.2.
新安装的Android Studio 3.1.3在制作新项目和第一次编译时会出现奇怪的依赖项错误.
类似的问题无助于解决问题.
Unable to resolve dependency for ':app@debug/compileClasspath': Could not resolve com.android.support:appcompat-v7:28.0.0-alpha3.
Open File
Show Details
Unable to resolve dependency for ':app@debug/compileClasspath': Could not resolve com.android.support.constraint:constraint-layout:1.1.2.
Open File
Show Details
Unable to resolve dependency for ':app@debugAndroidTest/compileClasspath': Could not resolve com.android.support:appcompat-v7:28.0.0-alpha3.
Open File
Show Details
Unable to resolve dependency for ':app@debugAndroidTest/compileClasspath': Could not resolve com.android.support.constraint:constraint-layout:1.1.2.
Open File
Show Details
Unable to resolve dependency for ':app@debugUnitTest/compileClasspath': Could not resolve com.android.support:appcompat-v7:28.0.0-alpha3.
Open File
Show Details
Unable …Run Code Online (Sandbox Code Playgroud) android build.gradle android-gradle-plugin android-studio-3.0
拥有更新的Android Studio 3.0非常棒.但是我遇到了Android Studio 3.0的问题,我刚刚在Android Studio 3.0中创建了一个新项目.然后我收到了一些错误
我通过更改dependencies到最新版本解决了这些问题并解决了问题.
但是,当我加了dependency的Facebook帐户,包SDK com.facebook.android:account-kit-sdk:4.+
我得到以下错误 - :
错误:无法解析':app @ debug/compileClasspath'的依赖项:无法解析com.facebook.android:account-kit-sdk:4.+.打开文件
显示细节
的build.gradle(APP)
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
android {
compileSdkVersion 26
defaultConfig {
applicationId "ultimate.devil.logintest"
minSdkVersion 15
targetSdkVersion 26
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation"org.jetbrains.kotlin:kotlin-stdlib-jre7:$kotlin_version"
implementation 'com.android.support:appcompat-v7:26.1.0'
implementation …Run Code Online (Sandbox Code Playgroud) 我正在尝试使用此逐步指南将OpenCV包括在我的Android Studio项目中。但是,将OpenCV添加为模块依赖项(指南中的第4步)后,Gradle项目同步失败,并出现以下错误:
ERROR: Unable to resolve dependency for ':app@debug/compileClasspath': Could not resolve project :openCVLibrary410.
Show Details
Affected Modules: app
ERROR: Unable to resolve dependency for ':app@debugAndroidTest/compileClasspath': Could not resolve project :openCVLibrary410.
Show Details
Affected Modules: app
ERROR: Unable to resolve dependency for ':app@debugUnitTest/compileClasspath': Could not resolve project :openCVLibrary410.
Show Details
Affected Modules: app
Run Code Online (Sandbox Code Playgroud)
我发现了这个相关问题,并尝试通过添加调试字段来调整openCV build.gradle中的buildType,但是它没有任何改变。我还尝试如下调整应用程序的build.gradle
buildTypes {
release {
...
}
debug {
matchingFallbacks = ['release']
}
}
Run Code Online (Sandbox Code Playgroud)
(以及一些稍微不同的版本,因为我不确定我在那儿做什么),但是没有一个帮助。我还尝试将OpenCV库的构建变体设置为发布而不是调试,但这会导致以下错误:
Unable to find a matching variant of …Run Code Online (Sandbox Code Playgroud) android studio多个模块项目问题在哪里?
错误消息打印屏幕 - 
project build.gradle
buildscript { repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.0.0'
}
}
allprojects {
repositories {
google()
jcenter()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
Run Code Online (Sandbox Code Playgroud)
app build.gradle
...
dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation 'com.android.support:appcompat-v7:26.1.0'
implementation 'com.android.support.constraint:constraint-layout:1.0.2'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.1'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1'
implementation project(':t2')
}
Run Code Online (Sandbox Code Playgroud)
设置gradle
include ':app', ':t2'
Run Code Online (Sandbox Code Playgroud)