Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

iOS compile fails #43

Closed
rafbanaan opened this issue Sep 8, 2019 · 31 comments
Closed

iOS compile fails #43

rafbanaan opened this issue Sep 8, 2019 · 31 comments
Labels
ios This issue is specific to the iOS/iPadOS Platform.

Comments

@rafbanaan
Copy link

When I compile the code I receive the following error:

/{personalpath}/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_unity_widget-0.1.6+2/ios/Classes/UnityUtils.mm:55:10: error: no visible @interface for 'UnityFramework' declares the selector 'frameworkWarmup:argv:'
        [ufw frameworkWarmup: g_argc argv: g_argv];
         ~~~ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
    1 error generated.

My edited files are as follows:
Runner-Bridging-Header.h

#import "GeneratedPluginRegistrant.h"
#import "UnityUtils.h"

AppDelegate.swift

import UIKit
import Flutter

@UIApplicationMain
@objc class AppDelegate: FlutterAppDelegate {
  override func application(
    _ application: UIApplication,
    didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?
  ) -> Bool {
    InitArgs(CommandLine.argc, CommandLine.unsafeArgv)
    GeneratedPluginRegistrant.register(with: self)
    return super.application(application, didFinishLaunchingWithOptions: launchOptions)
  }
}

@lorant-csonka-ICE
Copy link

lorant-csonka-ICE commented Sep 9, 2019

The example project's Unity editor scripts are not updated yet in the example (there is already a PR for that #42).
Replace the example/unity/DemoApp/Assets/Editor/ located scripts with thescripts/Editor/ located ones, and try to rebuild the project in unity with the Flutter/Export IOS (Unity 2019.3.*) button.

@rafbanaan
Copy link
Author

Ok, will give it a try.

@rafbanaan
Copy link
Author

rafbanaan commented Sep 9, 2019

The above error is gone, but I do get the following now:

ld: warning: directory not found for option '-F/{localpath}/gf_app/ios/Pods/../UnityExport'
ld: warning: directory not found for option '-F/{localpath}/gf_app/ios/Pods/../UnityExport'
Undefined symbols for architecture x86_64:
  "_OBJC_CLASS_$_UnityAppController", referenced from:
      objc-class-ref in libflutter_unity_widget.a(FlutterUnityWidgetPlugin.o)
      objc-class-ref in libflutter_unity_widget.a(UnityUtils.o)
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

@lorant-csonka-ICE
Copy link

Great, have you tried to use it on a real device as well? (I had troubles with the simulator)

@rafbanaan
Copy link
Author

Same issue

@juicycleff
Copy link
Owner

What issues are you guys having. I am now available. Free from alot of projects :)

@reinkepatrick
Copy link

I get a similar error when compiling.

no visible @interface for 'UnityFramework' declares the selector 'frameworkWarmup:argv:' [ufw frameworkWarmup: g_argc argv: g_argv];

@sandrush73
Copy link

I am having the same issue i have it connected to a device, any solution for this ..?

Running Xcode build...                                                  
Xcode build done.                                            1.9s
Failed to build iOS app
Error output from Xcode build:
↳
    ** BUILD FAILED **


Xcode's output:
↳
    === BUILD TARGET flutter_unity_widget OF PROJECT Pods WITH CONFIGURATION Debug ===
    /Users/Downloads/flutter-unity-view-widget-master/ios/Classes/UnityUtils.mm:55:10:
    error: no visible @interface for 'UnityFramework' declares the selector 'frameworkWarmup:argv:'
        [ufw frameworkWarmup: g_argc argv: g_argv];
         ~~~ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
    1 error generated.

Could not build the precompiled application for the device.

Error launching application on iPhone

@sandrush73
Copy link

Hi reinkepatrick

Were you able to have a successful xcode build or are you having any issues when you try just building it from the workspace not using flutter run ..?

@reinkepatrick
Copy link

@sandrush73 Sadly not, I stopped trying.

@sandrush73
Copy link

@reinkepatrick can you check if you are getting this error when you try to build from the workspace, if you are still on it ...!

Error

Showing All Errors Only
/Users/Desktop/Rear/flutter-unity-view-widget-master/ios/Classes/UnityUtils.mm:55:10: No visible @interface for 'UnityFramework' declares the selector 'frameworkWarmup:argv:'

@reinkepatrick
Copy link

@sandrush73 I had the same error before, do you use Unity 2019.3?

@sandrush73
Copy link

Yes and my xcode Version 11.0 (11A420a)

@reinkepatrick
Copy link

Did you use pod install and your flutter doctor is good?

@sandrush73
Copy link

Yes i did initially i had some issue with manifest and podfile.lock but when i updated my pods i had them cleared

Flutter Doctor

`-MacBook-Pro:example arpitasaxena$ flutter doctor
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, v1.9.1+hotfix.4, on Mac OS X 10.14.5 18F132, locale en-GB)

[!] Android toolchain - develop for Android devices (Android SDK version 29.0.2)
✗ Android licenses not accepted. To resolve this, run: flutter doctor --android-licenses
[✓] Xcode - develop for iOS and macOS (Xcode 11.0)
[!] Android Studio (version 3.4)
✗ Flutter plugin not installed; this adds Flutter specific functionality.
✗ Dart plugin not installed; this adds Dart specific functionality.
[✓] Connected device (1 available)

! Doctor found issues in 2 categories.`

@reinkepatrick
Copy link

Then I'm afraid I can't help you. Sorry. I think I just set up the project anew.

@sandrush73
Copy link

when you are creating a unity export do u have below files in your assets by chance

UnityMessageManager.cs
JsonDotNet
link.xml

@reinkepatrick
Copy link

I deleted UnityMessageManager.cs

@sandrush73
Copy link

ya i did the same too if not i was getting missing Unity/UnityFramework.h missing when i build

@reinkepatrick
Copy link

You added #import "UnityUtils.h" to your Runner/Runner/Runner-Bridging-Header.h?

@sandrush73
Copy link

yep i did and also tried using custom config flie like this

`//
// UnityConfig.xcconfig
// rnunitydemo
//
// Created by xzper on 2018/3/6.
// Copyright © 2018年 Facebook. All rights reserved.
//
UNITY_SCRIPTING_BACKEND = il2cpp;
GCC_PREFIX_HEADER = $(SRCROOT)/UnityExport/Classes/Prefix.pch;

HEADER_SEARCH_PATHS = $(inherited) "$(SRCROOT)/UnityExport/Classes" "$(SRCROOT)/UnityExport/Classes/Unity" "$(SRCROOT)/UnityExport/Classes/Native" "$(SRCROOT)/UnityExport/Libraries" "$(SRCROOT)/UnityExport/Libraries/libil2cpp/include" ${PODS_HEADER_PATHS};

LIBRARY_SEARCH_PATHS = $(inherited) "$(SRCROOT)/UnityExport/Libraries" "$(SRCROOT)/UnityExport/Libraries/libil2cpp/include" ${PODS_LIBRARY_PATHS};

// If using .net 4.0 in Unity, append -DNET_4_0 to OTHER_CFLAGS
OTHER_CFLAGS = $(inherited) -DINIT_SCRIPTING_BACKEND=1 -fno-strict-overflow -DRUNTIME_IL2CPP=1;

OTHER_LDFLAGS = $(inherited) -weak-lSystem -weak_framework CoreMotion -weak_framework GameKit -weak_framework iAd -framework AVFoundation -framework AudioToolbox -framework CFNetwork -framework CoreGraphics -framework CoreLocation -framework CoreMedia -framework CoreVideo -framework Foundation -framework MediaPlayer -framework MediaToolbox -framework Metal -framework OpenAL -framework OpenGLES -framework QuartzCore -framework SystemConfiguration -framework UIKit -liconv.2 -liPhone-lib -lil2cpp ${PODS_LIBRARIES};

CLANG_CXX_LANGUAGE_STANDARD = c++0x;
CLANG_CXX_LIBRARY = libc++;
CLANG_ENABLE_MODULES = NO;
CLANG_WARN_BOOL_CONVERSION = NO;
CLANG_WARN_CONSTANT_CONVERSION = NO;
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES;
CLANG_WARN_EMPTY_BODY = NO;
CLANG_WARN_ENUM_CONVERSION = NO;
CLANG_WARN_INT_CONVERSION = NO;
CLANG_WARN_OBJC_ROOT_CLASS = YES;
CLANG_WARN_UNREACHABLE_CODE = NO;
CLANG_WARN__DUPLICATE_METHOD_MATCH = NO;
GCC_C_LANGUAGE_STANDARD = c99;
GCC_ENABLE_OBJC_EXCEPTIONS = NO;
GCC_ENABLE_CPP_RTTI = NO;
GCC_PRECOMPILE_PREFIX_HEADER = YES;
GCC_THUMB_SUPPORT = NO;
GCC_USE_INDIRECT_FUNCTION_CALLS = NO;
GCC_WARN_64_TO_32_BIT_CONVERSION = NO;
GCC_WARN_64_TO_32_BIT_CONVERSION[arch=*64] = YES;
GCC_WARN_ABOUT_RETURN_TYPE = YES;
GCC_WARN_UNDECLARED_SELECTOR = NO;
GCC_WARN_UNINITIALIZED_AUTOS = NO;
GCC_WARN_UNUSED_FUNCTION = NO;

ENABLE_BITCODE = NO;

DEAD_CODE_STRIPPING = YES;
`

@reinkepatrick
Copy link

I never used a custom config.

@sandrush73
Copy link

any change to runner configuration ..?

@reinkepatrick
Copy link

No

@sandrush73
Copy link

@reinkepatrick are you still working on this by chance .?

@reinkepatrick
Copy link

@sandrush73 no I stopped trying.

@sandrush73
Copy link

can you check if you have UnityFramework within your pod> Framework folder

@reinkepatrick
Copy link

I've already deleted the project, I'm sorry.

@sandrush73
Copy link

@reinkepatrick, i did solve it by adding

- (void)frameworkWarmup:(int)argc argv:(char*[])argv; in UnityFramework.h . but i am having a different error now

@krispypen
Copy link
Collaborator

Hi @rafbanaan, @reinkepatrick , can you test it again after PR #61 is merged? I updated the samples and also did some fixes in the unity export script.

@thomas-stockx thomas-stockx added the ios This issue is specific to the iOS/iPadOS Platform. label Oct 17, 2019
@juicycleff
Copy link
Owner

@reinkepatrick @rafbanaan the PR from @krispypen has been merged and release

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ios This issue is specific to the iOS/iPadOS Platform.
Projects
None yet
Development

No branches or pull requests

7 participants