AbdulSamad
AbdulSamad

Reputation: 1

I am facing error while running flutter project, There are 2 main issues 1st is saying "A problem occured in configuring project flutter_inappwebview"

I am facing this error in my flutter project. FAILURE: Build failed with an exception.

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.

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 5s Running Gradle task 'assembleDebug'... 6.7s Error: Gradle task assembleDebug failed with exit code 1

Here is my pubspec.yaml file

name: partner
description: "Scounts Project newer one"
publish_to: 'none'

version: 1.0.0+1

environment:
  sdk: ^3.6.0-334.3.beta

dependencies:
  app_settings: ^5.1.0
  cached_network_image: ^3.2.3
  cloud_firestore: ^5.4.0
  device_preview: ^1.2.0
  firebase_auth: ^5.2.0
  firebase_core: ^3.4.0
  firebase_database: ^11.1.1
  firebase_messaging: ^15.1.0
  firebase_storage: ^12.2.0
  flutter:
    sdk: flutter

  flutter_keyboard_visibility: ^6.0.0
  flutter_launcher_icons: ^0.14.1
  flutter_local_notifications: ^18.0.1
  flutter_native_splash: ^2.2.22
  flutter_svg: ^2.0.7
  go_router: ^14.2.7
  google_sign_in: ^6.1.6
  group_select: ^1.5.1
  icons_plus: ^5.0.0
  image_picker: ^1.0.5
  intl: ^0.19.0
  provider: ^6.1.2

  rate_my_app: ^2.2.0
  share_plus: ^10.0.1
  shared_preferences: ^2.1.4
  streaming_shared_preferences: ^2.0.0
  url_launcher: ^6.1.12
  webview_flutter: ^4.2.2
  youtube_player_flutter: ^8.1.2

  firebase_dynamic_links: any

  crisp: any
  cupertino_icons: ^1.0.8

dev_dependencies:
  flutter_test:
    sdk: flutter


  flutter_lints: ^5.0.0


flutter:

  uses-material-design: true

  assets:
    - assets/images/
    - assets/svgs/
    - assets/fonts/
    - assets/

  fonts:
    - family: Inter-SemiBold
      fonts:
        - asset: assets/fonts/Inter-SemiBold.ttf

    - family: Inter-Medium
      fonts:
        - asset: assets/fonts/Inter-Medium.ttf

    - family: Inter-Regular
      fonts:
        - asset: assets/fonts/Inter-Regular.ttf

Here is my Manifiest file

<manifest xmlns:android="http://schemas.android.com/apk/res/android">
    <uses-permission android:name="android.permission.RECORD_AUDIO" />
    <uses-permission android:name="android.permission.INTERNET" />
    <queries>
        <package android:name="com.whatsapp" />
    </queries>
    <application
        android:label="partner"
        android:name="${applicationName}"
        android:icon="@mipmap/ic_launcher"
        android:usesCleartextTraffic="true">
        <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" />
        <provider
            android:name="com.pichillilorenzo.flutter_inappwebview.InAppWebViewFileProvider"
            android:authorities="${applicationId}.flutter_inappwebview.fileprovider"
            android:exported="false"
            android:grantUriPermissions="true">
            <meta-data
                android:name="android.support.FILE_PROVIDER_PATHS"
                android:resource="@xml/provider_paths" />
        </provider>
    </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>

I have tried a new project and copying resources files but still same error, I think error is in my dependencies versions, I have to upgrade them but it say they are not compitable with other.

I check on web of flutter there were same issue dicussed and they have answered that upgrade version of flutter_inappwebview to 6 but in my case as I mentioned that it shows error that it is not compitable with others.

Upvotes: 0

Views: 52

Answers (0)

Related Questions