Build failed after installing firebase - android

Just started Flutter course from freecodecamp and can't resolve this problem for couple of hours... I have installed firebase plugins, all are in pubspec.yaml
firebase_core: ^1.17.1
firebase_auth: ^3.3.19
cloud_firestore: ^3.1.17
firebase_analytics: ^9.1.9
like in course video have to change in android/app/build.gradle
defaultConfig {minSdkVersion 19 and add
multiDexEnlabed true}
its and dependency
dependencies{
implementation 'com.android.support:multidex:1.0.3'}
in course it goes well but i have this issue:
Launching lib\main.dart on ONEPLUS A6003 in debug mode...
lib\main.dart:1
FAILURE: Build failed with an exception.
* Where:
Build file 'C:\dev\projects flutter\notatki\android\app\build.gradle' line: 28
* What went wrong:
A problem occurred evaluating project ':app'.
> No signature of method: build_9s4pif6pkcf99jbjr51rbhd01.android() is applicable for argument types: (build_9s4pif6pkcf99jbjr51rbhd01$_run_closure2) values: [build_9s4pif6pkcf99jbjr51rbhd01$_run_closure2#6e3389a0]
* 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
Exception: Gradle task assembleDebug failed with exit code 1
Exited (sigterm)
when i run app in flutter run -v in terminal it gives me some more:
#0 throwToolExit (package:flutter_tools/src/base/common.dart:10:3)
#1 RunCommand.runCommand (package:flutter_tools/src/commands/run.dart:699:9)
<asynchronous suspension>
#2 FlutterCommand.run.<anonymous closure> (package:flutter_tools/src/runner/flutter_command.dart:1183:27)
<asynchronous suspension>
#3 AppContext.run.<anonymous closure> (package:flutter_tools/src/base/context.dart:150:19)
<asynchronous suspension>
#4 CommandRunner.runCommand (package:args/command_runner.dart:209:13)
<asynchronous suspension>
#5 FlutterCommandRunner.runCommand.<anonymous closure>
(package:flutter_tools/src/runner/flutter_command_runner.dart:281:9)
<asynchronous suspension>
#6 AppContext.run.<anonymous closure> (package:flutter_tools/src/base/context.dart:150:19)
<asynchronous suspension>
#7 FlutterCommandRunner.runCommand (package:flutter_tools/src/runner/flutter_command_runner.dart:229:5)
<asynchronous suspension>
#8 run.<anonymous closure>.<anonymous closure> (package:flutter_tools/runner.dart:62:9)
<asynchronous suspension>
#9 AppContext.run.<anonymous closure> (package:flutter_tools/src/base/context.dart:150:19)
<asynchronous suspension>
#10 main (package:flutter_tools/executable.dart:94:3)
<asynchronous suspension>
Was trying to change minSdkVersion, target, compile, changing versions of firebase (in dependency, was not downloading it.....) all not work.
But when i'll comment out all installed firebase dependences, multiDexEnlabed true and this implementation 'com.android.support:multidex:1.0.3'
this demo application just works fine

Related

I face that error when i use url lancher packege in flutter

I try to run a url using url lancher package
https://pub.dev/packages/url_launcher
and i got this error , i use a package to display my app over apps , using that package https://pub.dev/packages/flutter_overlay_window , and i added a button inside the overlay and when i press it it supposed to send a message to whatsapp using url lancher package , but the problem is that when your app is over apps you will get that error :
E/flutter (24166): [ERROR:flutter/lib/ui/ui_dart_state.cc(209)] Unhandled Exception: PlatformException(NO_ACTIVITY, Launching a URL requires a foreground activity., null, null)
E/flutter (24166): #0 StandardMethodCodec.decodeEnvelope (package:flutter/src/services/message_codecs.dart:607:7)
E/flutter (24166): #1 MethodChannel._invokeMethod (package:flutter/src/services/platform_channel.dart:177:18)E/flutter (24166): <asynchronous suspension>
E/flutter (24166): #2 launchUrlString (package:url_launcher/src/url_launcher_string.dart:39:10)
E/flutter (24166): <asynchronous suspension>
E/flutter (24166): #3 launchUrl (package:url_launcher/src/url_launcher_uri.dart:57:10)

Dart Unhandled Exception: MissingPluginException(No implementation found for method getAll

Error :
[ERROR:flutter/lib/ui/ui_dart_state.cc(209)] Unhandled Exception: MissingPluginException(No implementation found for method getAll on channel dev.fluttercommunity.plus/package_info)
#0 MethodChannel._invokeMethod (package:flutter/src/services/platform_channel.dart:175:7)
<asynchronous suspension>
#1 MethodChannel.invokeMapMethod (package:flutter/src/services/platform_channel.dart:377:43)
<asynchronous suspension>
#2 MethodChannelPackageInfo.getAll (package:package_info_plus_platform_interface/method_channel_package_info.dart:13:17)
<asynchronous suspension>
#3 PackageInfo.fromPlatform (package:package_info_plus/package_info_plus.dart:36:26)
<asynchronous suspension>
I don't know where this error come from
Face the same issue while using
package_info_plus: ^3.0.2
Issue solved after completely restart the app/service

Could not resolve all files for configuration ':app:debugRuntimeClasspath'. Could not resolve com.moengage:moe-android-sdk:4.0.2

I am working on moengage push notification following this documentation but when i run the program getting this error 403 forbidden. I
I have added these things I am working on flutter
I think the error is in build.gradle i am not sure but their the logs are pointing out their
This is my gradle
dependencies {
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
testImplementation 'junit:junit:4.13.1'
androidTestImplementation 'androidx.test:runner:1.3.0'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0'
implementation 'com.android.support:multidex:1.0.3'
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation("androidx.core:core:1.3.1")
implementation("androidx.appcompat:appcompat:1.2.0")
implementation("androidx.lifecycle:lifecycle-process:2.2.0")
implementation 'com.moengage:moe-android-sdk:4.0.2'
}
[ +169 ms] FAILURE: Build failed with an exception.
[ +3 ms] * What went wrong:
[ ] Execution failed for task ':app:checkDebugAarMetadata'.
[ ] > Could not resolve all files for configuration ':app:debugRuntimeClasspath'.
[ ] > Could not resolve com.moengage:moe-android-sdk:4.0.2.
[ ] Required by:
[ ] project :app
[ ] > Could not resolve com.moengage:moe-android-sdk:4.0.2.
[ ] > Could not get resource 'https://google.bintray.com/exoplayer/com/moengage/moe-android-sdk/4.0.2/moe-android-sdk-4.0.2.pom'.
[ ] > Could not GET 'https://google.bintray.com/exoplayer/com/moengage/moe-android-sdk/4.0.2/moe-android-sdk-4.0.2.pom'. Received status code 403 from server: Forbidden
[ ] * 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 59s
[ ] Deprecated Gradle features were used in this build, making it incompatible with Gradle 7.0.
[ ] Use '--warning-mode all' to show the individual deprecation warnings.
[ ] See https://docs.gradle.org/6.5/userguide/command_line_interface.html#sec:command_line_warnings
[ ] 44 actionable tasks: 1 executed, 43 up-to-date
[{"event":"app.progress","params":{"appId":"ee2fcf31-806c-45e7-b1c0-096b42b571ce","id":"0","progressId":null,"finished":true}}]
[ +622 ms] Exception: Gradle task assembleDebug failed with exit code 1
[ +5 ms]
#0 throwToolExit (package:flutter_tools/src/base/common.dart:10:3)
#1 RunCommand.runCommand (package:flutter_tools/src/commands/run.dart:563:9)
<asynchronous suspension>
#2 FlutterCommand.run.<anonymous closure> (package:flutter_tools/src/runner/flutter_command.dart:1043:27)
<asynchronous suspension>
#3 AppContext.run.<anonymous closure> (package:flutter_tools/src/base/context.dart:150:19)
<asynchronous suspension>
#4 CommandRunner.runCommand (package:args/command_runner.dart:196:13)
<asynchronous suspension>
#5 FlutterCommandRunner.runCommand.<anonymous closure> (package:flutter_tools/src/runner/flutter_command_runner.dart:284:9)
<asynchronous suspension>
#6 AppContext.run.<anonymous closure> (package:flutter_tools/src/base/context.dart:150:19)
<asynchronous suspension>
#7 FlutterCommandRunner.runCommand (package:flutter_tools/src/runner/flutter_command_runner.dart:232:5)
<asynchronous suspension>
#8 run.<anonymous closure>.<anonymous closure> (package:flutter_tools/runner.dart:62:9)
<asynchronous suspension>
#9 AppContext.run.<anonymous closure> (package:flutter_tools/src/base/context.dart:150:19)
<asynchronous suspension>
#10 main (package:flutter_tools/executable.dart:91:3)
<asynchronous suspension>
[{"event":"app.stop","params":{"appId":"ee2fcf31-806c-45e7-b1c0-096b42b571ce"}}]
[ +24 ms] "flutter run" took 62,936ms.
[{"id":0,"error":"app 'ee2fcf31-806c-45e7-b1c0-096b42b571ce' not found","trace":"#0 AppDomain.stop (package:flutter_tools/src/commands/daemon.dart:709:7)\n#1 Domain.handleCommand.<anonymous closure> (package:flutter_tools/src/commands/daemon.dart:220:34)\n#2 new Future.sync (dart:async/future.dart:218:31)\n#3 Domain.handleCommand (package:flutter_tools/src/commands/daemon.dart:218:5)\n#4 Daemon._handleRequest (package:flutter_tools/src/commands/daemon.dart:144:28)\n#5 _rootRunUnary (dart:async/zone.dart:1362:47)\n#6 _CustomZone.runUnary (dart:async/zone.dart:1265:19)\n#7 _CustomZone.runUnaryGuarded (dart:async/zone.dart:1170:7)\n#8 _BufferingStreamSubscription._sendData (dart:async/stream_impl.dart:341:11)\n#9 _BufferingStreamSubscription._add (dart:async/stream_impl.dart:271:7)\n#10 _ForwardingStreamSubscription._add (dart:async/stream_pipe.dart:123:11)\n#11 _MapStream._handleData (dart:async/stream_pipe.dart:218:10)\n#12 _ForwardingStreamSubscription._handleData (dart:async/stream_pipe.dart:153:13)\n#13 _rootRunUnary (dart:async/zone.dart:1362:47)\n#14 _CustomZone.runUnary (dart:async/zone.dart:1265:19)\n#15 _CustomZone.runUnaryGuarded (dart:async/zone.dart:1170:7)\n#16 _BufferingStreamSubscription._sendData (dart:async/stream_impl.dart:341:11)\n#17 _BufferingStreamSubscription._add (dart:async/stream_impl.dart:271:7)\n#18 _ForwardingStreamSubscription._add (dart:async/stream_pipe.dart:123:11)\n#19 _WhereStream._handleData (dart:async/stream_pipe.dart:195:12)\n#20 _ForwardingStreamSubscription._handleData (dart:async/stream_pipe.dart:153:13)\n#21 _rootRunUnary (dart:async/zone.dart:1362:47)\n#22 _CustomZone.runUnary (dart:async/zone.dart:1265:19)\n#23 _CustomZone.runUnaryGuarded (dart:async/zone.dart:1170:7)\n#24 _BufferingStreamSubscription._sendData (dart:async/stream_impl.dart:341:11)\n#25 _BufferingStreamSubscription._add (dart:async/stream_impl.dart:271:7)\n#26 _SinkTransformerStreamSubscription._add (dart:async/stream_transformers.dart:63:11)\n#27 _EventSinkWrapper.add (dart:async/stream_transformers.dart:13:11)\n#28 _StringAdapterSink.add (dart:convert/string_conversion.dart:238:11)\n#29 _LineSplitterSink._addLines (dart:convert/line_splitter.dart:155:13)\n#30 _LineSplitterSink.addSlice (dart:convert/line_splitter.dart:130:5)\n#31 StringConversionSinkMixin.add (dart:convert/string_conversion.dart:163:5)\n#32 _SinkTransformerStreamSubscription._handleData (dart:async/stream_transformers.dart:111:24)\n#33 _rootRunUnary (dart:async/zone.dart:1362:47)\n#34 _CustomZone.runUnary (dart:async/zone.dart:1265:19)\n#35 _CustomZone.runUnaryGuarded (dart:async/zone.dart:1170:7)\n#36 _BufferingStreamSubscription._sendData (dart:async/stream_impl.dart:341:11)\n#37 _BufferingStreamSubscription._add (dart:async/stream_impl.dart:271:7)\n#38 _SinkTransformerStreamSubscription._add (dart:async/stream_transformers.dart:63:11)\n#39 _EventSinkWrapper.add (dart:async/stream_transformers.dart:13:11)\n#40 _StringAdapterSink.add (dart:convert/string_conversion.dart:238:11)\n#41 _StringAdapterSink.addSlice (dart:convert/string_conversion.dart:243:7)\n#42 _Utf8ConversionSink.addSlice (dart:convert/string_conversion.dart:317:20)\n#43 _Utf8ConversionSink.add (dart:convert/string_conversion.dart:310:5)\n#44 _ConverterStreamEventSink.add (dart:convert/chunked_conversion.dart:72:18)\n#45 _SinkTransformerStreamSubscription._handleData (dart:async/stream_transformers.dart:111:24)\n#46 _rootRunUnary (dart:async/zone.dart:1362:47)\n#47 _CustomZone.runUnary (dart:async/zone.dart:1265:19)\n#48 _CustomZone.runUnaryGuarded (dart:async/zone.dart:1170:7)\n#49 _BufferingStreamSubscription._sendData (dart:async/stream_impl.dart:341:11)\n#50 _BufferingStreamSubscription._add (dart:async/stream_impl.dart:271:7)\n#51 _SyncStreamControllerDispatch._sendData (dart:async/stream_controller.dart:733:19)\n#52 _StreamController._add (dart:async/stream_controller.dart:607:7)\n#53 _StreamController.add (dart:async/stream_controller.dart:554:5)\n#54 _Socket._onData (dart:io-patch/socket_patch.dart:2160:41)\n#55 _rootRunUnary (dart:async/zone.dart:1370:13)\n#56 _CustomZone.runUnary (dart:async/zone.dart:1265:19)\n#57 _CustomZone.runUnaryGuarded (dart:async/zone.dart:1170:7)\n#58 _BufferingStreamSubscription._sendData (dart:async/stream_impl.dart:341:11)\n#59 _BufferingStreamSubscription._add (dart:async/stream_impl.dart:271:7)\n#60 _SyncStreamControllerDispatch._sendData (dart:async/stream_controller.dart:733:19)\n#61 _StreamController._add (dart:async/stream_controller.dart:607:7)\n#62 _StreamController.add (dart:async/stream_controller.dart:554:5)\n#63 new _RawSocket.<anonymous closure> (dart:io-patch/socket_patch.dart:1696:33)\n#64 _NativeSocket.issueReadEvent.issue (dart:io-patch/socket_patch.dart:1208:14)\n#65 _microtaskLoop (dart:async/schedule_microtask.dart:40:21)\n#66 _startMicrotaskLoop (dart:async/schedule_microtask.dart:49:5)\n#67 _runPendingImmediateCallback (dart:isolate-patch/isolate_patch.dart:120:13)\n#68 _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:185:5)\n"}]
moe-android-sdk version should be 11.3.01 and not 4.0.2. Assuming the flutter plugin version installed is 4.0.2

Unhandled Exception: MissingPluginException(No implementation found for method share on channel plugins.flutter.io/share)

I am using flutter share plugin version ^0.6.5+2 with firebase dynamic link. The plugin works fine when run in debug mode but when I create release apk using
flutter build apk --release
or flutter run --release, the share plugin gives error
E/flutter (17160): [ERROR:flutter/lib/ui/ui_dart_state.cc(166)] Unhandled Exception: MissingPluginException(No implementation found for method share
on channel plugins.flutter.io/share)
E/flutter (17160): #0 MethodChannel._invokeMethod (package:flutter/src/services/platform_channel.dart:159)
E/flutter (17160): <asynchronous suspension>
E/flutter (17160): <asynchronous suspension>
E/flutter (17160):
I have tried running Flutter clean and then build or run again but still it gives the same error

PlatformException(sign_in_failed, com.google.android.gms.common.api.ApiException: 10: , null)

I've searched the whole internet, tried every possible solution, still I'm not being able to sign in using GoogleSignIn from my flutter app.
Things I've tried :
1. Added SHA-1 Certificate
2. Added SHA-256 Certificate
3. Filled O-Auth Screen
4. Enabled GoogleSignIn in firebase
5. Added support email
Testing currently only in debug mode. As the app is in its initial stages right now I don't want to build a release version yet. Using debug SHA-1 and SHA-256 fingerprints.
Future<FirebaseUser> _signIn(BuildContext context) async {
final GoogleSignInAccount googleUser = await _googleSignIn.signIn();
final GoogleSignInAuthentication googleAuth =
await googleUser.authentication;
final AuthCredential credential = GoogleAuthProvider.getCredential(
accessToken: googleAuth.accessToken, idToken: googleAuth.idToken);
AuthResult userDetails =
await _firebaseAuth.signInWithCredential(credential);
ProviderDetails providerInfo =
ProviderDetails(userDetails.user.providerId);
List<ProviderDetails> providerData = List<ProviderDetails>();
providerData.add(providerInfo);
UserDetails details = UserDetails(
providerDetails: userDetails.user.providerId,
userEmail: userDetails.user.email,
userName: userDetails.user.displayName,
photoUrl: userDetails.user.photoUrl,
providerData: providerData);
return userDetails.user;
}
Error I get
[ERROR:flutter/lib/ui/ui_dart_state.cc(148)] Unhandled Exception:
PlatformException(sign_in_failed,
com.google.android.gms.common.api.ApiException: 10: , null)
E/flutter (12322): #0 StandardMethodCodec.decodeEnvelope
package:flutter/…/services/message_codecs.dart:564
E/flutter (12322): #1 MethodChannel.invokeMethod
package:flutter/…/services/platform_channel.dart:316
E/flutter (12322): <asynchronous suspension>
E/flutter (12322): #2 MethodChannel.invokeMapMethod
package:flutter/…/services/platform_channel.dart:344
E/flutter (12322): <asynchronous suspension>
E/flutter (12322): #3 GoogleSignIn._callMethod
package:google_sign_in/google_sign_in.dart:218
E/flutter (12322): <asynchronous suspension>
E/flutter (12322): #4 GoogleSignIn._addMethodCall.<anonymous closure>
package:google_sign_in/google_sign_in.dart:27
E/flutter (12322): #5 _rootRun (dart:async/zone.dart:1120:38)
E/flutter (12322): #6 _CustomZone.run (dart:async/zone.dart:1021:19)
E/flutter (12322): #7 _FutureListener.handleWhenComplete
(dart:async/future_impl.dart:150:18)
E/flutter (12322): #8
Future._propagateToListeners.handleWhenCompleteCallback
(dart:async/future_impl.dart:609:39)
E/flutter (12322): #9 Future._propagateToListeners
(dart:async/future_impl.dart:665:37)
E/flutter (12322): #10 Future._addListener.<anonymous closure>
(dart:async/future_impl.dart:348:9)
E/flutter (12322): #11 _rootRun (dart:async/zone.dart:1124:13)
E/flutter (12322): #12 _CustomZone.run (dart:async/zone.dart:1021:19)
E/flutter (12322): #13 _CustomZone.runGuarded
(dart:async/zone.dart:923:7)
E/flutter (12322): #14 _CustomZone.bindCallbackGuarded.<anonymous
closure> (dart:async/zone.dart:963:23)
E/flutter (12322): #15 _microtaskLoop
(dart:async/schedule_microtask.dart:41:21)
E/flutter (12322): #16 _startMicrotaskLoop
(dart:async/schedule_microtask.dart:50:5)
E/flutter (12322):
I know this question was posted quite some time ago but in case anybody else had issues, in addition to all of the above steps, I also enabled Google People API. Make sure that you are on the right email and project.
https://console.developers.google.com/apis/library/people.googleapis.com?q=people&id=5877a7af-1d13-4098-a53e-b5e2d7a87a4f&project=phamton-test
Did you rebuild the project after adding the dependencies?
Sometimes you need to rebuild your project whenever you add any platform specific plugin before it can be used effectively
So as regards to this error, if you find yourself facing it at any point.
There are 2 things that could possibly be wrong
Your app is not on the playstore and you're testing locally with a signed app.
You should probably go and add more SHA keys, if you have only SHA-1 go ahead and put SHA-256. Also be weary of your test environment as it could also mean that your apk mode(Testing or Production) is not correlating.

Categories

Resources