1. Anuncie Aqui ! Entre em contato fdantas@4each.com.br

[Flutter] Issue with agora_rtm in Flutter

Discussão em 'Mobile' iniciado por Stack, Outubro 1, 2024 às 08:43.

  1. Stack

    Stack Membro Participativo

    Launching lib/main.dart on sdk gphone x86 in debug mode...

    FAILURE: Build failed with an exception.

    • What went wrong: A problem occurred configuring project ':agora_rtm'.

    Could not create an instance of type com.android.build.api.variant.impl.LibraryVariantBuilderImpl. Namespace not specified. Specify a namespace in the module's build file. See https://d.android.com/r/tools/upgrade-assistant/set-namespace for information about setting the namespace.

    If you've specified the package attribute in the source AndroidManifest.xml, you can use the AGP Upgrade Assistant to migrate to the namespace value in the build file. Refer to https://d.android.com/r/tools/upgrade-assistant/agp-upgrade-assistant for general information about using the AGP Upgrade Assistant.

    • 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 1s Error: Gradle task assembleDebug failed with exit code 1

    Exited (1).

    android/app/src/main/AndroidManifest.xml


    <manifest xmlns:android="http://schemas.android.com/apk/res/android">
    <application
    android:label="babble"
    android:name="${applicationName}"
    android:icon="@mipmap/ic_launcher">
    <activity
    android:name=".MainActivity"
    android:exported="true"
    android:launchMode="singleTop"
    android:taskAffinity=""
    android:theme="@style/LaunchTheme"
    android:configChanges="orientation|keyboardHidden|keyboard|screenSize|smallestScreenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode"
    android:hardwareAccelerated="true"
    android:windowSoftInputMode="adjustResize">
    <!-- 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. -->
    <meta-data
    android:name="io.flutter.embedding.android.NormalTheme"
    android:resource="@style/NormalTheme"
    />
    <intent-filter>
    <action android:name="android.intent.action.MAIN"/>
    <category android:name="android.intent.category.LAUNCHER"/>
    </intent-filter>
    </activity>
    <!-- Don't delete the meta-data below.
    This is used by the Flutter tool to generate GeneratedPluginRegistrant.java -->
    <meta-data
    android:name="flutterEmbedding"
    android:value="2" />
    </application>
    <!-- Required to query activities that can process text, see:
    https://developer.android.com/training/package-visibility and
    https://developer.android.com/reference/android/content/Intent#ACTION_PROCESS_TEXT.

    In particular, this is used by the Flutter engine in io.flutter.plugin.text.ProcessTextPlugin. -->
    <queries>
    <intent>
    <action android:name="android.intent.action.PROCESS_TEXT"/>
    <data android:mimeType="text/plain"/>
    </intent>
    </queries>
    </manifest>

    android/app/build.gradle


    plugins {
    id "com.android.application"
    // START: FlutterFire Configuration
    id 'com.google.gms.google-services'
    // END: FlutterFire Configuration
    id "kotlin-android"
    // The Flutter Gradle Plugin must be applied after the Android and Kotlin Gradle plugins.
    id "dev.flutter.flutter-gradle-plugin"
    }

    android {
    namespace = "com.example.babble"
    compileSdk = flutter.compileSdkVersion
    ndkVersion = flutter.ndkVersion

    compileOptions {
    sourceCompatibility = JavaVersion.VERSION_1_8
    targetCompatibility = JavaVersion.VERSION_1_8
    }

    kotlinOptions {
    jvmTarget = JavaVersion.VERSION_1_8
    }

    defaultConfig {
    // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
    applicationId = "com.example.babble"
    // You can update the following values to match your application needs.
    // For more information, see: https://flutter.dev/to/review-gradle-config.
    minSdk = 23
    targetSdk = flutter.targetSdkVersion
    versionCode = flutter.versionCode
    versionName = flutter.versionName
    }

    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 = "../.."
    }


    I tried installing the agora_rtm dependency from pub.dev, I tried

    flutter clean
    flutter pub get
    flutter run


    Nothing is working, please help me out.

    Continue reading...

Compartilhe esta Página