賞金將在 4 天后到期。此問題的答案有資格獲得 50聲望賞金。 liam spiegel想引起更多關注這個問題:
我有一個錯誤,我希望有人能解決我的問題。解決我的問題的答案將獲得 50 分賞金 15 分因為接受 10 因為我贊成 - 總共 75 分
目前我有這個錯誤:
Microsoft Windows [Version 10.0.19043.1526]
(c) Microsoft Corporation. Alle Rechte vorbehalten.
C:\Users\Flutter\StudioProjects\nomadnet>flutter run
Using hardware rendering with device sdk gphone x86 arm. If you notice graphics artifacts, consider enabling software rendering with
"--enable-software-rendering".
Launching lib\main.dart on sdk gphone x86 arm in debug mode...
FAILURE: Build failed with an exception.
* Where:
Script 'C:\Users\Flutter\flutter_windows_2.10.1-stable\flutter\packages\flutter_tools\gradle\flutter.gradle' line: 421
* What went wrong:
A problem occurred evaluating root project 'android'.
> A problem occurred configuring project ':app'.
> Cannot run Project.afterEvaluate(Closure) when the project is already evaluated.
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
* Get more help at https://help.gradle.org
BUILD FAILED in 37s
Running Gradle task 'assembleDebug'... 38,8s
Exception: Gradle task assembleDebug failed with exit code 1
我已經嘗試過這些東西:
- https://stackoverflow.com/a/71014094/16241837
- https://stackoverflow.com/a/71009865/16241837
- 我也嘗試了更多的東西,但我不再認識它們了
我的代碼:
應用程式/build.gradle:
buildscript {
repositories {
// ...
maven { url 'https://plugins.gradle.org/m2/' } // Gradle Plugin Portal
}
dependencies {
// ...
// OneSignal-Gradle-Plugin
classpath 'gradle.plugin.com.onesignal:onesignal-gradle-plugin:[0.12.6, 0.99.99]'
}
}
apply plugin: 'com.onesignal.androidsdk.onesignal-gradle-plugin'
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"
def keystoreProperties = new Properties()
def keystorePropertiesFile = rootProject.file('key.properties')
if (keystorePropertiesFile.exists()) {
keystoreProperties.load(new FileInputStream(keystorePropertiesFile))
}
android {
compileSdkVersion 31
sourceSets {
main.java.srcDirs = 'src/main/kotlin'
}
defaultConfig {
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
applicationId "com.apps.social_circle"
minSdkVersion 20
targetSdkVersion 30
versionCode flutterVersionCode.toInteger()
versionName flutterVersionName
multiDexEnabled true
}
signingConfigs {
release {
keyAlias keystoreProperties['keyAlias']
keyPassword keystoreProperties['keyPassword']
storeFile keystoreProperties['storeFile'] ? file(keystoreProperties['storeFile']) : null
storePassword keystoreProperties['storePassword']
}
}
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.release
}
}
android {
defaultConfig {
manifestPlaceholders = [
onesignal_app_id: 'f0f22efa-186b-4b17-be29-f3f86e4d6184',
onesignal_google_project_number: 'REMOTE'
]
}
}
packagingOptions {
exclude 'AndroidManifest.xml' //This fixes a bug in FAN 5.0.1
}
}
flutter {
source '../..'
}
apply plugin: 'com.android.application'
apply plugin: 'com.google.gms.google-services'
dependencies {
implementation platform('com.google.firebase:firebase-bom:29.0.3')
implementation 'androidx.multidex:multidex:2.0.1'
implementation 'com.android.support:multidex:1.0.3'
implementation 'com.google.firebase:firebase-analytics'
// das ist für alle sachen sehr wichtig
implementation 'com.google.firebase:firebase-firestore'
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
implementation 'com.onesignal:OneSignal:3.2.4'
}
安卓/build.gradle:
buildscript {
ext.kotlin_version = '1.5.31'
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.google.gms:google-services:4.3.10'
classpath 'com.android.tools.build:gradle:4.1.0'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
}
}
allprojects {
repositories {
google()
jcenter()
}
}
rootProject.buildDir = '../build'
subprojects {
project.buildDir = "${rootProject.buildDir}/${project.name}"
project.evaluationDependsOn(':app')
}
task clean(type: Delete) {
delete rootProject.buildDir
}
我有最新的顫振版本和最新的顫振插件版本。
PS:我使用oneSignal。
請幫我!
uj5u.com熱心網友回復:
看起來這是 OneSignal Grandle 插件的一個已知問題。
Github OneSignal 問題
在討論中提出了一些解決方案,它們似乎破壞了 OneSignal 或引起更多問題。
其中兩個是:
- 在“android/app/build.gradle”中按順序放置一個信號插件。學分:Direnalex 評論
- 降級 Flutter 和 Kotlin。學分:Dgilperez 評論
我的建議是引起對 Github 問題的關注,以便 OneSignal 社區可以解決它。
轉載請註明出處,本文鏈接:https://www.uj5u.com/qukuanlian/434122.html
