2

After implementing Huawei push service in my android project, I was getting crash on the occurrence of Push Notification, and error was looged

java.lang.UnsatisfiedLinkError: No implementation found for void crc6415d7e49b4cd3bc6f.MyApplication.n_onCreate()

To resolve this error, I crated MyApplication to extend the Application.

[Application]
    public class MyApplication : Application
    {
        public MyApplication(IntPtr javaReference, JniHandleOwnership transfer) : base(javaReference, transfer)
        {

        }

        public override void OnCreate()
        {
            base.OnCreate();
        }
    }

then I am getting

Error XAGJS7009: System.InvalidOperationException: There can be only one type with an [Application] attribute; found:,

Note

  1. I have tried adding these lines as well
    #if DEBUG
    [Application(Debuggable=true)]
    #else
    [Application(Debuggable=false)]
    #endif

but still getting the same issue

  1. Already tried Clean and Rebuild solution

1 Answers1

0

You have to delete Application file first. Open The Library project then find XPush-5.0.2.300 -> HmsPush -> Application file then delete it.

Then add below code line to your Application's OnCreate() method if you want to use feature which is relevant to it.

RegisterActivityLifecycleCallbacks(new MyLifecycleHandler());

In addition this problem will be fixed in the next version.

zhangxaochen
  • 32,744
  • 15
  • 77
  • 108
  • I have done it, but now again I am getting `"java.lang.UnsatisfiedLinkError: No implementation found for void crc6415d7e49b4cd3bc6f.MyApplication.n_onCreate()"` on occurance of push notification – Prashant Gautam Jan 12 '21 at 10:23
  • @PrashantGautam Please try to clean and delete **obj and bin folder** of main project before Build, and see if it works. – zhangxaochen Jan 12 '21 at 10:54