gpt4 book ai didi

android - Urban Airship 在起飞时坠毁。非法参数异常

转载 作者:太空宇宙 更新时间:2023-11-03 11:45:04 25 4
gpt4 key购买 nike

我在 Applicaion.onCreate 中的代码。应用程序在 UAirship.takeoff(this,options); 处崩溃 请帮忙。

public class LiveVideoApplication extends Application {
@Override
public void onCreate() {

super.onCreate();

AirshipConfigOptions options = AirshipConfigOptions.loadDefaultOptions(this);

// Optionally, customize your config at runtime:
//
options.inProduction = false;
options.developmentAppKey = "key.. ";
options.developmentAppSecret = "secret..";

UAirship.takeOff(this, options);
PushManager.shared().setIntentReceiver(IntentReceiver.class);
Logger.logLevel = Log.VERBOSE;

//use CustomPushNotificationBuilder to specify a custom layout
CustomPushNotificationBuilder nb = new CustomPushNotificationBuilder();

nb.statusBarIconDrawableId = R.drawable.icon_small;//custom status bar icon
//
nb.layout = R.layout.notification;
nb.layoutIconDrawableId = R.drawable.icon;//custom layout icon
nb.layoutIconId = R.id.icon;
nb.layoutSubjectId = R.id.subject;
nb.layoutMessageId = R.id.message;

// customize the sound played when a push is received
nb.soundUri = Uri.parse("android.resource://"+this.getPackageName()+"/" +R.raw.cat);

PushManager.shared().setNotificationBuilder(nb);
PushManager.shared().setIntentReceiver(IntentReceiver.class);

}
}

异常日志:

03-15 00:25:37.106: E/AndroidRuntime(2920): FATAL EXCEPTION: main
03-15 00:25:37.106: E/AndroidRuntime(2920): java.lang.RuntimeException: Unable to create application com.LiveVideoApplication: java.lang.IllegalArgumentException: Application configuration is invalid.
03-15 00:25:37.106: E/AndroidRuntime(2920): at android.app.ActivityThread.handleBindApplication(ActivityThread.java:3275)
03-15 00:25:37.106: E/AndroidRuntime(2920): at android.app.ActivityThread.access$2200(ActivityThread.java:117)
03-15 00:25:37.106: E/AndroidRuntime(2920): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:969)
03-15 00:25:37.106: E/AndroidRuntime(2920): at android.os.Handler.dispatchMessage(Handler.java:99)
03-15 00:25:37.106: E/AndroidRuntime(2920): at android.os.Looper.loop(Looper.java:123)
03-15 00:25:37.106: E/AndroidRuntime(2920): at android.app.ActivityThread.main(ActivityThread.java:3683)
03-15 00:25:37.106: E/AndroidRuntime(2920): at java.lang.reflect.Method.invokeNative(Native Method)
03-15 00:25:37.106: E/AndroidRuntime(2920): at java.lang.reflect.Method.invoke(Method.java:507)
03-15 00:25:37.106: E/AndroidRuntime(2920): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839)
03-15 00:25:37.106: E/AndroidRuntime(2920): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597)
03-15 00:25:37.106: E/AndroidRuntime(2920): at dalvik.system.NativeStart.main(Native Method)
03-15 00:25:37.106: E/AndroidRuntime(2920): Caused by: java.lang.IllegalArgumentException: Application configuration is invalid.
03-15 00:25:37.106: E/AndroidRuntime(2920): at com.urbanairship.UAirship.takeOff(Unknown Source)
03-15 00:25:37.106: E/AndroidRuntime(2920): at com.LiveVideoApplication.onCreate(LiveVideoApplication.java:27)
03-15 00:25:37.106: E/AndroidRuntime(2920): at android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:969)
03-15 00:25:37.106: E/AndroidRuntime(2920): at android.app.ActivityThread.handleBindApplication(ActivityThread.java:3272)

最佳答案

我也遇到过这个问题,我解决了。我会建议您确保您已经在 UrbanAirship 上创建了一个应用程序,其中包含与您的应用程序相同的应用程序包。还要确保您的 key 和 secret 是正确的。

IllegalArgumentExceptiondevelopmentAppKey 和 developmentAppSecret 错误时抛出。或者 key 和密码正确但您的远程 Urban Airship 测试应用程序具有不同的应用程序包集。 p>

关于android - Urban Airship 在起飞时坠毁。非法参数异常,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9708885/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com