Skip to content
This repository has been archived by the owner on Jan 19, 2021. It is now read-only.

Run error #1

Open
geoffery009 opened this issue Apr 3, 2018 · 5 comments
Open

Run error #1

geoffery009 opened this issue Apr 3, 2018 · 5 comments

Comments

@geoffery009
Copy link

FAILURE: Build failed with an exception.

  • What went wrong:
    Execution failed for task ':app:preDebugBuild'.

Android dependency 'com.android.support:support-fragment' has different version for the compile (25.2.0) and runtime (27.0.2) classpath. You should manually set the same version via DependencyResolution

  • Try:
    Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

  • Get more help at https://help.gradle.org

BUILD FAILED in 2s
Finished with error: Gradle build failed: 1

@simolus3
Copy link
Owner

simolus3 commented Apr 3, 2018

Thanks for the report. Does this error occur when trying to build the example included in this repo or did you encounter it in your own project? I'm asking because I can build projects depending on Fluttie on my machine and because Fluttie does not depend on 'com.android.support:support-fragment'. It only transitively depends on 'com.android.support:appcompat-v7' with version 27.0.2.
So, if you're including other dependencies in your own project, it would be helpful if you could list the other flutter plugins you're using in your pubspec.yaml.

@geoffery009
Copy link
Author

geoffery009 commented Apr 4, 2018

dependencies:
flutter:
sdk: flutter

cupertino_icons: ^0.1.0
location: "^1.1.7"
http: "^0.11.3+16"
json_annotation: "^0.2.2"
intl: "^0.15.4"
shared_preferences: "^0.4.0"
share: "^0.4.0"
package_info: "^0.3.0"
flutter_webview_plugin: "^0.1.5"
fluttie: "^0.2.0"

use in my own project , run the example and it conflict with 'location' flutter plugin

@simolus3
Copy link
Owner

simolus3 commented Apr 4, 2018

Ok, I think I figured it out. What I said earlier is wrong as the Android library of Lottie does depend on the support-fragment library. As the version Lottie is using differs from the version the location package requests, the build fails because Gradle can't decide which version to include.
If you go to the build.gradle of your android/app module and add the following line at the beginning of the dependencies section, your build should work even with Fluttie enabled:

dependencies {
    implementation 'com.android.support:support-fragment:27.1.0'

    [...]

This will force the location plugin to use the newer version that Fluttie is using as well. I have just published an update for Fluttie including the latest version of Lottie, I recommend that you use it as well here:fluttie: "^0.2.1".
After you have done all this, please run

flutter clean
flutter packages get

and check if you can then run your app with Fluttie.

@geoffery009
Copy link
Author

geoffery009 commented Apr 8, 2018

it works:0,thanks
ps:how to change widget size ,i use 'preferredSize' but it dosent works


await instance.prepareAnimation(emojiComposition,
        duration: const Duration(seconds: 2),
        preferredSize: Fluttie.kDefaultSize,
        repeatCount: const RepeatCount.infinite(),
        repeatMode: RepeatMode.START_OVER);

@simolus3
Copy link
Owner

You can change the size of your animations in two places: In instance.prepareAnimation and in the place you create the widget in, with new FluttieAnimation(yourAnimation, size: const Size(w, h)).
You're looking for the second option here. The first one, which you're using, controlls the dimension in which the animation will be rendered in (higher size: better quality, but it might introduce lag on slower devices). The second one is the size the animation will be displayed with. They don't have to be the same size as you can, for instance, scale small animations to a big display size when high resolutions aren't required.
Effectively, you need to use the size parameter when you're creating a new FluttieAnimation as a widget. If the outcome of that animation looks bad, increase the preferredSize when preparing the animation. If it feels sluggish, decrease the preferred size.

kristoffer-zliide added a commit to zliide/fluttie that referenced this issue Oct 29, 2018
If loadAnimation issues the load_composition event before returning from the invokeMethod call, there will be no _pendingAnimationLoader waiting for it.

This has been observed fairly often, resulting in uncaught zone exceptions with message "NoSuchMethodError: The method 'complete' was called on null.
Receiver: null
Tried calling: complete(0)" and stack trace
#0      Object.noSuchMethod (dart:core/runtime/libobject_patch.dart:50:5)
simolus3#1      Fluttie._onData (package:fluttie/fluttie.dart:204:19)
simolus3#2      _rootRunUnary (dart:async/zone.dart:1132:38)
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants