ios bangding Enum crashed.

39 views
Skip to first unread message

纯洁的坏蛋

unread,
Nov 3, 2015, 6:33:11 AM11/3/15
to RoboVM
java.lang.NullPointerException
 at org
.robovm.rt.bro.ValuedEnum$AsSignedIntMarshaler.toNative(ValuedEnum.java:103)
 at org
.robovm.apple.uikit.UIApplication.main(Native Method)
 at org
.robovm.apple.uikit.UIApplication.main(UIApplication.java:395)
 at net
.mwplay.iosbanding.IOSLauncher.main(IOSLauncher.java:35)



//use

bannerAdView = new BaiduMobSspBannerView(
 
BaiduMobSspAdViewType.BaiduMobSspAdViewTypeLargeBanner, this);
 bannerAdView
.setFrame(new CGRect(0, 350, 320, 50));
 
this.getView().addSubview(bannerAdView);

//The enum is

//typedef enum {

//    BaiduMobSspAdViewTypeUnknown          = 0,  //error

//   BaiduMobSspAdViewTypeNormalBanner     = 1,  //e.g. 320 * 50 ; 320 * 48...           iphone banner

//    BaiduMobSspAdViewTypeLargeBanner      = 2,  //e.g. 728 * 90 ; 768 * 110             ipad only

//    BaiduMobSspAdViewTypeMediumBanner     = 3,  //e.g. 468 * 60 ; 508 * 80              ipad only

//    BaiduMobSspAdViewTypeRectangle        = 4,  //e.g. 300 * 250; 320 * 270             ipad only

//    BaiduMobSspAdViewTypeSky              = 5,  //Don't support

//    BaiduMobSspAdViewTypeFullScreen       = 6,  //iphone full screen ad

//    BaiduMobSspAdViewTypeVideo            = 11, //iPad and iPhone use video ad

//    BaiduMobSspAdViewTypeiPadNormalBanner = 8,  //ipad full width banner

//    BaiduMobSspAdViewTypeiPadFullScreen   = 9,  //ipad full screen ad e.g. 1024*768     ipad only

//    BaiduMobSspAdViewTypeCustomSize       = 10, //iPad and iPhone use custom size

//    BaiduMobSspAdViewTypeSplash           = 12, // IOS Splash Ad

//    BaiduMobSspAdViewTypeiPhoneRectangle  = 14,// iPhone 300*250

//} BaiduMobSspAdViewType;


@Marshaler(ValuedEnum.AsMachineSizedSIntMarshaler.class)

public enum BaiduMobSspAdViewType implements ValuedEnum{

BaiduMobSspAdViewTypeUnknown(0),

BaiduMobSspAdViewTypeNormalBanner(1),

BaiduMobSspAdViewTypeLargeBanner(2),

BaiduMobSspAdViewTypeBanner(3),

BaiduMobSspAdViewTypeRectangle(4),

BaiduMobSspAdViewTypeSky(5),

BaiduMobSspAdViewTypeFullScreen(6),

BaiduMobSspAdViewTypeVideo(11),

BaiduMobSspAdViewTypeiPadNormalBanner(8),

BaiduMobSspAdViewTypeiPadFullScreen(9),

BaiduMobSspAdViewTypeCustomSize(10),

BaiduMobSspAdViewTypeSplash(12),

BaiduMobSspAdViewTypeiPhoneRectangle(14);


private final long n;

private BaiduMobSspAdViewType(long n) {

this.n = n;

}

@Override

public long value() {

return n;

}

public static /*<name>*/BaiduMobSspAdViewType/*</name>*/ valueOf(long n) {

        for (/*<name>*/BaiduMobSspAdViewType/*</name>*/ v : values()) {

            if (v.n == n) {

                return v;

            }

        }

        throw new IllegalArgumentException("No constant with value " + n + " found in " 

            + /*<name>*/BaiduMobSspAdViewType/*</name>*/.class.getName());

    }


}

纯洁的坏蛋

unread,
Nov 3, 2015, 7:55:47 PM11/3/15
to RoboVM
somebody help me...

在 2015年11月3日星期二 UTC+8下午7:33:11,纯洁的坏蛋写道:

Jinfu Yu

unread,
Nov 3, 2015, 9:26:11 PM11/3/15
to RoboVM
do you try whether it work if delete @Marshaler(ValuedEnum.AsMachineSizedSIntMarshaler.class) ?

在 2015年11月4日星期三 UTC+8上午8:55:47,纯洁的坏蛋写道:
Reply all
Reply to author
Forward
0 new messages