Flutter ios app not building with razorpay plugin - ios

I was unable to build my flutter app in ios as I was getting these error, again and again, everything is working well for android.I get these error after using razorpay plugin in my app for integrating payment gateway.
Error output from Xcode build:
↳
BUILD FAILED *
Xcode's output:
↳
/Users/ganpat/Desktop/Flutter_Apps_Projects_2021/wsflutter/ios/Pods/razorpay-pod/Pod/Razorpay.framework/Modules/Razorpay.swiftmodule/x86_64-apple-ios-simulator.swiftinterface:44:1: error: unknown attribute '_hasMissingDesignatedInitializers'
#_hasMissingDesignatedInitializers #objc public class PluginPaymentModel : ObjectiveC.NSObject {
^
/Users/ganpat/Desktop/Flutter_Apps_Projects_2021/wsflutter/ios/Pods/razorpay-pod/Pod/Razorpay.framework/Modules/Razorpay.swiftmodule/x86_64-apple-ios-simulator.swiftinterface:51:41: error: unknown attribute '_hasMissingDesignatedInitializers'
#objc #_inheritsConvenienceInitializers #_hasMissingDesignatedInitializers public class Otpelf : ObjectiveC.NSObject {
^
/Users/ganpat/Desktop/Flutter_Apps_Projects_2021/wsflutter/ios/Pods/razorpay-pod/Pod/Razorpay.framework/Modules/Razorpay.swiftmodule/x86_64-apple-ios-simulator.swiftinterface:51:7: error: unknown attribute '_inheritsConvenienceInitializers'
#objc #_inheritsConvenienceInitializers #_hasMissingDesignatedInitializers public class Otpelf : ObjectiveC.NSObject {
^
/Users/ganpat/Desktop/Flutter_Apps_Projects_2021/wsflutter/ios/Pods/razorpay-pod/Pod/Razorpay.framework/Modules/Razorpay.swiftmodule/x86_64-apple-ios-simulator.swiftinterface:59:35: error: unknown attribute '_hasMissingDesignatedInitializers'
#_inheritsConvenienceInitializers #_hasMissingDesignatedInitializers #objc final public class RazorpayCheckout : ObjectiveC.NSObject {
^
/Users/ganpat/Desktop/Flutter_Apps_Projects_2021/wsflutter/ios/Pods/razorpay-pod/Pod/Razorpay.framework/Modules/Razorpay.swiftmodule/x86_64-apple-ios-simulator.swiftinterface:59:1: error: unknown attribute '_inheritsConvenienceInitializers'
#_inheritsConvenienceInitializers #_hasMissingDesignatedInitializers #objc final public class RazorpayCheckout : ObjectiveC.NSObject {
^
/Users/ganpat/develop/flutter/.pub-cache/hosted/pub.dartlang.org/razorpay_flutter-1.2.2/ios/Classes/RazorpayDelegate.swift:2:8: error: failed to load module 'Razorpay'
import Razorpay
^
/Users/ganpat/Desktop/Flutter_Apps_Projects_2021/wsflutter/ios/Pods/razorpay-pod/Pod/Razorpay.framework/Modules/Razorpay.swiftmodule/x86_64-apple-ios-simulator.swiftinterface:44:1: error: unknown attribute '_hasMissingDesignatedInitializers'
#_hasMissingDesignatedInitializers #objc public class PluginPaymentModel : ObjectiveC.NSObject {
^
/Users/ganpat/Desktop/Flutter_Apps_Projects_2021/wsflutter/ios/Pods/razorpay-pod/Pod/Razorpay.framework/Modules/Razorpay.swiftmodule/x86_64-apple-ios-simulator.swiftinterface:51:41: error: unknown attribute '_hasMissingDesignatedInitializers'
#objc #_inheritsConvenienceInitializers #_hasMissingDesignatedInitializers public class Otpelf : ObjectiveC.NSObject {
^
/Users/ganpat/Desktop/Flutter_Apps_Projects_2021/wsflutter/ios/Pods/razorpay-pod/Pod/Razorpay.framework/Modules/Razorpay.swiftmodule/x86_64-apple-ios-simulator.swiftinterface:51:7: error: unknown attribute '_inheritsConvenienceInitializers'
#objc #_inheritsConvenienceInitializers #_hasMissingDesignatedInitializers public class Otpelf : ObjectiveC.NSObject {
^
/Users/ganpat/Desktop/Flutter_Apps_Projects_2021/wsflutter/ios/Pods/razorpay-pod/Pod/Razorpay.framework/Modules/Razorpay.swiftmodule/x86_64-apple-ios-simulator.swiftinterface:59:35: error: unknown attribute '_hasMissingDesignatedInitializers'
#_inheritsConvenienceInitializers #_hasMissingDesignatedInitializers #objc final public class RazorpayCheckout : ObjectiveC.NSObject {
^
/Users/ganpat/Desktop/Flutter_Apps_Projects_2021/wsflutter/ios/Pods/razorpay-pod/Pod/Razorpay.framework/Modules/Razorpay.swiftmodule/x86_64-apple-ios-simulator.swiftinterface:59:1: error: unknown attribute '_inheritsConvenienceInitializers'
#_inheritsConvenienceInitializers #_hasMissingDesignatedInitializers #objc final public class RazorpayCheckout : ObjectiveC.NSObject {
^
/Users/ganpat/develop/flutter/.pub-cache/hosted/pub.dartlang.org/razorpay_flutter-1.2.2/ios/Classes/RazorpayDelegate.swift:2:8: error: failed to load module 'Razorpay'
import Razorpay
^
Command CompileSwift failed with a nonzero exit code
/Users/ganpat/develop/flutter/.pub-cache/hosted/pub.dartlang.org/permission_handler-4.4.0/ios/Classes/strategies/NotificationPermissionStrategy.m:71:5: warning: 'UIRemoteNotificationType' is deprecated: first deprecated in iOS 8.0 - Use UserNotifications Framework's UNAuthorizationOptions for user notifications and registerForRemoteNotifications for receiving remote notifications instead. [-Wdeprecated-declarations]
UIRemoteNotificationType type = [[UIApplication sharedApplication] enabledRemoteNotificationTypes];
^
In module 'UIKit' imported from /Users/ganpat/Desktop/Flutter_Apps_Projects_2021/wsflutter/ios/Pods/Target Support Files/permission_handler/permission_handler-prefix.pch:2:
/Users/ganpat/Desktop/Xcode 2.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIApplication.h:69:32: note: 'UIRemoteNotificationType' has been explicitly marked deprecated here
typedef NS_OPTIONS(NSUInteger, UIRemoteNotificationType) {
^
/Users/ganpat/develop/flutter/.pub-cache/hosted/pub.dartlang.org/permission_handler-4.4.0/ios/Classes/strategies/NotificationPermissionStrategy.m:71:72: warning: 'enabledRemoteNotificationTypes' is deprecated: first deprecated in iOS 8.0 - Use -[UIApplication isRegisteredForRemoteNotifications] and UserNotifications Framework's -[UNUserNotificationCenter getNotificationSettingsWithCompletionHandler:] to retrieve user-enabled remote notification and user notification settings [-Wdeprecated-declarations]
UIRemoteNotificationType type = [[UIApplication sharedApplication] enabledRemoteNotificationTypes];
^
In module 'UIKit' imported from /Users/ganpat/Desktop/Flutter_Apps_Projects_2021/wsflutter/ios/Pods/Target Support Files/permission_handler/permission_handler-prefix.pch:2:
/Users/ganpat/Desktop/Xcode 2.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIApplication.h:229:1: note: 'enabledRemoteNotificationTypes' has been explicitly marked deprecated here
(UIRemoteNotificationType)enabledRemoteNotificationTypes API_DEPRECATED("Use -[UIApplication isRegisteredForRemoteNotifications] and UserNotifications Framework's -[UNUserNotificationCenter getNotificationSettingsWithCompletionHandler:] to retrieve user-enabled remote notification and user notification settings", ios(3.0, 8.0)) API_UNAVAILABLE(tvos);
^
2 warnings generated.
note: Using new build system
note: Planning build
note: Constructing build description
Could not build the application for the simulator.
Error launching application on iPhone 11 Pro Max

Related

Framework init param is not a member type of class

I am working on one framework and it is working fine if it is directly connected to the test app in the same project. But when I build it for release and implement it into another test app it shows me this error:
Failed to build module 'MySDK' for importation due to the errors above; the textual interface may be broken by project issues or a compiler bug
After some digging, I get an error message ... is not a member type of class ...
And the problem is in the initial parameter and in my observer
this is my entry / init class:
public class MySdk {
...
public init(eventObserver: MyResultObserver){ // this observer is a problem maker
EventObserver.shared.attach(eventObserver)
};
public init(){}
...
and this is how my MyResultObserver looks like (it is in a separate file)
import Foundation
public protocol MyResultObserver: AnyObject {
func success(successMessage: String)
func error(errorMessage: String)
}
and extension:
import Foundation
extension MyResultObserver: NSCopying {
func copy(with zone: NSZone? = nil) -> Any {
return self
}
}
How should it work (it is working in a test project in that SDK folder)
import UIKit
import MySdk
class ViewController: UIViewController, MyResultObserver { // added observer here
func success(successMessage: String) {} // observer function 1
func error(errorMessage: String) {} // observer function 2
...
#IBAction func openSdkClick(){
let myAwesomeSdk = MySDK(eventObserver: self) // init my sdk with observer
}
}
But the problem is when I implement it like this into the test app (as cocoa pod) it will give me an error above. I try to remove this observer parameter and SDK works fine.
How can I make my observer visible? Should I put it into headers somewhere? any hint?
UPDATE
when I am trying to use that framework I can jump to the definition and this is result:
// swift-interface-format-version: 1.0
// swift-compiler-version: Apple Swift version 5.7.1 (swiftlang-5.7.1.135.3 clang-1400.0.29.51)
// swift-module-flags: -target x86_64-apple-ios15.5-simulator -enable-objc-interop -enable-library-evolution -swift-version 5 -enforce-exclusivity=checked -O -module-name WalleePaymentSdk
// swift-module-flags-ignorable: -enable-bare-slash-regex
import AVFoundation
import Foundation
import Swift
import UIKit
#_exported import MySDK
import _Concurrency
import _StringProcessing
public protocol PaymenResultObserver : AnyObject {
func success(successMessage: Swift.String)
func error(errorMessage: Swift.String)
}
public typealias callback = (Swift.String) -> Swift.Void
open class MySDK : MySDK.PaymenResultObserver {
public func success(successMessage: Swift.String)
public func error(errorMessage: Swift.String)
public init(eventObserver: #escaping MySDK.callback)
public func launchPayment(transactionId: Swift.String, token: Swift.String, rootController: UIKit.UIViewController)
public func close()
#objc deinit
}
I did some modification to the code I put Observer inside SDK and I am trying to access the function callback which shuld be define by SDK consumer ... but that observer get this error:
'Observer' is not a member type of class 'MySdk.MySdk'
and callback
'callback' is not a member type of class 'MySDK.MySDK'
problem is this line:
open class MySDK : MySDK.PaymenResultObserver
and this line
public init(eventObserver: #escaping MySDK.callback)
both elements are there but I am accessing them inside the SDK and SDK can not inherit from them itself

resolving dependency error in intellij ide?

I created a new grails 2.2 app and added
compile ":spring-security-core:1.2.7.3"
in plugins inside BuildConfig.groovy. Please note that i am using grails 2.2.
I then ran > grails compile and it throws the following error.
|Loading Grails 2.2.0
|Configuring classpath
.
|Environment set to development
........
|Compiling 156 source files
.Error
|
Compilation error: startup failed:
Compile error during compilation with javac.
C:\Users\sanjayg\.grails\2.2.0\projects\ACLTest\plugins\spring-security-core-1.2.7.3\src\java\grails\plugins\springsecurity\BCryptPasswordEncoder.java:20: error: package org.springframework.security.authentication.encoding does not exist
import org.springframework.security.authentication.encoding.PasswordEncoder;
^
C:\Users\sanjayg\.grails\2.2.0\projects\ACLTest\plugins\spring-security-core-1.2.7.3\src\java\grails\plugins\springsecurity\BCryptPasswordEncoder.java:30: error: cannot find symbol
public class BCryptPasswordEncoder implements PasswordEncoder {
^
symbol: class PasswordEncoder
C:\Users\sanjayg\.grails\2.2.0\projects\ACLTest\plugins\spring-security-core-1.2.7.3\src\java\grails\plugins\springsecurity\DigestAuthPasswordEncoder.java:21: error: package org.springframework.security.authentication.encoding does not exist
import org.springframework.security.authentication.encoding.PasswordEncoder;
^
C:\Users\sanjayg\.grails\2.2.0\projects\ACLTest\plugins\spring-security-core-1.2.7.3\src\java\grails\plugins\springsecurity\DigestAuthPasswordEncoder.java:22: error: package org.springframework.security.core.codec does not exist
import org.springframework.security.core.codec.Hex;
^
C:\Users\sanjayg\.grails\2.2.0\projects\ACLTest\plugins\spring-security-core-1.2.7.3\src\java\grails\plugins\springsecurity\DigestAuthPasswordEncoder.java:37: error: cannot find symbol
public class DigestAuthPasswordEncoder implements PasswordEncoder, InitializingBean {
^
symbol: class PasswordEncoder
C:\Users\sanjayg\.grails\2.2.0\projects\ACLTest\plugins\spring-security-core-1.2.7.3\src\java\org\codehaus\groovy\grails\plugins\springsecurity\AbstractFilterInvocationDefinition.java:31: error: package org.springframework.security.access does not exist
import org.springframework.security.access.AccessDecisionVoter;
^
C:\Users\sanjayg\.grails\2.2.0\projects\ACLTest\plugins\spring-security-core-1.2.7.3\src\java\org\codehaus\groovy\grails\plugins\springsecurity\AbstractFilterInvocationDefinition.java:32: error: package org.springframework.security.access does not exist
import org.springframework.security.access.ConfigAttribute;
^
C:\Users\sanjayg\.grails\2.2.0\projects\ACLTest\plugins\spring-security-core-1.2.7.3\src\java\org\codehaus\groovy\grails\plugins\springsecurity\AbstractFilterInvocationDefinition.java:33: error: package org.springframework.security.access does not exist
import org.springframework.security.access.SecurityConfig;
^
C:\Users\sanjayg\.grails\2.2.0\projects\ACLTest\plugins\spring-security-core-1.2.7.3\src\java\org\codehaus\groovy\grails\plugins\springsecurity\AbstractFilterInvocationDefinition.java:34: error: package org.springframework.security.access.vote does not exist
import org.springframework.security.access.vote.AuthenticatedVoter;
^
C:\Users\sanjayg\.grails\2.2.0\projects\ACLTest\plugins\spring-security-core-1.2.7.3\src\java\org\codehaus\groovy\grails\plugins\springsecurity\AbstractFilterInvocationDefinition.java:35: error: package org.springframework.security.access.vote does not exist
import org.springframework.security.access.vote.RoleVoter;
^
C:\Users\sanjayg\.grails\2.2.0\projects\ACLTest\plugins\spring-security-core-1.2.7.3\src\java\org\codehaus\groovy\grails\plugins\springsecurity\AbstractFilterInvocationDefinition.java:36: error: package org.springframework.security.web does not exist
import org.springframework.security.web.FilterInvocation;
^
C:\Users\sanjayg\.grails\2.2.0\projects\ACLTest\plugins\spring-security-core-1.2.7.3\src\java\org\codehaus\groovy\grails\plugins\springsecurity\AbstractFilterInvocationDefinition.java:37: error: package org.springframework.security.web.access.expression does not exist
import org.springframework.security.web.access.expression.WebSecurityExpressionHandler;
^
C:\Users\sanjayg\.grails\2.2.0\projects\ACLTest\plugins\spring-security-core-1.2.7.3\src\java\org\codehaus\groovy\grails\plugins\springsecurity\AbstractFilterInvocationDefinition.java:38: error: package org.springframework.security.web.access.intercept does not exist
import org.springframework.security.web.access.intercept.FilterInvocationSecurityMetadataSource;
^
C:\Users\sanjayg\.grails\2.2.0\projects\ACLTest\plugins\spring-security-core-1.2.7.3\src\java\org\codehaus\groovy\grails\plugins\springsecurity\AbstractFilterInvocationDefinition.java:39: error: package org.springframework.security.web.util does not exist
import org.springframework.security.web.util.AntUrlPathMatcher;
^
C:\Users\sanjayg\.grails\2.2.0\projects\ACLTest\plugins\spring-security-core-1.2.7.3\src\java\org\codehaus\groovy\grails\plugins\springsecurity\AbstractFilterInvocationDefinition.java:40: error: package org.springframework.security.web.util does not exist
import org.springframework.security.web.util.UrlMatcher;
^
C:\Users\sanjayg\.grails\2.2.0\projects\ACLTest\plugins\spring-security-core-1.2.7.3\src\java\org\codehaus\groovy\grails\plugins\springsecurity\AbstractFilterInvocationDefinition.java:48: error: cannot find symbol
implements FilterInvocationSecurityMetadataSource, InitializingBean {
^
symbol: class FilterInvocationSecurityMetadataSource
C:\Users\sanjayg\.grails\2.2.0\projects\ACLTest\plugins\spring-security-core-1.2.7.3\src\java\org\codehaus\groovy\grails\plugins\springsecurity\AbstractFilterInvocationDefinition.java:50: error: cannot find symbol
private UrlMatcher _urlMatcher;
^
symbol: class UrlMatcher
location: class AbstractFilterInvocationDefinition
C:\Users\sanjayg\.grails\2.2.0\projects\ACLTest\plugins\spring-security-core-1.2.7.3\src\java\org\codehaus\groovy\grails\plugins\springsecurity\AbstractFilterInvocationDefinition.java:53: error: cannot find symbol
private RoleVoter _roleVoter;
^
symbol: class RoleVoter
location: class AbstractFilterInvocationDefinition
C:\Users\sanjayg\.grails\2.2.0\projects\ACLTest\plugins\spring-security-core-1.2.7.3\src\java\org\codehaus\groovy\grails\plugins\springsecurity\AbstractFilterInvocationDefinition.java:54: error: cannot find symbol
private AuthenticatedVoter _authenticatedVoter;
^
symbol: class AuthenticatedVoter
location: class AbstractFilterInvocationDefinition
C:\Users\sanjayg\.grails\2.2.0\projects\ACLTest\plugins\spring-security-core-1.2.7.3\src\java\org\codehaus\groovy\grails\plugins\springsecurity\AbstractFilterInvocationDefinition.java:55: error: cannot find symbol
private WebSecurityExpressionHandler _expressionHandler;
^
symbol: class WebSecurityExpressionHandler
location: class AbstractFilterInvocationDefinition
C:\Users\sanjayg\.grails\2.2.0\projects\ACLTest\plugins\spring-security-core-1.2.7.3\src\java\org\codehaus\groovy\grails\plugins\springsecurity\AbstractFilterInvocationDefinition.java:57: error: cannot find symbol
private final Map<Object, Collection<ConfigAttribute>> _compiled = new LinkedHashMap<Object, Collection<ConfigAttribute>>();
^
symbol: class ConfigAttribute
location: class AbstractFilterInvocationDefinition
C:\Users\sanjayg\.grails\2.2.0\projects\ACLTest\plugins\spring-security-core-1.2.7.3\src\java\org\codehaus\groovy\grails\plugins\springsecurity\AbstractFilterInvocationDefinition.java:61: error: cannot find symbol
protected static final Collection<ConfigAttribute> DENY = Collections.emptyList();
^
symbol: class ConfigAttribute
location: class AbstractFilterInvocationDefinition
C:\Users\sanjayg\.grails\2.2.0\projects\ACLTest\plugins\spring-security-core-1.2.7.3\src\java\org\codehaus\groovy\grails\plugins\springsecurity\AbstractFilterInvocationDefinition.java:75: error: cannot find symbol
public Collection<ConfigAttribute> getAttributes(Object object) throws IllegalArgumentException {
^
symbol: class ConfigAttribute
location: class AbstractFilterInvocationDefinition
C:\Users\sanjayg\.grails\2.2.0\projects\ACLTest\plugins\spring-security-core-1.2.7.3\src\java\org\codehaus\groovy\grails\plugins\springsecurity\AbstractFilterInvocationDefinition.java:98: error: cannot find symbol
protected abstract String determineUrl(FilterInvocation filterInvocation);
^
symbol: class FilterInvocation
location: class AbstractFilterInvocationDefinition
C:\Users\sanjayg\.grails\2.2.0\projects\ACLTest\plugins\spring-security-core-1.2.7.3\src\java\org\codehaus\groovy\grails\plugins\springsecurity\AbstractFilterInvocationDefinition.java:104: error: cannot find symbol
private Collection<ConfigAttribute> findConfigAttributes(final String url) throws Exception {
^
symbol: class ConfigAttribute
location: class AbstractFilterInvocationDefinition
C:\Users\sanjayg\.grails\2.2.0\projects\ACLTest\plugins\spring-security-core-1.2.7.3\src\java\org\codehaus\groovy\grails\plugins\springsecurity\AbstractFilterInvocationDefinition.java:158: error: cannot find symbol
public Collection<ConfigAttribute> getAllConfigAttributes() {
^
symbol: class ConfigAttribute
location: class AbstractFilterInvocationDefinition
C:\Users\sanjayg\.grails\2.2.0\projects\ACLTest\plugins\spring-security-core-1.2.7.3\src\java\org\codehaus\groovy\grails\plugins\springsecurity\AbstractFilterInvocationDefinition.java:178: error: cannot find symbol
public void setUrlMatcher(final UrlMatcher urlMatcher) {
^
symbol: class UrlMatcher
location: class AbstractFilterInvocationDefinition
C:\Users\sanjayg\.grails\2.2.0\projects\ACLTest\plugins\spring-security-core-1.2.7.3\src\java\org\codehaus\groovy\grails\plugins\springsecurity\AbstractFilterInvocationDefinition.java:209: error: cannot find symbol
protected UrlMatcher getUrlMatcher() {
^
symbol: class UrlMatcher
location: class AbstractFilterInvocationDefinition
C:\Users\sanjayg\.grails\2.2.0\projects\ACLTest\plugins\spring-security-core-1.2.7.3\src\java\org\codehaus\groovy\grails\plugins\springsecurity\AbstractFilterInvocationDefinition.java:218: error: cannot find symbol
public Map<Object, Collection<ConfigAttribute>> getConfigAttributeMap() {
^
symbol: class ConfigAttribute
location: class AbstractFilterInvocationDefinition
C:\Users\sanjayg\.grails\2.2.0\projects\ACLTest\plugins\spring-security-core-1.2.7.3\src\java\org\codehaus\groovy\grails\plugins\springsecurity\AbstractFilterInvocationDefinition.java:254: error: cannot find symbol
protected Collection<ConfigAttribute> buildConfigAttributes(final Collection<String> tokens) {
^
symbol: class ConfigAttribute
location: class AbstractFilterInvocationDefinition
C:\Users\sanjayg\.grails\2.2.0\projects\ACLTest\plugins\spring-security-core-1.2.7.3\src\java\org\codehaus\groovy\grails\plugins\springsecurity\AbstractFilterInvocationDefinition.java:269: error: cannot find symbol
protected boolean supports(final ConfigAttribute config) {
^
symbol: class ConfigAttribute
location: class AbstractFilterInvocationDefinition
C:\Users\sanjayg\.grails\2.2.0\projects\ACLTest\plugins\spring-security-core-1.2.7.3\src\java\org\codehaus\groovy\grails\plugins\springsecurity\AbstractFilterInvocationDefinition.java:274: error: cannot find symbol
private boolean supports(final ConfigAttribute config, final AccessDecisionVoter voter) {
^
symbol: class ConfigAttribute
location: class AbstractFilterInvocationDefinition
C:\Users\sanjayg\.grails\2.2.0\projects\ACLTest\plugins\spring-security-core-1.2.7.3\src\java\org\codehaus\groovy\grails\plugins\springsecurity\AbstractFilterInvocationDefinition.java:274: error: cannot find symbol
private boolean supports(final ConfigAttribute config, final AccessDecisionVoter voter) {
^
symbol: class AccessDecisionVoter
location: class AbstractFilterInvocationDefinition
C:\Users\sanjayg\.grails\2.2.0\projects\ACLTest\plugins\spring-security-core-
I appreciate any guide to why i am getting this error when compiling dependencies. Is it because it couldnt find the old plugin from the repository. I have also added the following repositories.
mavenRepo "http://repo.spring.io/milestone/"
mavenRepo "https://repo.grails.org/grails/plugins/org/grails/plugins/"
Thanks!
Add spring security plugin in BuildConfig.groovy as follws,
grails.project.dependency.resolver = "maven"
grails.project.dependency.resolution = {
dependencies {
//OTHER PLUGINS here
runtime "org.springframework:spring-test:4.0.7.RELEASE"
}
plugins {
//OTHER PLUGINS here
compile ':spring-security-core:2.0-RC5'
}
}
Do grails clean and grails compile or run-app

Linker error when passing data from Swift to Objective C

I am using FXForm Library and want to get data from my Swift file in Objective C file function.
Demo Project Link
Swift Code Implimnetation:
let fontName = "HelveticaNeue"
let fontSizeLarge:CGFloat = 14.0
var hiddenElementFromFormIndex = [Int]()
//fx form variables
#objc class FXFormVariables : NSObject {
public override init() {}
class func FXFontName() -> String { return fontName }
class func FXFontSize() -> CGFloat { return fontSizeLarge }
class func FXHiddenCell() -> NSArray { return hiddenElementFromFormIndex as NSArray }
}
In Objective C file, I am getting error when we write below like:
NSArray *hideArray = [FXFormVariables FXHiddenCell];
I created the bridge header file correctly and Target Membership is checked in the Objective C file.
Error I am getting:
Undefined symbols for architecture x86_64:
"_OBJC_CLASS_$__TtCC13Social_Engine11AppDelegate15FXFormVariables", referenced from:
objc-class-ref in FXForms.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Architectures and Valid Architectures are:
armv7 and armv64
To use Swift class inside Objective-C file you need to import Xcode-generated header file in your Objective-C file.
#import "ProductModuleName-Swift.h"
I created a Test project with the same name.
Swift File:
//
// FXFormVariables.swift
// Test
//
// Created by Puneet Sharma2 on 12/07/17.
// Copyright © 2017 com.puneet.sh2525. All rights reserved.
//
import Foundation
import UIKit
let fontName = "HelveticaNeue"
let fontSizeLarge:CGFloat = 14.0
var hiddenElementFromFormIndex = [Int]()
//fx form variables
#objc class FXFormVariables : NSObject {
public override init() {}
class func FXFontName() -> String { return fontName }
class func FXFontSize() -> CGFloat { return fontSizeLarge }
class func FXHiddenCell() -> NSArray { return hiddenElementFromFormIndex as NSArray }
}
Objective-C File
#import "ABC.h"
#import "Test-Swift.h"
#implementation ABC
- (void)drawRect:(CGRect)rect {
NSArray *hideArray = [FXFormVariables FXHiddenCell];
}
You can read more about it here.
Literally I spent hours trying to figure out why this was happening with one of my swift files that i was importing into my Objc codebase, and the real reason was due to the use of a nested class.
Such as:
#objc public class MyClass {
#objc public class SecondClass {}
}
And if I tried using SecondClass in my objective-c code, I would the Apple Mach O-Link errors of death. So the solution was to de-nest the class you want to use.
#objc public class MyClass {}
#objc public class SecondClass {}

CLANG: Elaborated type refers to a typedef error

Here is my code snippet
template <class T>
struct ClassFriendMaker
{
typedef T Type;
};
template <class T>
class Singleton
{
friend class ClassFriendMaker<T>::Type; // Problem in this line
//Other declaration
}
When compiled with CLANG, it gave me an error:
error: elaborated type refers to a typedef
friend class ClassFriendMaker<T>::Type;
^
May I know what's wrong ? Thankyou
Replace class with typename in friend declaration
friend class ClassFriendMaker<T>::Type;
friend typename ClassFriendMaker<T>::Type;

UnityAds generated iOS project error

I'm using UnityAds for an iOS/Android game and when generating the Xcode project for iOS I get the following compiler errors related to UnityAdsWrapper.mm, a file generated by Unity
/ProjectDir/Builds/Build/Classes/UnityAds/UnityAdsUnityWrapper.mm:105:15: error: no known class method for selector 'sharedInstance'
[[UnityAds sharedInstance] setUnityVersion: UnityAdsCreateNSString(unityVersion)];
^~~~~~~~~~~~~~
/ProjectDir/Builds/Build/Classes/UnityAds/UnityAdsUnityWrapper.mm:105:31: error: no known instance method for selector 'setUnityVersion:'
[[UnityAds sharedInstance] setUnityVersion: UnityAdsCreateNSString(unityVersion)];
^~~~~~~~~~~~~~~
/ProjectDir/Builds/Build/Classes/UnityAds/UnityAdsUnityWrapper.mm:126:18: error: no known class method for selector 'sharedInstance'
if ([[UnityAds sharedInstance] canShowZone:zoneId])
^~~~~~~~~~~~~~
/ProjectDir/Builds/Build/Classes/UnityAds/UnityAdsUnityWrapper.mm:126:34: error: no known instance method for selector 'canShowZone:'
if ([[UnityAds sharedInstance] canShowZone:zoneId])
^~~~~~~~~~~
/ProjectDir/Builds/Build/Classes/UnityAds/UnityAdsUnityWrapper.mm:130:16: error: no known class method for selector 'sharedInstance'
[[UnityAds sharedInstance] setZone:zoneId withRewardItem:rewardItemKey];
^~~~~~~~~~~~~~
/ProjectDir/Builds/Build/Classes/UnityAds/UnityAdsUnityWrapper.mm:130:32: error: no known instance method for selector 'setZone:withRewardItem:'
[[UnityAds sharedInstance] setZone:zoneId withRewardItem:rewardItemKey];
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/ProjectDir/Builds/Build/Classes/UnityAds/UnityAdsUnityWrapper.mm:136:22: error: no known class method for selector 'sharedInstance'
[[UnityAds sharedInstance] setZone:zoneId];
^~~~~~~~~~~~~~
/ProjectDir/Builds/Build/Classes/UnityAds/UnityAdsUnityWrapper.mm:136:38: error: no known instance method for selector 'setZone:'
[[UnityAds sharedInstance] setZone:zoneId];
^~~~~~~
/ProjectDir/Builds/Build/Classes/UnityAds/UnityAdsUnityWrapper.mm:139:22: error: no known class method for selector 'sharedInstance'
return [[UnityAds sharedInstance] show:optionsDictionary];
^~~~~~~~~~~~~~
/ProjectDir/Builds/Build/Classes/UnityAds/UnityAdsUnityWrapper.mm:139:43: error: cannot initialize a parameter of type 'UIViewController * _Nonnull' with an lvalue of type 'NSMutableDictionary *__strong'
return [[UnityAds sharedInstance] show:optionsDictionary];
^~~~~~~~~~~~~~~~~
In file included from /ProjectDir/Builds/Build/Classes/UnityAds/UnityAdsUnityWrapper.mm:6:
In file included from /ProjectDir/Builds/Build/Classes/UnityAds/UnityAdsUnityWrapper.h:10:
/ProjectDir/Builds/Build/UnityAds.framework/Headers/UnityAds.h:175:34: note: passing argument to parameter 'viewController' here
+ (void)show:(UIViewController *)viewController;
^
/ProjectDir/Builds/Build/Classes/UnityAds/UnityAdsUnityWrapper.mm:146:21: error: no known class method for selector 'sharedInstance'
return [[UnityAds sharedInstance] canShowZone:UnityAdsCreateNSString(rawZoneId)];
^~~~~~~~~~~~~~
/ProjectDir/Builds/Build/Classes/UnityAds/UnityAdsUnityWrapper.mm:146:37: error: no known instance method for selector 'canShowZone:'
return [[UnityAds sharedInstance] canShowZone:UnityAdsCreateNSString(rawZoneId)];
^~~~~~~~~~~
/ProjectDir/Builds/Build/Classes/UnityAds/UnityAdsUnityWrapper.mm:151:14: error: no known class method for selector 'sharedInstance'
[[UnityAds sharedInstance] setDebugMode:debugMode];
^~~~~~~~~~~~~~
/ProjectDir/Builds/Build/Classes/UnityAds/UnityAdsUnityWrapper.mm:156:14: error: no known class method for selector 'sharedInstance'
[[UnityAds sharedInstance] setCampaignDataURL:UnityAdsCreateNSString(url)];
^~~~~~~~~~~~~~
/ProjectDir/Builds/Build/Classes/UnityAds/UnityAdsUnityWrapper.mm:156:30: error: no known instance method for selector 'setCampaignDataURL:'
[[UnityAds sharedInstance] setCampaignDataURL:UnityAdsCreateNSString(url)];
^~~~~~~~~~~~~~~~~~
/ProjectDir/Builds/Build/Classes/UnityAds/UnityAdsUnityWrapper.mm:45:14: error: no known class method for selector 'sharedInstance'
[[UnityAds sharedInstance] setDelegate:self];
^~~~~~~~~~~~~~
/ProjectDir/Builds/Build/Classes/UnityAds/UnityAdsUnityWrapper.mm:46:14: error: no known class method for selector 'sharedInstance'
[[UnityAds sharedInstance] setDebugMode:debugMode];
^~~~~~~~~~~~~~
/ProjectDir/Builds/Build/Classes/UnityAds/UnityAdsUnityWrapper.mm:47:14: error: no known class method for selector 'sharedInstance'
[[UnityAds sharedInstance] setTestMode:testMode];
^~~~~~~~~~~~~~
/ProjectDir/Builds/Build/Classes/UnityAds/UnityAdsUnityWrapper.mm:47:30: error: no known instance method for selector 'setTestMode:'
[[UnityAds sharedInstance] setTestMode:testMode];
^~~~~~~~~~~
fatal error: too many errors emitted, stopping now [-ferror-limit=]
20 errors generated.
Anyone have a workaround or fix for this?
It looks like you have an old version of UnityAds - try the latest from the Asset Store.

Resources