Dev/Flutter

[Flutter] 오류 해결(기타)

healthyryu 2023. 6. 30. 11:32

* What went wrong:
A problem occurred configuring project ':firebase_core'.
> com.android.builder.errors.EvalIssueException: defaultConfig contains custom BuildConfig fields, but the feature is disabled.

 

해당 플러그인 라이브러리에 접근해서 build.gradle 에서 BuildConfig 를 사용할 수 있게 설정하면 된다

buildFeatures {
    buildConfig = true
}

 

 

Running Gradle task 'assembleDebug'...
../../.pub-cache/hosted/pub.dev/stream_chat_flutter_core-6.1.0/lib/src/stream_channel.dart:434:33: Error: 'DioError' isn't a type.
          if (snapshot.error is DioError) {
                                ^^^^^^^^
../../.pub-cache/hosted/pub.dev/stream_chat_flutter_core-6.1.0/lib/src/stream_channel.dart:435:48: Error: 'DioError' isn't a type.
            final dioError = snapshot.error as DioError?;
                                               ^^^^^^^^
../../.pub-cache/hosted/pub.dev/stream_chat_flutter_core-6.1.0/lib/src/stream_channel.dart:436:35: Error: The getter 'DioErrorType' isn't defined for the class 'StreamChannelState'.
 - 'StreamChannelState' is from 'package:stream_chat_flutter_core/src/stream_channel.dart' ('../../.pub-cache/hosted/pub.dev/stream_chat_flutter_core-6.1.0/lib/src/stream_channel.dart').
Try correcting the name to the name of an existing getter, or defining a getter or field named 'DioErrorType'.
            if (dioError?.type == DioErrorType.badResponse) {
                                  ^^^^^^^^^^^^
Target kernel_snapshot failed: Exception

 

StreamChat 라이브러리와 Dio 라이브러리의 버전이 호환되지 않은 문제라서 StreamChat 버전을 최신 버전으로 유지하면 된다.

 

 

 

 

 

 

* What went wrong:
A problem occurred configuring project ':image_gallery_saver'.
> Could not create an instance of type com.android.build.api.variant.impl.LibraryVariantBuilderImpl.
   > Namespace not specified. Please specify a namespace in the module's build.gradle file like so:

     android {
         namespace 'com.example.namespace'
     }

     If the package attribute is specified in the source AndroidManifest.xml, it can be migrated automatically to the namespace value in the build.gradle file using the AGP Upgrade Assistant; please refer to https://developer.android.com/studio/build/agp-upgrade-assistant for more information.

 

build.gradle 파일에 접근해서 패키지명대로 namespace 를 정의해주면 된다.

android {
     namespace 'com.example.namespace'
 }
반응형