当我决定将android studio从3.0.1升级到3.1.2时,我正处于项目的中间,从那以后,我在构建应用程序时遇到此错误.我知道之前已经问过与此类似的问题,但区别在于,它没有提供它有问题的库的版本.所以这显然是一个不同的问题.这是截图
app level build.gradle:
android {
compileSdkVersion 27
defaultConfig {
applicationId "..."
minSdkVersion 18
targetSdkVersion 27
versionCode 16
versionName "1.1.1"
multiDexEnabled true
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
vectorDrawables.useSupportLibrary = true
}
}
ext {
lifecycleLibVersion = '1.1.1'
supportLibVersion = '27.1.1'
daggerLibVersion = '2.15'
gmsLibVersion = '11.8.0'
persistenceLibVersion = '1.0.0'
}
dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation "android.arch.lifecycle:extensions:$lifecycleLibVersion"
implementation "android.arch.persistence.room:runtime:$persistenceLibVersion"
implementation "com.android.support:appcompat-v7:$supportLibVersion"
implementation "com.android.support:cardview-v7:$supportLibVersion"
implementation "com.android.support:design:$supportLibVersion"
implementation "com.android.support:recyclerview-v7:$supportLibVersion"
implementation "com.android.support:support-vector-drawable:$supportLibVersion"
implementation 'com.android.support:multidex:1.0.3'
implementation "com.google.android.gms:play-services-location:$gmsLibVersion"
implementation "com.google.android.gms:play-services-maps:$gmsLibVersion"
implementation "com.google.dagger:dagger-android-support:$daggerLibVersion"
implementation …Run Code Online (Sandbox Code Playgroud) 我正在使用这种新的模块类型,我想知道是否可以在目录中使用它。因此,我将“home”模块移动到“ui”目录中作为示例,并收到此错误:
ERROR: Unable to find matching projects for Dynamic Features: [:ui:home]. Affected Modules: app
Run Code Online (Sandbox Code Playgroud)
但是 gradle 对于其他模块作为子模块没有问题,所以我猜问题可能是动态功能特有的
这是“app”模块的 gradle:
.
.
.
android {
compileSdkVersion AppMetaData.compileSdkVersion
defaultConfig {
applicationId AppMetaData.id
minSdkVersion AppMetaData.minSdkVersion
targetSdkVersion AppMetaData.targetSdkVersion
versionCode AppMetaData.versionCode
versionName AppMetaData.versionName
multiDexEnabled true
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
vectorDrawables.useSupportLibrary = true
buildConfigField "boolean", "DEBUG_LOGS", "true"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
dynamicFeatures = [Modules.home]
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation project(Modules.common)
implementation project(Modules.domain)
implementation project(Modules.navigation)
implementation project(Modules.network) …Run Code Online (Sandbox Code Playgroud) 我仅在某些设备上遇到此崩溃。当我尝试构建一个新的BillingClient.
我无法正确调试这个问题,因为它不会发生在我的任何设备上。再次强调,这种情况并不是在所有设备上都会发生,只会在安装了我的应用程序的 10% 的设备上发生。
以下是我启动计费的方式:
class BillingManager(
private val context: Context,
private val firebase: FirebaseManager,
private val storage: SharedPreferenceStorage
) {
private var billingClient: BillingClient? = null
val initBillingResponse = MutableLiveData<Boolean?>()
private val startConnectionListener = object : BillingClientStateListener {
override fun onBillingSetupFinished(result: BillingResult) {
if (result.isResponseOk()) {
getSKUs()
checkSubscription()
initBillingResponse.postValue(true)
} else {
initBillingResponse.postValue(false)
}
}
override fun onBillingServiceDisconnected() {
initBillingResponse.postValue(false)
}
}
init {
initBilling()
}
private fun initBilling() {
initBillingResponse.postValue(null)
try {
billingClient = BillingClient.newBuilder(context)
.enablePendingPurchases() …Run Code Online (Sandbox Code Playgroud) android google-play google-play-services play-billing-library google-play-billing
我在班级的某些领域遇到此错误
错误:字段的列名不唯一
@Entity(tableName = "Team", foreignKeys = {
@ForeignKey(entity = Group.class, parentColumns = "id", childColumns = "groupId")},
indices = {@Index("groupId")})
public class Team {
@PrimaryKey
private long id;
private long groupId;
@SerializedName("Team")
private String name;
private String englishName;
@SerializedName("Played")
private int played;
@SerializedName("Victories")
private int win;
@SerializedName("Draws")
private int draw;
@SerializedName("Defeats")
private int defeat;
@SerializedName("Made")
private int goalFor;
@SerializedName("Let")
private int goalAgainst;
@SerializedName("Diff")
private int goalDiff;
@SerializedName("Points")
private int points;
public Team() {
}
/* getter and setter methods */ …Run Code Online (Sandbox Code Playgroud)