问题描述
大家好,我刚刚在Flutter中创建了一个新项目,当我运行Flutter时,它就像manisfest一样出现问题,我已经尝试了一些可用的解决方案,但没有一个解决此问题的。 所以请有人帮我 这是我的build.gradle
def localProperties = new Properties()
def localPropertiesFile = rootProject.file('local.properties')
if (localPropertiesFile.exists()) {
localPropertiesFile.withReader('UTF-8') { reader ->
localProperties.load(reader)
}
}
def FlutterRoot = localProperties.getProperty('Flutter.sdk')
if (FlutterRoot == null) {
throw new GradleException("Flutter SDK not found. Define location with Flutter.sdk in the
local.properties file.")
}
def FlutterVersionCode = localProperties.getProperty('Flutter.versionCode')
if (FlutterVersionCode == null) {
FlutterVersionCode = '1'
}
def FlutterVersionName = localProperties.getProperty('Flutter.versionName')
if (FlutterVersionName == null) {
FlutterVersionName = '1.0'
}
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply from: "$FlutterRoot/packages/Flutter_tools/gradle/Flutter.gradle"
android {
compileSdkVersion 28
sourceSets {
main.java.srcDirs += 'src/main/kotlin'
}
lintOptions {
disable 'InvalidPackage'
}
defaultConfig {
// Todo: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
applicationId "com.example.kezenli"
minSdkVersion 21
targetSdkVersion 28
versionCode FlutterVersionCode.toInteger()
versionName FlutterVersionName
testInstrumentationRunner "androidx.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 {
implementation filetree(dir: 'libs',include: ['*.jar'])
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
testImplementation 'junit:junit:4.12'
androidTestImplementation 'androidx.test:runner:1.1.1'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.1'
}
文件manifest.xml
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.appname">
<!-- Flutter needs it to communicate with the running application
to allow setting breakpoints,to provide hot reload,etc.
-->
<uses-permission android:name="android.permission.INTERNET"/>
</manifest>
FAILURE: Build Failed with an exception.
* What went wrong:
Execution Failed for task ':app:processDebugManifest'.
> Could not resolve all files for configuration ':app:debugRuntimeClasspath'.
> Failed to transform swiperefreshlayout-1.0.0.aar
(androidx.swiperefreshlayout:swiperefreshlayout:1.0.0) to match attributes {artifactType=android-
manifest,org.gradle.status=release}.
> Execution Failed for AarTransform: C:\Users\user$\.gradle\caches\transforms-2\files-
2.1\1985ed3c8e3f3cab039e01f836007b0d\swiperefreshlayout-1.0.0.
> Cannot parse result path string:
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)