城市飞艇罐问题

时间:2014-10-19 08:48:58

标签: java android push-notification urbanairship.com

您好我决定使用Urban Airship在Android上处理我的通知。 但是在RunTime中出现了这个错误:

ERROR/AndroidRuntime(16575): FATAL EXCEPTION: Thread-9778
        java.lang.NoClassDefFoundError: com.urbanairship.R$string
        at com.urbanairship.push.NotificationActionButtonGroupFactory.createUrbanAirshipGroups(NotificationActionButtonGroupFactory.java:40)
        at com.urbanairship.push.PushManager.<init>(PushManager.java:198)
        at com.urbanairship.push.PushManager.<init>(PushManager.java:186)
        at com.urbanairship.UAirship.<init>(UAirship.java:107)
        at com.urbanairship.UAirship.executeTakeOff(UAirship.java:302)
        at com.urbanairship.UAirship.access$000(UAirship.java:54)
        at com.urbanairship.UAirship$2.run(UAirship.java:260)
        at java.lang.Thread.run(Thread.java:841)

我正在尝试使用最后的Urban airship lib:

  

urbanairship-LIB-5.0.1.jar

使用:

  

机器人支撑-v4.jar

我的AndroidManifest正在关注Documenttation,这是我的应用程序类:

public class TestApplication extends Application {

    @Override
    public void onCreate() {
        super.onCreate();

        AirshipConfigOptions options = AirshipConfigOptions.loadDefaultOptions(this);
        options.developmentAppKey = "***";
        options.developmentAppSecret = "***";
        options.productionAppKey = "***";
        options.productionAppSecret = "***";
        options.inProduction = false;
        UAirship.takeOff(this, options);

        //String channelId = UAirship.shared().getPushManager().getChannelId();
        //Log.i(TAG, "My Application Channel ID: " + channelId);
    }
}

2 个答案:

答案 0 :(得分:2)

下载最新的软件包时,您会找到一个名为urbanairship-lib的文件夹。将该文件夹作为库项目添加到Eclipse,并作为App项目的依赖项目。 urbanairship-lib项目包含urban airship-lib-5.0.2.jar以及字符串定义OUTSIDE the airship-lib-5.0.2.jar。这就是为什么如果你只使用airship-lib-5.0.2.jar,你会得到java.lang.NoClassDefFoundError:com.urbanairship.R $ string。希望这会有所帮助。

答案 1 :(得分:1)