“如何修复”;Android SDK构建工具版本(27.0.3)被忽略;
我正在申请颤振。我已连接地图视图:^0.0.14在地图上绘制道路,但出现以下错误:“如何修复”;Android SDK构建工具版本(27.0.3)被忽略;,android,flutter,android-gradle-plugin,build.gradle,Android,Flutter,Android Gradle Plugin,Build.gradle,我正在申请颤振。我已连接地图视图:^0.0.14在地图上绘制道路,但出现以下错误: 运行Gradle时出错:ProcessException:进程“C:\Users\admin\AndroidStudioProjects\Advertised\android\gradlew.bat” 异常退出: 配置项目:应用程序registerResGeneratingTask已弃用,请使用registerGeneratedResFolders(文件集合)registerResGeneratingTask
- 运行Gradle时出错:ProcessException:进程“C:\Users\admin\AndroidStudioProjects\Advertised\android\gradlew.bat” 异常退出:
- 出了什么问题:Android Gradle插件只支持Kotlin Gradle插件版本1.2.51及更高版本。项目“地图视图”正在使用 版本1.2.50
- 尝试:使用--stacktrace选项运行以获取堆栈跟踪。使用--info或--debug选项运行以获得更多日志输出。使用--scan运行以获得完整的洞察力
- 得到更多的帮助
apply plugin: 'com.android.application'
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
android {
compileSdkVersion 28
buildToolsVersion "28.0.3"
lintOptions {
disable 'InvalidPackage'
}
defaultConfig {
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
applicationId "com.example.advertise"
minSdkVersion 16
targetSdkVersion 28
versionCode flutterVersionCode.toInteger()
versionName flutterVersionName
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
// TODO: Add your own signing config for the release build.
// Signing with the debug keys for now, so `flutter run --release` works.
signingConfig signingConfigs.debug
}
}
}
flutter {
source '../..'
}
dependencies {
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
implementation 'com.google.firebase:firebase-core:16.0.9'
}
apply plugin: 'com.google.gms.google-services'
build.gradle:
buildscript {
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.2.1'
classpath 'com.google.gms:google-services:4.2.0'
classpath 'org.jetbrains.kotlin:kotlin-gradle-plugin:1.2.51'
}
}
allprojects {
repositories {
google()
jcenter()
}
}
rootProject.buildDir = '../build'
subprojects {
project.buildDir = "${rootProject.buildDir}/${project.name}"
}
subprojects {
project.evaluationDependsOn(':app')
}
task clean(type: Delete) {
delete rootProject.buildDir
}
AndroidManifest.xml
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.advertise">
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"/>
<!-- io.flutter.app.FlutterApplication is an android.app.Application that
calls FlutterMain.startInitialization(this); in its onCreate method.
In most cases you can leave this as-is, but you if you want to provide
additional functionality it is fine to subclass or reimplement
FlutterApplication and put your custom class here. -->
<application
android:name="io.flutter.app.FlutterApplication"
android:label="advertise"
android:icon="@mipmap/ic_launcher">
<meta-data android:name="com.google.android.maps.v2.API_KEY" android:value="xxxxxxxxxxxxxxxxxxxxxx"/>
<meta-data android:name="com.google.android.gms.version" android:value="@integer/google_play_services_version"/>
<meta-data android:name="com.google.android.geo.API_KEY"
android:value="xxxxxxxxxxxxxxxxxxxxxxxxxxx"/>
<activity android:name="com.apptreesoftware.mapview.MapActivity" android:theme="@style/Theme.AppCompat.Light.DarkActionBar"/>
<activity
android:name=".MainActivity"
android:launchMode="singleTop"
android:theme="@style/LaunchTheme"
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode"
android:hardwareAccelerated="true"
android:windowSoftInputMode="adjustResize">
<!-- This keeps the window background of the activity showing
until Flutter renders its first frame. It can be removed if
there is no splash screen (such as the default splash screen
defined in @style/LaunchTheme). -->
<meta-data
android:name="io.flutter.app.android.SplashScreenUntilFirstFrame"
android:value="true" />
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
</intent-filter>
</activity>
<meta-data android:name="com.facebook.sdk.ApplicationId" android:value="@string/facebook_app_id"/>
<activity android:name="com.facebook.FacebookActivity"
android:configChanges=
"keyboard|keyboardHidden|screenLayout|screenSize|orientation" android:label="@string/app_name" />
<activity android:name="com.facebook.CustomTabActivity" android:exported="true">
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data android:scheme="@string/fb_login_protocol_scheme" />
</intent-filter>
</activity>
</application>
</manifest>
从这里很难确定,但我可以建议您: 增加SDK的最低版本:
minSdkVersion 16
致:
IDE通常会对build.gradle
中的Kotlin
版本发出警告。尝试通过IDE推荐来修复它。它可能会说更新到'1.3.21'
等
玩游戏gradle
版本:
classpath 'com.android.tools.build:gradle:3.2.1'
尝试:
3.3.0
,3.0.1
,3.4.1
在buildgradel:库更改BuildTools版本:'27.0.3'到'28.0.3',并修复我的警告,谢谢您的帮助。它与gradle版本配合使用:classpath'com.android.tools.build:gradle:3.0.1'
classpath 'com.android.tools.build:gradle:3.2.1'