Проблемы с флаттером в плагине Google для мобильных объявлений

#android #flutter #dart #ads #google-ads-api

Вопрос:

Я хотел бы знать, почему эти ошибки и как их решить, когда я использую flutter run, flutter возвращает эти ошибки:

 Launching libmain.dart on BISON in debug mode... Warning: Mapping new ns http://schemas.android.com/repository/android/common/02 to old ns http://schemas.android.com/repository/android/common/01 Warning: Mapping new ns http://schemas.android.com/repository/android/generic/02 to old ns http://schemas.android.com/repository/android/generic/01 Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/addon2/02 to old ns http://schemas.android.com/sdk/android/repo/addon2/01  Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/repository2/02 to old ns http://schemas.android.com/sdk/android/repo/repository2/01 Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/sys-img2/02 to old ns http://schemas.android.com/sdk/android/repo/sys-img2/01  Formato de par�metros incorreto - Note: Some input files use or override a deprecated API. Note: Recompile with -Xlint:deprecation for details. Note: Some input files use unchecked or unsafe operations. Note: Recompile with -Xlint:unchecked for details. Note: C:srcflutter.pub-cachehostedpub.dartlang.orgpath_provider_android-2.0.9androidsrcmainjavaioflutterpluginspathproviderPathProviderPlugin.java uses unchecked or unsafe operations. Note: Recompile with -Xlint:unchecked for details. e: C:/Users/Arthur Alland/.gradle/caches/transforms-2/files-2.1/ae449724a6ca38888aadaf690b25af94/work-runtime-2.7.0-api.jar!/META-INF/work-runtime_release.kotlin_module: Module was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.5.1, expected version  is 1.1.15.  FAILURE: Build failed with an exception.  * What went wrong: Execution failed for task ':app:compileDebugKotlin'. gt; Compilation error. See log for more details  * 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 6m 1s Running Gradle task 'assembleDebug'... 365,1s Exception: Gradle task assembleDebug failed with exit code 1  

Градуировка сборки Android

 buildscript {  ext.kotlin_version = '1.3.50'  repositories {      google()    jcenter()  }    dependencies {  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}" } subprojects {  project.evaluationDependsOn(':app') }  task clean(type: Delete) {  delete rootProject.buildDir }  

Свойства оболочки Gradle

 distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists distributionUrl=https://services.gradle.org/distributions/gradle-6.7.1-all.zip  

Манифест Android

 lt;manifest xmlns:android="http://schemas.android.com/apk/res/android"  package="com.example.you_plan"gt;  lt;!-- 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. --gt;  lt;application  android:name="io.flutter.app.FlutterApplication"  android:label="you_plan"  android:icon="@mipmap/ic_launcher"gt;  lt;activity    android:name=".MainActivity"    android:launchMode="singleTop"  android:theme="@style/LaunchTheme"  android:configChanges="orientation|keyboardHidden|keyboard|screenSize|smallestScreenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode"  android:hardwareAccelerated="true"  android:windowSoftInputMode="adjustResize"gt;  lt;!-- Specifies an Android theme to apply to this Activity as soon as  the Android process has started. This theme is visible to the user  while the Flutter UI initializes. After that, this theme continues  to determine the Window background behind the Flutter UI. --gt;    lt;meta-data  android:name="io.flutter.embedding.android.NormalTheme"  android:resource="@style/NormalTheme"  /gt;  lt;!-- Displays an Android View that continues showing the launch screen  Drawable until Flutter paints its first frame, then this splash  screen fades out. A splash screen is useful to avoid any visual  gap between the end of Android's launch screen and the painting of  Flutter's first frame. --gt;  lt;meta-data  android:name="io.flutter.embedding.android.SplashScreenDrawable"  android:resource="@drawable/launch_background"  /gt;    lt;intent-filtergt;  lt;action android:name="android.intent.action.MAIN"/gt;  lt;category android:name="android.intent.category.LAUNCHER"/gt;  lt;/intent-filtergt;  lt;/activitygt;  lt;!-- Don't delete the meta-data below.  This is used by the Flutter tool to generate GeneratedPluginRegistrant.java --gt;  lt;meta-data  android:name="flutterEmbedding"  android:value="2" /gt;  lt;meta-data  android:name="com.google.android.gms.ads.APPLICATION_ID"  android:value="ca-app-pub-3940256099942544~3347511713"/gt;  lt;/applicationgt; lt;/manifestgt;  

Я несколько раз гуглил, и проблема, похоже, связана с этими файлами Android, но у меня мало опыта работы с Android

Комментарии:

1. Сталкиваюсь с той же проблемой !

2. Я выяснил, что проблема была связана с тем, что некоторые плагины устарели.