You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
在部分手机上运行会崩溃,但是把MainApplication.java下面原本设置的 @Override public void onCreate() { super.onCreate(); //下面是添加的代码 // this.initCloudChannel(this); //添加结束 SoLoader.init(this, /* native exopackage */ false); }
里面的 this.initCloudChannel(this);注释掉,app正常运行。
debug版本的app运行正常,并且没有报下面的错误。
release版本闪退logcat报错主要如下
FATAL EXCEPTION: main
Process: com.egame_android, PID: 10185
java.lang.ExceptionInInitializerError
at f.a.b.a.a.a.f.c.a(Unknown Source:0)
at f.a.b.a.a.a.e.c.a(Unknown Source:2)
at com.alibaba.sdk.android.push.j.a.a(Unknown Source:18)
at com.egame_android.MainApplication.a(Unknown Source:3)
at com.egame_android.MainApplication.onCreate(Unknown Source:3)
at android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:1162)
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:6717)
at android.app.ActivityThread.access$2000(ActivityThread.java:273)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2020)
at android.os.Handler.dispatchMessage(Handler.java:112)
at android.os.Looper.loop(Looper.java:216)
at android.app.ActivityThread.main(ActivityThread.java:7625)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:524)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:987)
Caused by: java.lang.IllegalStateException: Fail to load ams-spi-services for f.a.b.a.a.a.f.a
at f.a.b.a.a.a.f.d.a(Unknown Source:46)
at f.a.b.a.a.a.f.b.(Unknown Source:13)
at f.a.b.a.a.a.f.c.a(Unknown Source:0)
at f.a.b.a.a.a.e.c.a(Unknown Source:2)
at com.alibaba.sdk.android.push.j.a.a(Unknown Source:18)
at com.egame_android.MainApplication.a(Unknown Source:3)
at com.egame_android.MainApplication.onCreate(Unknown Source:3)
at android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:1162)
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:6717)
at android.app.ActivityThread.access$2000(ActivityThread.java:273)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2020)
at android.os.Handler.dispatchMessage(Handler.java:112)
at android.os.Looper.loop(Looper.java:216)
at android.app.ActivityThread.main(ActivityThread.java:7625)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:524)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:987)
在部分手机上运行会崩溃,但是把MainApplication.java下面原本设置的
@Override public void onCreate() { super.onCreate(); //下面是添加的代码 // this.initCloudChannel(this); //添加结束 SoLoader.init(this, /* native exopackage */ false); }
里面的 this.initCloudChannel(this);注释掉,app正常运行。
debug版本的app运行正常,并且没有报下面的错误。
release版本闪退logcat报错主要如下
FATAL EXCEPTION: main
Process: com.egame_android, PID: 10185
java.lang.ExceptionInInitializerError
at f.a.b.a.a.a.f.c.a(Unknown Source:0)
at f.a.b.a.a.a.e.c.a(Unknown Source:2)
at com.alibaba.sdk.android.push.j.a.a(Unknown Source:18)
at com.egame_android.MainApplication.a(Unknown Source:3)
at com.egame_android.MainApplication.onCreate(Unknown Source:3)
at android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:1162)
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:6717)
at android.app.ActivityThread.access$2000(ActivityThread.java:273)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2020)
at android.os.Handler.dispatchMessage(Handler.java:112)
at android.os.Looper.loop(Looper.java:216)
at android.app.ActivityThread.main(ActivityThread.java:7625)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:524)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:987)
Caused by: java.lang.IllegalStateException: Fail to load ams-spi-services for f.a.b.a.a.a.f.a
at f.a.b.a.a.a.f.d.a(Unknown Source:46)
at f.a.b.a.a.a.f.b.(Unknown Source:13)
at f.a.b.a.a.a.f.c.a(Unknown Source:0)
at f.a.b.a.a.a.e.c.a(Unknown Source:2)
at com.alibaba.sdk.android.push.j.a.a(Unknown Source:18)
at com.egame_android.MainApplication.a(Unknown Source:3)
at com.egame_android.MainApplication.onCreate(Unknown Source:3)
at android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:1162)
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:6717)
at android.app.ActivityThread.access$2000(ActivityThread.java:273)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2020)
at android.os.Handler.dispatchMessage(Handler.java:112)
at android.os.Looper.loop(Looper.java:216)
at android.app.ActivityThread.main(ActivityThread.java:7625)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:524)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:987)
react-natiive版本0.58.6
react-native-aliyun-push版本 1.0.17
android/build.gradle:
android/app/build.gradle
MainApplication.java:
// 下面是被添加的代码
import android.app.NotificationChannel;
import android.app.NotificationManager;
import android.content.Context;
import android.graphics.Color;
import android.os.Build;
import org.wonday.aliyun.push.AliyunPushPackage;
import com.alibaba.sdk.android.push.CloudPushService;
import com.alibaba.sdk.android.push.CommonCallback;
import com.alibaba.sdk.android.push.noonesdk.PushServiceFactory;
import com.alibaba.sdk.android.push.register.HuaWeiRegister;
import com.alibaba.sdk.android.push.register.MiPushRegister;
import com.alibaba.sdk.android.push.register.GcmRegister;
// 添加结束
public class MainApplication extends MultiDexApplication implements ReactApplication{
private ReactNativeHost mReactNativeHost = new ReactNativeHost(this) {
//private final ReactNativeHost mReactNativeHost = new ReactNativeHost(this) {
@OverRide
public boolean getUseDeveloperSupport() {
return BuildConfig.DEBUG;
}
};
public void setReactNativeHost(ReactNativeHost reactNativeHost) {
mReactNativeHost = reactNativeHost;
}
@OverRide
public ReactNativeHost getReactNativeHost() {
return mReactNativeHost;
}
@OverRide
public void onCreate() {
super.onCreate();
//下面是添加的代码
this.initCloudChannel(this);
//添加结束
SoLoader.init(this, /* native exopackage */ false);
}
// 下面是添加的代码
/**
* 初始化阿里云推送通道
* @param applicationContext
*/
private void initCloudChannel(final Context applicationContext) {
}
The text was updated successfully, but these errors were encountered: