android - Android工作室:未找到变体
问题描述
在此处输入图像描述 您好,我正在学习新的 Android Studio,我从 CodeCanyon 购买了源代码并解决了一些错误,但我陷入了这个错误:没有为 ':app' 找到变体。检查构建文件以确保至少存在一种变体。我检查了 cdk 工具,一切似乎都很好,我也搜索了答案并尝试了它们,但我无法解决这个错误。
这是我的代码:
apply plugin: 'com.android.application'
android {
compileSdkVersion 29
buildToolsVersion "29.0.2"
defaultConfig {
applicationId 'com.quraan.farroukh'
minSdkVersion 17
targetSdkVersion 29
versionCode 1
versionName "1.0"
ndk {
ndk.abiFilters 'armeabi-v7a','arm64-v8a','x86','x86_64'
}
}
lintOptions {
checkReleaseBuilds false
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
productFlavors {
}
}
dependencies{
task wrapper(type: Wrapper){
gradleVersion = '2.14.1'
}
implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
implementation 'com.google.android.material:material:1.3.0'
implementation 'androidx.cardview:cardview:1.0.0'
implementation 'androidx.browser:browser:1.3.0'
implementation 'androidx.recyclerview:recyclerview:1.2.1'
implementation 'com.google.android.gms:play-services-ads:20.2.0'
implementation 'com.google.android.gms:play-services-analytics:17.0.0'
implementation 'com.google.android.gms:play-services-analytics-impl:17.0.0'
implementation 'com.github.varunest:sparkbutton:1.0.6'
implementation 'com.airbnb.android:lottie:3.6.1'
implementation 'com.github.glomadrian:Grav:1.1'
implementation 'hanks.xyz:htextview-library:0.1.5'
implementation 'androidx.constraintlayout:constraintlayout:2.0.4'
implementation 'com.intuit.sdp:sdp-android:1.0.6'
implementation 'io.saeid:fab-loading:1.0.0'
implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation 'com.balysv:material-ripple:1.0.2'
implementation 'de.hdodenhof:circleimageview:3.1.0'
}
解决方案
我猜,您可能没有安装 SDK 29。转到文件->设置->外观和行为->系统设置->Android SDK 检查 API 级别的特定版本,如果缺少,请安装它
推荐阅读
- java - Thymeleaf 和 SpringBoot 的 NoSuchMessageException
- swift - 楼梯问题 Swift 打印“#” n 和 n-1 次
- catboost - 在 catboostclassifier 中使用 class_weights
- apache-storm - 使用状态索引在 Stormcrawler 上运行多个拓扑
- javascript - For循环仅打印最后一次迭代
- azure - Azure 流分析作业 - 固定 1 小时窗口内的累计金额
- ios - 有什么方法可以避免 SwiftUI GeometryReader 阻止嵌套视图在列表中增长?
- java - 寻求有关编译器生成的 lambda 的文档,以将 Java 8 中的专用转换为通用功能对象
- html - 如何使下拉菜单向下打开而不是侧向打开?
- ios13 - 为什么 PKDrawing() != PKDrawing()?(铅笔盒)