Не удалось выполнить задачу ': cloud_firestore: compileDebugJavaWith Javac' - PullRequest
1 голос
/ 15 марта 2020

Мои извинения за то, что я задал вопрос, который уже был задан, причина в том, что я не получил его, может кто-нибудь помочь мне с этим

вот исключение, которое я получил Выполнение не выполнено для задачи ': cloud_firestore : compileDebugJavaWith Javac». и приложение не может запустить эмулятор

D:\flutter\.pub-cache\hosted\pub.dartlang.org\cloud_firestore-0.8.2+3\android\src\main\java\io\flutter\plugins\firebase\cloudfirestore\CloudFirestorePlugin.java:274: error: cannot find symbole\CloudFirestorePlugin.java:8: error: package android.support.annotation does not exist
import android.support.annotation.NonNull;
                                 ^
D:\flutter\.pub-cache\hosted\pub.dartlang.org\cloud_firestore-0.8.2+3\android\src\main\java\io\flutter\plugins\firebase\cloudfirestore\CloudFirestorePlugin.java:272: error: cannot find symbole\CloudFirestorePlugin.java:9: error: package android.support.annotation does not exist
import android.support.annotation.Nullable;
                                 ^
D:\flutter\.pub-cache\hosted\pub.dartlang.org\cloud_firestore-0.8.2+3\android\src\main\java\io\flutter\plugins\firebase\cloudfirestore\CloudFirestorePlugin.java:503: error: cannot find symbole\CloudFirestorePlugin.java:253: error: cannot find symbol
          public void onFailure(@NonNull Exception e) {
                                 ^
  symbol: class NonNull                                                                                                              e\CloudFirestorePlugin.java:558: error: cannot find symbol
D:\flutter\.pub-cache\hosted\pub.dartlang.org\cloud_firestore-0.8.2+3\android\src\main\java\io\flutter\plugins\firebase\cloudfirestore\CloudFirestorePlugin.java:274: error: cannot find symbol
                    public Void apply(@NonNull Transaction transaction)
                                       ^
  symbol: class NonNull
D:\flutter\.pub-cache\hosted\pub.dartlang.org\cloud_firestore-0.8.2+3\android\src\main\java\io\flutter\plugins\firebase\cloudfirestore\CloudFirestorePlugin.java:272: error: cannot find symbol
                    @Nullable
                     ^
  symbol: class Nullable
D:\flutter\.pub-cache\hosted\pub.dartlang.org\cloud_firestore-0.8.2+3\android\src\main\java\io\flutter\plugins\firebase\cloudfirestore\CloudFirestorePlugin.java:503: error: cannot find symbol
                    public void onFailure(@NonNull Exception e) {                                                                     full insights.
                                           ^
  symbol: class NonNull
D:\flutter\.pub-cache\hosted\pub.dartlang.org\cloud_firestore-0.8.2+3\android\src\main\java\io\flutter\plugins\firebase\cloudfirestore\CloudFirestorePlugin.java:558: error: cannot find symbol
                    public void onFailure(@NonNull Exception e) {
                                           ^
  symbol: class NonNull                                    
7 errors

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':cloud_firestore:compileDebugJavaWithJavac'.
> Compilation failed; see the compiler error output for details.


BUILD FAILED in 5s
Running Gradle task 'assembleDebug'...
Running Gradle task 'assembleDebug'... Done                         6.3s
The built failed likely due to AndroidX incompatibilities in a plugin. The tool is about to try using Jetfier to solve the incompatibility.
Building plugin cloud_firestore...
The plugin cloud_firestore could not be built due to the issue above.

ниже приведены зависимости и плагины в файле app / build.gradle


apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
apply plugin: 'com.google.gms.google-services'

android {
    compileSdkVersion 29

    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.smile"
        minSdkVersion 16
        targetSdkVersion 29
        multiDexEnabled true
        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 "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
    testImplementation 'junit:junit:4.12'
    androidTestImplementation 'androidx.test:runner:1.2.0'
    androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'

    implementation 'com.google.firebase:firebase-analytics:17.2.2'
}

ниже приведены зависимости в andriod / build.gradle

buildscript {
    ext.kotlin_version = '1.3.50'
    repositories {
        google()
        jcenter()
    }

    dependencies {
        classpath 'com.android.tools.build:gradle:3.6.1'
        classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
        classpath 'com.google.gms:google-services:4.3.3'
    }
}

allprojects {
    repositories {
        google()
        jcenter()
    }
}



Зависимости в pubspe c .yaml

dependencies:
  flutter:
    sdk: flutter
  carousel_pro: ^1.0.0
  firebase_auth: ^0.6.6 
  cloud_firestore: any
  google_sign_in: ^4.1.4
  shared_preferences: ^0.5.6+2
  fluttertoast: ^3.1.3
  provider: 3.0.0
  flutter_svg: ^0.17.3+1
Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...