Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
    Jatin Pawar
    @Jatin-Pawar
    Looking forward to hearing from you @mihaelpuljak
    PageGuo
    @guoguoguilai
    Hey, is there anybody who has the same issue? juicycleff/flutter-unity-view-widget#211
    Martin Michelini
    @mmichelini_gitlab
    Hi everyone! I am running into an issue with the new version. When I call the quitPlayer method the entire application crushes. I was wondering if anyone ran into the same issue? Here is the issue in more detail: juicycleff/flutter-unity-view-widget#214
    Steven Jr.
    @Witchd0ct0r
    @mmichelini_gitlab Basically what quitPlayer does is quitting the application :D As far as I know there are no current dispose method defined for the unitywidgetcontroller. But if you just pop the unity widget from your stack and if there are no more references to the controller than the dart language should automatically garbage collect it and free the memory by default.
    Martin Michelini
    @mmichelini_gitlab
    Thanks Witch! Is there a way to quit unity an then open a new unity application later? From what it's says on the unity documentation is seems this is not possible, can someone confirm this?
    At the end of this links mentions the limitations of integrating unity on iOS https://docs.unity3d.com/Manual/UnityasaLibrary-iOS.html
    Chris Hendrickson
    @artificer.chris_gitlab
    I have a quick question, I've got my integration done with Unity and Flutter (awesome work, by the way). Now I need to get all this working inside a CI setup. Is there a way using unity's batch mode I can run the export ios and export android steps? Since it's automated, I don't really have a way to click through the UI on each build without hacking together something in apple script or something
    Feeraz A'shaqif
    @feerazrzk_twitter
    Hello beautiful people! Is there any way for Unity to send multiple data to Flutter? I'm currently using UnityMessageMessenger() to send data to Flutter haha
    PageGuo
    @guoguoguilai

    Hi. Is there any solution to call setState in OnUnityMessage when re-open unity?juicycleff/flutter-unity-view-widget#225 . Android works well but iOS fails.
    I think it might be the LifeCycle issue. Unity never exit and other widget was rebuild when reopen the same page.
    The following is what I did on simple_screen.dart:

    1. Add a new bool isTouched=false
    2. Make isTouched as the condition to control the title of AppBar.
      this.isTouched ? Text("Don't touch me!") : Text("Touch me please!"),
    3. Call setState when recieve message from flutter.
      debugPrint("Mounted state: ${this.mounted.toString()}"); setState(() { this.isTouched = !this.isTouched; });
      Everything works well for the first. However, when I reopen the same page, the setState fails. And also, the this.mounted turns out to be false, which means that this widget is not mounted.

    Here is the full code of simple_screen.dart

    import 'package:flutter/material.dart';
    import 'package:flutter_unity_widget/flutter_unity_widget.dart';
    import 'package:flutter_unity_widget_example/utils/screen_utils.dart';
    
    
    class SimpleScreen extends StatefulWidget {
      @override
      _SimpleScreenState createState() => _SimpleScreenState();
    }
    
    class _SimpleScreenState extends State<SimpleScreen> {
      static final GlobalKey<ScaffoldState> _scaffoldKey =
          GlobalKey<ScaffoldState>();
      UnityWidgetController _unityWidgetController;
      double _sliderValue = 0.0;
    
      @override
      void initState() {
        super.initState();
      }
    
      @override
      Widget build(BuildContext context) {
        final ScreenArguments arguments =
            ModalRoute.of(context).settings.arguments as ScreenArguments;
    
        return Scaffold(
          appBar: AppBar(
            title:
                this.isTouched ? Text("Don't touch me!") : Text("Touch me please!"),
          ),
          body: Card(
              margin: const EdgeInsets.all(8),
              clipBehavior: Clip.antiAlias,
              shape: RoundedRectangleBorder(
                borderRadius: BorderRadius.circular(20.0),
              ),
              child: Stack(
                children: [
                  UnityWidget(
                    onUnityViewCreated: onUnityCreated,
                    isARScene: arguments.enableAR,
                    onUnityMessage: onUnityMessage,
                  ),
                  Positioned(
                    bottom: 20,
                    left: 20,
                    right: 20,
                    child: Card(
                      elevation: 10,
                      child: Column(
                        children: <Widget>[
                          Padding(
                            padding: const EdgeInsets.only(top: 20),
                            child: Text("Rotation speed:"),
                          ),
                          Slider(
                            onChanged: (value) {
                              setState(() {
                                _sliderValue = value;
                              });
                              setRotationSpeed(value.toString());
                            },
                            value: _sliderValue,
                            min: 0,
                            max: 20,
                          ),
                        ],
                      ),
                    ),
                  ),
                ],
              )),
        );
      }
    
      void setRotationSpeed(String speed) {
        _unityWidgetController.postMessage(
          'Cube',
          'SetRotationSpeed',
          speed,
        );
      }
    
      bool isTouched = false;
    
      void onUnityMessage(controller, message) {
        debugPrint("Mounted state: ${this.mounted.toString()}");
    
        setState(() {
          this.isTouched = !this.isTouched;
        });
        debugPrint(
            'Received message from unityffffff: ${message.toString()}  ${this.isTouched.toString()}');
      }
    
      void setStateForTouch() {
        setState(() {
          this.isTouched = true;
        });
      }
    
      // Callback that connects the created controller to the unity controller
      void onUnityCreated(controller) async {
        this._unityWidgetController = controller;
      }
    }

    Can anyone help me to solve this problem?

    Steven Jr.
    @Witchd0ct0r
    @guoguoguilai & @feerazrzk_twitter Your problems are basically around the setState command. setState rebuilds the whole widget thus rebuilds the unity widget. Normally you dont have to be so "dramatic". Flutter provides some very good data streaming options and there are some really good packages like stream bloc. By utilizing a stream, you dont have to rebuild you whole widget. You can modify the requested parameter of your liking by only "rebuilding" that part. I would recommend you to do a little search on flutter stream bloc, data streaming etc. I will most likely solve both of you problems.
    PageGuo
    @guoguoguilai
    @Witchd0ct0r Thanks for your help!
    Maybe I didn't make it clear. The main key is not "rebuild the whole widget".
    Assume that I have two pages A&B. And B contains a unity widget.
    The main issue is :
    1. (both Android and iOS)Everything goes well when A—>B for the first time. And I can call any setState in Page B.
    2. (Only in iOS)But if I pop from B to A, then go B again(which means A—>B—>A—>B),I can't call any setState in OnUnityMessage. What's more, "this.mounted " inside OnUnityMessage turned out to be false.
      In short, whenever I enter a page that contains a unity widget for the second or third time, setState inside onUnityMessage will not work. And this situation Only appeares in iOS.
    Gihan Weeraprameshwara
    @gihan-weeraprameshwara_gitlab
    Hey guys I don't know if this is trivial but how can I pass messages from unity to flutter? Can't find any method. flutter_unity_widget seemed to have that but now it's gone. Thank you
    gishAkbaraly
    @gishAkbaraly_gitlab
    Hello All ! First of all, thanks for this amazing plugin :)
    I'm am currently facing some issues, when I am in debug mode, when I close the app, and relaunch it, unity scene is not loading. So I tried to create a release app, but in release app unity is not loading at all ..
    Have you ever faced this issue?
    XRJonathan
    @XRJonathan
    image.png
    Having error and the screen off unity in flutter si only black or crashed. Can Anyone help me?
    image.png
    XRJonathan
    @XRJonathan
    It's also having a lost of connection.
    Subhash Chandra Shukla
    @subhashdk_android_gitlab
    how to create Editor for making flutter menu in unity
    mahdi bazei
    @mahna3411
    hi
    i am use version flutter_unity_widget 3.0.1
    When I go to Unity
    Everything works but its view is not displayed
    Can any of my friends help me?
    This only happens on some phones
    Almas Akchabayev
    @almeynman
    @mahna3411 Hey! does the demo app run on those phones?
    mahdi bazei
    @mahna3411
    @almeynman hi , No the demo has the same problem
    Priyanka Tyagi
    @ptyagicodecamp

    hello, can anyone help me plz! i can't build my app for release with cause in when building the plugin, it tells me at "#include <UnityFramework/UnityFramework.h>" that the header-file is missing. this happens only when trying to build for release/archive but not when doing a debug-build. this tbh is pretty urgent, cause i need to get the app to the store for a client. i'm not the only one, as there are some github issues of people having the same issue! thanks in advance

    @subjectdenied Hi Christian, did you figure out the solution for this issue?

    Christian Sigl
    @subjectdenied
    @ptyagicodecamp i didn't work at the project for some months and there were some changes in the plugin since then, but if you look at the issues in github, i posted some solution within one of the issues. iirc, it was about adding the framework to the build steps in xcode and how the framework needs to be symbolically linked inside the project structure
    Rohit Desai
    @rohitdesaidev
    Hi Team, I am new here.
    I am looking for some help to integrated flutter inside the unity. I am new to flutter has sound knowledge of unity.
    can someone guide me with some useful resources for the same. I was vice versa is possible with the flutter-unity plug in.
    Pietro Lentini
    @lentinip

    Hello everyone!

    I’m using Vuforia on Unity version 2020.1.14f1. AR project.

    I didn’t understand the steps explained under Android and Vuforia in the README file.
    Maybe I the problem can be solved with one of those steps.

    What I did:

    Problem during building fixed in Build.cs as in:

    https://github.com/juicycleff/flutter-unity-view-widget/issues/234#issuecomment-735307249

    Android Build:

    Changed the minSdkVersion from 16 to 24 for some errors.

    And still error (on IntelliJ):

    Running Gradle task 'assembleDebug'...
    [:arcore_client:] /Users/pietrolentini/.gradle/caches/transforms-2/files-2.1/a39d320a02bdc6c4cca0585f10641eb4/arcore_client/AndroidManifest.xml:30:9-54 Error:
        Missing 'package' key attribute on element package at [:arcore_client:] AndroidManifest.xml:30:9-54
    [:arcore_client:] /Users/pietrolentini/.gradle/caches/transforms-2/files-2.1/a39d320a02bdc6c4cca0585f10641eb4/arcore_client/AndroidManifest.xml Error:
        Validation failed, exiting
    
    FAILURE: Build failed with an exception.
    
    * What went wrong:
    Execution failed for task ':app:processDebugManifest'.
    > Manifest merger failed with multiple errors, see logs
    
    * 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

    I tried also to change the Gradle version but it still have some problems so I decided to step back to this position.

    Pietro Lentini
    @lentinip
    • using: flutter_unity_widget: ^3.0.1
    Cristian Zazo
    @Zazo032
    Hi! Where can I find the 3.0.1 changelog?
    Cristian Zazo
    @Zazo032
    Also, is someone also experiencing this? juicycleff/flutter-unity-view-widget#281
    mervansavga
    @mervansavga

    Also, is someone also experiencing this? juicycleff/flutter-unity-view-widget#281

    Have you tried unloading the scene after you're done Cristian?

    EhsanBrd
    @EhsanBrd
    image.png

    hi guys , how to solve this error , i've stuck in 1 week.

    • What went wrong:
      Circular dependency between the following tasks:
      :UnityExport:generateDebugRFile
      --- :UnityExport:generateDebugRFile (*)

    (*) - details omitted (listed previously)

    gishAkbaraly
    @gishAkbaraly_gitlab

    Also, is someone also experiencing this? juicycleff/flutter-unity-view-widget#281

    Hello Cristian, same issue here .. I tried to use unload in dispose, but when I try to go back to my screen where there is my unity, I am not able to launch it

    Were you able to have the correct behavior ?

    ygocmen98
    @ygocmen98
    Hi guys
    CoolBhatti
    @CoolBhatti
    Hi guys, I have integrated the flutter unity widget in my app and I am facing a problem to unload the unity. @juicycleff are you available to help us to solve this issue. I have tried out the latest version as well as the old versions also, but the problem is same in all of the versions
    Adrien Gannerie
    @AdrienGannerie
    Hi, guys do we still need to remove vulkan from the Graphics APIs in Unity in the recent versions ?
    CoolBhatti
    @CoolBhatti
    Hi Guys I am getting this exception when I try to unload the unity player
    E/.labster.mobil(11979): No implementation found for void com.unity3d.player.UnityPlayer.nativeApplicationUnload() (tried Java_com_unity3d_player_UnityPlayer_nativeApplicationUnload and Java_com_unity3d_player_UnityPlayer_nativeApplicationUnload)
    E/UnityView(11979): No implementation found for void com.unity3d.player.UnityPlayer.nativeApplicationUnload() (tried Java_com_unity3d_player_UnityPlayer_nativeApplicationUnload and Java_com_unity3d_player_UnityPlayer_nativeApplicationUnload
    )
    E/.labster.mobil(11979): No implementation found for void com.unity3d.player.UnityPlayer.nativeApplicationUnload() (tried Java_com_unity3d_player_UnityPlayer_nativeApplicationUnload and Java_com_unity3d_player_UnityPlayer_nativeApplicationUnload)
    E/flutter (11979): [ERROR:flutter/shell/platform/android/platform_view_android_jni_impl.cc(43)] java.lang.UnsatisfiedLinkError: No implementation found for void com.unity3d.player.UnityPlayer.nativeApplicationUnload() (tried Java_com_unity3d_player_UnityPlayer_nativeApplicationUnload and Java_com_unity3d_player_UnityPlayer_nativeApplicationUnload
    )
    E/flutter (11979): at com.unity3d.player.UnityPlayer.nativeApplicationUnload(Native Method)
    E/flutter (11979): at com.unity3d.player.UnityPlayer.unload(Unknown Source:0)
    E/flutter (11979): at com.xraph.plugins.flutterunitywidget.UnityUtils.unload(UnityUtils.java:138)
    E/flutter (11979): at com.xraph.plugins.flutterunitywidget.FlutterUnityViewController.onMethodCall(FlutterUnityViewController.java:192)
    E/flutter (11979): at io.flutter.plugin.common.MethodChannel$IncomingMethodCallHandler.onMessage(MethodChannel.java:233)
    E/flutter (11979): at io.flutter.embedding.engine.dart.DartMessenger.handleMessageFromDart(DartMessenger.java:85)
    E/flutter (11979): at io.flutter.embedding.engine.FlutterJNI.handlePlatformMessage(FlutterJNI.java:692)
    E/flutter (11979): at android.os.MessageQueue.nativePollOnce(Native Method)
    E/flutter (11979): at android.os.MessageQueue.next(MessageQueue.java:336)
    E/flutter (11979): at android.os.Looper.loop(Looper.java:184)
    E/flutter (11979): at android.app.ActivityThread.main(ActivityThread.java:7817)
    E/flutter (11979): at java.lang.reflect.Method.invoke(Native Method)
    E/flutter (11979): at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:492)
    E/flutter (11979): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1027)
    E/flutter (11979):
    F/flutter (11979): [FATAL:flutter/shell/platform/android/platform_view_android_jni_impl.cc(942)] Check failed: CheckException(env).
    E/CRASH (11979): signal 6 (SIGABRT), code -1 (?), fault addr --------
    E/CRASH (11979):
    E/CRASH (11979): Build type 'Release', Scripting Backend 'il2cpp', CPU 'arm64-v8a'
    E/CRASH (11979): Build fingerprint: 'realme/RMX2189/RMX2189:10/QP1A.190711.020/1602319027:user/release-keys'
    E/CRASH (11979): Revision: '0'
    E/CRASH (11979): pid: 11979, tid: 11979, name: .labster.mobile >>> com.labster.mobile <<<
    E/CRASH (11979): x0 0000000000000000 x1 0000000000002ecb x2 0000000000000006 x3 0000007ff0c45990
    E/CRASH (11979): x4 0000000000008000 x5 0000000000008000 x6 0000000000008000 x7 0080000000000000
    E/CRASH (11979): x8 00000000000000f0 x9 00000071f95a8a20 x10 0000000000000000 x11 0000000000000001
    E/CRASH (11979): x12 0000000008d58f98 x13 0000000000000004 x14 0000000000000001 x15 0000452ea313c2f1
    E/CRASH (11979): x16 00000071f9677958 x17 00000071f9655310 x18 0000000000001141 x19 00000000000000ac
    E/CRASH (11979): x20 0000000000002ecb x21 00000000000000b2 x22 0000000000002ecb x23 00000000ffffffff
    E/CRASH (11979): x24 00000071690d2bd8 x25 00000071fa966020 x26 0000000000000002 x27 0000000000000054
    E/CRASH (11979): x28 0000000000000001 x29 0000007ff0c45a40 x30 00000071f9607830
    E/CRASH (11979): sp 0000007ff0c45970 pc 00000071f9607860 pstate 0000000000000000
    E/CRASH
    DaniloCCP
    @DaniloCCP
    Hi! Do you guys know how it would be possible to embed a Unity app into flutter desktop? I couldn't export the unity project as I did for flutter mobile
    Simran Rout
    @simranrout
    heyy everyone I am working on Arkit , I wanted to place an object using the longitude and latitude , how can I do that
    Tiebo
    @Tiebo
    Hey everyone. This package looks very interesting. Can someone tell me please what the update frequency is between flutter and unity? Concrete example: I have a 3d model airplane which is flying in unity. I want to pass the controls from flutter to unity, let the movement be calculated and then get the new position data back from unity to flutter. Is this realistic? Is there latency? And what is the frequency of incoming and outgoing data? Thanks for your answers.
    Steven Jr.
    @Witchd0ct0r
    @Tiebo Well I don't think there would be a regular update frequency in flutter. I assume you want to update some info with the flight data from unity in your flutter framework. With unity you can call a flutter function with setstate but that will rebuild your widget. Or you can set up a data stream in flutter which will update "itself" every time unity sends new data. If you want to measure the exact latency you could set up a timer in flutter and measure the time between the incoming unity function calls. Also you will have to keep in mind unity's frame time (Time.deltatime). You can get started with streams here: https://medium.com/flutter-community/flutter-stream-basics-for-beginners-eda23e44e32f
    Steven Jr.
    @Witchd0ct0r
    @simranrout In the example flutter-unity-widget there is an example function how to send data from flutter to unity. If you problem lies in flutter-unity communication. In unity most of the time you just Instantianate(Gamobject, Vector3, Quaternion)
    Ratchapong Prasertchartmora
    @ratchapongbz_gitlab
    Excuse me, how could i download FlutterUnityPackage.unitypackage ?
    I found the link but package is missing :(
    Nick Fisher
    @nmfisher
    @ratchapongbz_gitlab is that needed on master HEAD? I just ran grep on my (working) iOS folder and couldn't find any reference
    Luis Pulido
    @nosmirck
    hello! can anyone shed some light on this? juicycleff/flutter-unity-view-widget#358
    Steven Jr.
    @Witchd0ct0r
    @nosmirck as far as i understand your problem you dont really have to keep the plugin "updated" on all projects. Of course you have to include the package in your pubspec file. Currently there is a unity script that compiles the unity project for the plugin. If you look up the script in the example unity project you will be able to edit to suit it for your needs. In short you have to edit it to compile the project for all of your flutter solutions. This way if you make changes in your unity project you will be able to compile it for all of your flutter programs in one step.
    Luis Pulido
    @nosmirck
    yeah, the issue is that the project is over 1GB size and there are 7 apps, even versioning control is becoming a nightmare. if we had just one plugin that we can reference from local (path: ../plugin) and in that plugin we have all we need so we just use the widget that'd be great. Also, there the potential that we add more apps to this. That's why it's very important that we have only the plugin locally with the unity project. My idea is keep the unity project in git, the base plugin also in our repo (but we add the unityLibrary in gitignore) and our child flutter projects in independent repos, now, whenever someone works on one of our projects, they just have to clone the unity repo with the base flutter plugin together in one folder at the same level as the project, open the unity project, compile the stuff assets and that's it, if they clone any of the other projects they just need to run it, no need to compile anything else, it should work out of the box