[Solved] Libgdx 1.9.5 crashed with "/NatJ.cpp:353 INFO: Method xxx s not accessible"

libgdx 1.9.5 moe gradle: 1.2.5
use link framework to auto make bingdings. Please help.
And the error is:

/Users/tian/Documents/work/libgdx/nativefont/gradlew moeLaunch -Pmoe.launcher.options=no-build,config:Debug -Pmoe.launcher.simulators=40B4B26E-6642-4860-AE36-FA1A1A41D4A8
Configuration on demand is an incubating feature.
:ios-moe:moeLaunchart I 99388 11299153 /Volumes/SSD/gh-moe-master-1.2.4/aosp/art/runtime/parsed_options.cc:449] setting boot class path to /Users/tian/Library/Developer/CoreSimulator/Devices/40B4B26E-6642-4860-AE36-FA1A1A41D4A8/data/Containers/Bundle/Application/381929F9-B2B9-4D4F-81EB-DDC549C26FD7/ios-moe.app/application.jar:/Users/tian/Library/Developer/CoreSimulator/Devices/40B4B26E-6642-4860-AE36-FA1A1A41D4A8/data/Containers/Bundle/Application/381929F9-B2B9-4D4F-81EB-DDC549C26FD7/ios-moe.app

/Volumes/SSD/gh-moe-master-1.2.4/moe/natj/natj/src/main/native/natj/NatJ.cpp:353 INFO: Method 'boolean java.lang.reflect.Method.isDefault()' is not accessible.
(null)2016-12-12 13:38:24.451 ios-moe[99388:11299153] +[NSObject sharedInstance]: unrecognized selector sent to class 0x117fae58
org.moe.natj.objc.ObjCException: +[NSObject sharedInstance]: unrecognized selector sent to class 0x117fae58
	at apple.uikit.c.UIKit.UIApplicationMain(Native Method)
	at net.mwplay.nativefont.test.IOSMoeLauncher.main(IOSMoeLauncher.java:43)
art I 99390 11299196 /Volumes/SSD/gh-moe-master-1.2.4/aosp/art/runtime/parsed_options.cc:449] setting boot class path to /Users/tian/Library/Developer/CoreSimulator/Devices/40B4B26E-6642-4860-AE36-FA1A1A41D4A8/data/Containers/Bundle/Application/381929F9-B2B9-4D4F-81EB-DDC549C26FD7/ios-moe.app/application.jar:/Users/tian/Library/Developer/CoreSimulator/Devices/40B4B26E-6642-4860-AE36-FA1A1A41D4A8/data/Containers/Bundle/Application/381929F9-B2B9-4D4F-81EB-DDC549C26FD7/ios-moe.app
/Volumes/SSD/gh-moe-master-1.2.4/moe/natj/natj/src/main/native/natj/NatJ.cpp:353 INFO: Method 'boolean java.lang.reflect.Method.isDefault()' is not accessible.

The SuperSdk is:

//
//  OPPlatform.h
//  one_SDK
//
//  Created by YouZu on 14-8-20.
//  Copyright (c) 2014年 youzu. All rights reserved.
//

#import <Foundation/Foundation.h>
#import "SuperSdkDefines.h"
#import "SuperSdkGameData.h"
@interface SuperSdkOpenApi : NSObject
// 创建单例对象
+ (SuperSdkOpenApi *)sharedInstance;

/**
 *  Description:平台初始接口
 *
 *  @param delegate    被委托对象
 *  @param type        Url域名访问类型:SuperSdkUrlTypeDomestic表示访问国内的域名,越狱平台和国内的appstore需要访问国内的域名;SuperSdkUrlTypeForeign表示访问海外域名,目前YouZuGTA和Ican平台需要访问海外的域名
 */
- (void)initPlatformWithDeleagte:(id<SuperSdkOpenApiDelegate>) delegate
             withSuperSdkUrlType:(SuperSdkUrlType)type;

// 登录接口
- (void)showLoginMode2;

// 注销接口
- (void)logout:(SuperSdkGameData *)gameData;

/**
 *  Description:支付接口
 *
 *  @param price       商品价格
 *  @param productId   商品Id
 *  @param productName 商品名
 *  @param productDesc 商品描述信息
 *  @param pointRate   游戏币与人民币比率
 *  @param pointName   游戏币名
 *  @param orderTitle  订单标题
 *  @param gameData    游戏数据
 *  @param payExtra    充值成功后透传给后端服务器的参数
 */
- (void)pay:(unsigned int)price
withProductId:(NSString *)productId
withProductName:(NSString *)productName
withProductDesc:(NSString *)productDesc
withPointRate:(NSString *)pointRate
withPointName:(NSString *)pointName
withOrderTitle:(NSString *)orderTitle
withGameData:(SuperSdkGameData *)gameData
withPayExtra:(NSString *)payExtra;

// 当前账号是否为游客账号
- (BOOL)isGuest;
// 打开游客账号升级
- (void)upgradeGuest;

// 打开客服中心接口,只有在openCustomerService返回真情况下才能用
- (BOOL)hasCustomerService;
- (void)openCustomerService:(SuperSdkGameData *)gameData;

// 打开个人中心接口,只有在openPlatformCenter返回真情况下才能用
- (BOOL)hasPersonalCenter;
- (void)openPersonalCenter:(SuperSdkGameData *)gameData;

// 打开论坛接口,只有在hasForum返回真情况下才能用
- (BOOL)hasForum;
- (void)openForum:(SuperSdkGameData *)gameData;

// 开关悬浮窗,只有在hasFloatWindow返回真才能使用
- (BOOL)hasFloatWindow;
- (void)openFloatWindow:(int)x withY:(int)y withGameData:(SuperSdkGameData *)gameData;
- (void)closeFloatWindow;

/**
 *  Description:生命周期接口
 *
 *  @param 参数请传对应生命周期接口的参数、如果没有请传nil
 */

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions;//程序加载完毕

- (void)applicationWillResignActive:(UIApplication *)application;//暂停、进入未激活态

- (void)applicationDidBecomeActive:(UIApplication *)application;//激活

- (void)applicationDidEnterBackground:(UIApplication *)application;//进入后台

- (void)applicationWillEnterForeground:(UIApplication *)application;//将要进入前台

- (void)applicationWillTerminate:(UIApplication *)application;//程序销毁

- (BOOL)application:(UIApplication *)application openURL:(NSURL *)url sourceApplication:(NSString *)sourceApplication annotation:(id)annotation;//应用程序间跳转,主要用于支付、facebook等跳转回游戏

- (NSUInteger)application:(UIApplication *)application supportedInterfaceOrientationsForWindow:(UIWindow *)window;//控制方向、一般用于银联支付界面

/**
 *  Description:游戏事件接口
 *
 *  @param 有  InitEnd/GameCheckVersionBegin/GameCheckVersionEnd/LoginView/OpenMainPage/enterGame/createRole/levelUp,分别对应 游戏初始化结束/游戏内更新开始/游戏内更新结果/到达登录页面/到达游戏主页面/进入游戏/创建角色/角色升级 时调用
 */

- (void)performGameEventOfGameInitEnd;//游戏初始化结束事件

- (void)performGameEventOfGameCheckVersionBegin;//游戏内更新开始事件

- (void)performGameEventOfGameCheckVersionEnd:(BOOL)result;//游戏内更新结束事件,即内更新成功或失败

- (void)performGameEventOfLoginView;//到达游戏登录页面

- (void)performGameEventOfEnterGame:(SuperSdkGameData*)gameData;//进入游戏事件接口

- (void)performGameEventOfOpenMainPage:(SuperSdkGameData *)gameData;//到达游戏主页面

- (void)performGameEventOfCreateRole:(SuperSdkGameData*)gameData;//创建角色事件接口

- (void)performGameEventOfLevelUp:(SuperSdkGameData*)gameData;//角色升级事件接口

// 广告接口
/**
 *  Description:广告SDK初始化接口,不必等平台初始化
 */
- (void)initAdSDK;

/**
 *  Description:广告SDK触发事件接口,具体使用方式,请见广告SDK文档。
 *
 *  @param eventId  事件ID
 *  @param paramDic 额外参数
 */
- (void)trackEvent:(NSString *)eventId extraParam:(NSDictionary *)paramDic;

// 统计接口
/**
 *  Description:统计SDK初始化接口,不必等平台初始化
 */
- (void)statInit;

/**
 *  Description:设置用户信息接口
 *  accountInfo字典中对应的key值为 角色名:@"role_name",角色id:@"role_id",第三方平台uid:@"account",游戏服务器id:@"server_id"
 */
- (void)statSetAccountInfo:(NSDictionary*) accountInfo;

/**
 *  Description:通用事件、错误上报、debug接口
 *  customInfo、errorInfo、debugInfo三个字典中的key值为 事件ID(必传):@"event_id",事件描述:@"event_desc",事件详细信息:@"event_detail",其他信息:@"event_extra"
 */
- (void)statOnCustomInfo:(NSDictionary*) customInfo;//通用事件接口

- (void)statError:(NSDictionary*) errorInfo;//错误上报接口

- (void)statDebug:(NSDictionary*) debugInfo;//debug上报接口

// 获得当前设备号
- (NSString *)getDeviceId;

// 得到本包关联的配置参数
// 根据keyName获得对应的value值,如果不存在,则返回指定的默认值defaultValue
- (NSString *)getConfigParam:(NSString *)keyName withDefault:(NSString *)defaultValue;

/**
* @brief 是否打印log到控制台、默认不打印
*/
- (void)OPSuperSdkSetShowSDKLog:(BOOL)isShow;

/**
 * @brief 是否打开SDK统计上报功能、默认为打开状态
 */
- (void)SuperSdkCommitStat:(BOOL)isCommit;

/**
 *@brief 是否打开FlyCode功能、默认打开状态
 */
- (void)SuperSdkFlycode:(BOOL)isOpen;

//特殊接口、一般在平台接入文档中有使用说明、很少用到
- (int)callSpecialInterface:(int)eventId withParam:(NSDictionary *)paramDic;

// 获取设备采集数据
- (NSString *)getCollectionData;

/*其他接口,不常用*/
// 登录接口 登录模式一
- (void)showLogin;
// 快速登录接口,只有在hasFastLogin返回真的情况下才能使用快速登录接口
- (BOOL)hasFastLogin;
- (void)fastLogin;
- (void)fastLoginMode2;

/**
 *  Description:注销类型接口
 *  注销接口的4中形态:
 *  第1种表示不知道第三方平台是否有注销接口,以及有注销接口时,是否会有注销弹框,返回值为LOGOUT_WITH_NO_TYPE,主要用于兼容以前没有该接口;
 *  第2种表示第三方平台没有注销接口,调用SuperSdk注销接口默认注销成功,返回值为LOGOUT_WITH_NO_IMPLEMENT;
 *  第3种表示第三方平台有注销接口,注销时会有弹框问你是否注销,返回值为LOGOUT_WITH_OPEN_LOGOUT_DIALOG;
 *  第4种表示第三方平台没有注销接口,注销时不会有弹框,直接注销了,返回值为LOGOUT_WITH_NOT_OPEN_LOGOUT_DIALOG.
 */
- (int)getLogoutType;

// 一般不需要使用以下闪屏接口,闪屏请使用iOS工程的闪屏功能,即在工程中的images.xcassets中把闪屏图片按尺寸拖进去就行了
/**
 *  Description:闪屏接口,这个接口必须在初始化后调用才有回调
 *
 *  @param logoName     图片名
 */

- (void)showLogo:(NSString *)logoName;

/**
 *  Description:闪屏接口,这个接口不会有回调,可以在hanlder里处理
 *
 *  @param logoName     图片名
 */
- (void)showLogo:(NSString *)logoName completionHandler:(void(^)())handler;
#pragma mark 弃用接口
//- (void)statSetUncaughtExceptionHandler SuperSdk_DEPRECATED(2.1.6);//设置捕捉系统异常监听、必须放在AppDelegate的application: didFinishLaunchingWithOptions:事件中调用
//- (void)handleOpenUrl:(NSURL *)url SuperSdk_DEPRECATED(2.1.6);//跳转第三方app操作结束后转回到游戏
//- (void)performGameEventOfPauseGame:(SuperSdkGameData*)gameData SuperSdk_DEPRECATED(2.1.6);//暂停游戏事件接口
//- (void)performGameEventOfResumeGame:(SuperSdkGameData*)gameData SuperSdk_DEPRECATED(2.1.6);//恢复游戏事件接口
//- (void)performGameEventOfExitGame:(SuperSdkGameData*)gameData SuperSdk_DEPRECATED(2.1.4);//退出游戏事件接口
//- (void)performGameEventOfDestroyGame:(SuperSdkGameData*)gameData SuperSdk_DEPRECATED(2.1.4);//游戏销毁事件接口
//- (void)exitGame:(SuperSdkGameData *)gameData SuperSdk_DEPRECATED(2.1.4);//退出游戏接口-iOS没有退出页,所以取消此接口,相应的退出游戏回调接口也取消了。
@end

NoBody help ?..

NoBody help ?..

Dear Tian,

It looks like that NatJ did not find your SDK class, that is why it bound to NSObject, and of course NSObject does not have a sharedInstance selector.

You need to make sure that your SDK classes are actually in the binary, because if they are not called from Objective-C, the linker might throw them out. For example you can use the -force_load option if they are located in a separate static library.

If you still have a problem with this, please share your project (or a small testcase project that shows the issue), so we can take a look.

Best Regards,
Gergely

Also, it looks like that you are still running on MOE 1.2.4, we recommend that you upgrade to MOE 1.2.5

I am sorry the sdk class are actully in the library, because I write a bingding for robovm , and work normal. But my company ask me use the moe.

/Users/tian/Documents/work/libgdx/nativefont/gradlew moeLaunch -Pmoe.launcher.options=no-build,config:Debug -Pmoe.launcher.simulators=40B4B26E-6642-4860-AE36-FA1A1A41D4A8
Configuration on demand is an incubating feature.
:ios-moe:moeLaunchart I 19214 12194915 /Volumes/SSD/gh-moe-master-1.2.5/aosp/art/runtime/parsed_options.cc:449] setting boot class path to /Users/tian/Library/Developer/CoreSimulator/Devices/40B4B26E-6642-4860-AE36-FA1A1A41D4A8/data/Containers/Bundle/Application/88CAD9B0-1101-47C1-88BD-0393B82F17AF/ios-moe.app/application.jar:/Users/tian/Library/Developer/CoreSimulator/Devices/40B4B26E-6642-4860-AE36-FA1A1A41D4A8/data/Containers/Bundle/Application/88CAD9B0-1101-47C1-88BD-0393B82F17AF/ios-moe.app

/Volumes/SSD/gh-moe-master-1.2.5/moe/natj/natj/src/main/native/natj/NatJ.cpp:353 INFO: Method 'boolean java.lang.reflect.Method.isDefault()' is not accessible.
applicationDidFinishLaunchingWithOptions..
(null), but it can not be found. Fallback to indirect super class.
2016-12-14 21:03:51.176 ios-moe[19214:12194915] +[NSObject sharedInstance]: unrecognized selector sent to class 0x11bb5e58
org.moe.natj.objc.ObjCException: +[NSObject sharedInstance]: unrecognized selector sent to class 0x11bb5e58
	at apple.uikit.c.UIKit.UIApplicationMain(Native Method)
	at net.mwplay.nativefont.test.IOSMoeLauncher.main(IOSMoeLauncher.java:49)

BUILD SUCCESSFUL

Total time: 25.773 secs

i do get the same message on Xcode console, even if i try an new, empty moe project.
i created a new project with the eclipse plugin and let the whole run first on the iPhone.

i got /Volumes/SSD/gh-moe-master-1.2.5/moe/natj/natj/src/main/native/natj/NatJ.cpp:353 INFO: Method 'boolean java.lang.reflect.Method.isDefault()' is not accessible.

i also had this message for my libgdx project, but thought it was an issue of my pro guard settings.
That s why i tried an empty project, but have no crash, just the message in the Xcode console.

Dear all,

the Method 'boolean java.lang.reflect.Method.isDefault()' is not accessible message is only informal, it will most likely never be related to application crashes.

Tian’s app crashes when the app tries to call +[SuperSdkOpenApi sharedInstance] which is not present at runtime and causes MOE to try to invoke +[NSObject sharedInstance] which will fail.

Tian, please make sure the SuperSdk.framework is linked into your application.

Best Regards,
Kristóf

I am sure the SuperSdk.framework is linked into my application.

I am sure

I have similar problem:
/Volumes/SSD/gh-moe-master-1.2.4/moe/natj/natj/src/main/native/natj/NatJ.cpp:353 INFO: Method ‘boolean java.lang.reflect.Method.isDefault()’ is not accessible.
But it happens only when proguardLevel is set to “all”:

moe {
    proguardLevel "all" 
   ...
}

So, if you set proguardLevel to “all”, try to set proguardLevel “app” and check maybe it helps

Hi, I am not set any proguard level

Solved! Because the sdk called

UIApplication.sharedApplication().delegate().window();

But the libgdx moe-backends not override the window method, and return app.window