gpt4 book ai didi

android - 未找到 ID 为 'com.android.application' 的插件

转载 作者:行者123 更新时间:2023-12-03 04:27:08 24 4
gpt4 key购买 nike

我有一个旧项目,我在我的 Android 工作室中导入了这个项目,我收到了这个错误。
是的,我从互联网上搜索过,我找到了很多解决方案,但没有一个解决了我的问题。

这是我的 build.gradle 文件

// Top-level build file where you can add configuration options common to all sub-projects/modules.


buildscript {
repositories {
jcenter()
}
apply plugin: 'com.android.application'

dependencies {
classpath 'com.android.tools.build:gradle:2.2.1'

// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}

allprojects {
repositories {
jcenter()
}
}

task clean(type: Delete) {
delete rootProject.buildDir
}

这是我的模块级 build.gradle
这是我在 app>src>build.gradle 下的 build.gradle
apply plugin: 'com.android.application'
//apply plugin: 'com.google.gms.google-services'

android {
compileSdkVersion 23
buildToolsVersion '23.0.1'
defaultConfig {
applicationId "com.pedrocarrillo.expensetracker"
minSdkVersion 16
targetSdkVersion 23
versionCode 3
versionName "1.2"
}

signingConfigs {
release {
def Properties localProps = new Properties()
localProps.load(new FileInputStream(file('../local.properties')))
storeFile file("tracker_expense.jks")
storePassword localProps["storePass"]
keyAlias localProps["alias"]
keyPassword localProps["pass"]
}
}

buildTypes {
release {
signingConfig signingConfigs.release
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'),
'proguard-rules.pro'
}
}
}

repositories {
maven { url "https://jitpack.io" }
}

dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
testCompile 'junit:junit:4.12'
// compile 'com.google.android.gms:play-services:7.8.0'
compile 'com.android.support:gridlayout-v7:23.0.1'
compile 'com.android.support:support-annotations:23.0.1'
compile 'com.android.support:appcompat-v7:23.0.1'
compile 'com.android.support:design:23.0.1'
compile 'com.android.support:recyclerview-v7:23.0.1'
compile 'com.android.support:cardview-v7:23.0.1'
compile 'fr.avianey.com.viewpagerindicator:library:2.4.1@aar'
compile 'io.realm:realm-android:0.82.2'
compile 'com.github.PhilJay:MPAndroidChart:v2.1.4'
}

最佳答案

试试这个:项目级 Gradle 文件 ...

// Top-level build file where you can add configuration options common to all sub-projects/modules.


buildscript {
repositories {
jcenter()
}

dependencies {
classpath 'com.android.tools.build:gradle:2.2.1'

// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}

allprojects {
repositories {
jcenter()
}
}

task clean(type: Delete) {
delete rootProject.buildDir
}

模块级 Gradle 文件 ...
apply plugin: 'com.android.application'
//apply plugin: 'com.google.gms.google-services'

android {
compileSdkVersion 23
buildToolsVersion '23.0.1'
defaultConfig {
applicationId "com.pedrocarrillo.expensetracker"
minSdkVersion 16
targetSdkVersion 23
versionCode 3
versionName "1.2"
}

signingConfigs {
release {
def Properties localProps = new Properties()
localProps.load(new FileInputStream(file('../local.properties')))
storeFile file("tracker_expense.jks")
storePassword localProps["storePass"]
keyAlias localProps["alias"]
keyPassword localProps["pass"]
}
}

buildTypes {
release {
signingConfig signingConfigs.release
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}


dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
testCompile 'junit:junit:4.12'
// compile 'com.google.android.gms:play-services:7.8.0'
compile 'com.android.support:gridlayout-v7:23.0.1'
compile 'com.android.support:support-annotations:23.0.1'
compile 'com.android.support:appcompat-v7:23.0.1'
compile 'com.android.support:design:23.0.1'
compile 'com.android.support:recyclerview-v7:23.0.1'
compile 'com.android.support:cardview-v7:23.0.1'
compile 'fr.avianey.com.viewpagerindicator:library:2.4.1@aar'
compile 'io.realm:realm-android:0.82.2'
compile 'com.github.PhilJay:MPAndroidChart:v2.1.4'
}

关于android - 未找到 ID 为 'com.android.application' 的插件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45335248/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com