januslo / react-native-sunmi-inner-printer

http://docs.sunmi.com/htmls/index.html?lang=zh##V1文档资源 根据商米V1文档开发的热敏打印
MIT License
74 stars 120 forks source link

Cannot build - Inner class should be static #14

Closed abrarmusa closed 6 years ago

abrarmusa commented 6 years ago

Getting this error:

`node_modules/react-native-sunmi-inner-printer/android/src/main/java/com/sunmi/innerprinter/SunmiInnerPrinterModule.java:943: Error: This inner class should be static (com.sunmi.innerprinter.SunmiInnerPrinterModule.PrinterReceiver) [Instantiatable] public class PrinterReceiver extends BroadcastReceiver {



   Explanation for issues of type "Instantiatable":
   Activities, services, broadcast receivers etc. registered in the manifest
   file (or for custom views, in a layout file) must be "instantiatable" by
   the system, which means that the class must be public, it must have an
   empty public constructor, and if it's an inner class, it must be a static
   inner class.

/Users/abrarmusa/Desktop/projects/CashierLite/node_modules/react-native-sunmi-inner-printer/android/src/main/AndroidManifest.xml:2: Error: The <receiver> element must be a direct child of the <application> element [WrongManifestParent]
  <receiver android:name="com.sunmi.innerprinter.SunmiInnerPrinterModule.PrinterReceiver" android:enabled="true">`
januslo commented 6 years ago

plz see the fix.

abrarmusa commented 6 years ago

now getting this error

node_modules/react-native-sunmi-inner-printer/android/src/main/AndroidManifest.xml:2: Error: The element must be a direct child of the element [WrongManifestParent]

januslo commented 6 years ago

I can not see this error, would you plz try to figure out what is the issue?

发自我的 iPhone

在 2017年9月23日,下午12:17,Abrar Musa notifications@github.com 写道:

AndroidManifest.xml:2: Error: The element must be a direct child of the element [WrongManifestParent]

januslo commented 6 years ago

May be you can try to wrap the receiver tag to the application tag, that what I see could be the issue.

发自我的 iPhone

在 2017年9月23日,下午12:17,Abrar Musa notifications@github.com 写道:

now getting this error

node_modules/react-native-sunmi-inner-printer/android/src/main/AndroidManifest.xml:2: Error: The element must be a direct child of the element [WrongManifestParent] — You are receiving this because you commented. Reply to this email directly, view it on GitHub, or mute the thread.

januslo commented 6 years ago

@abrarmusa plz try the changes above. hmm, I cannot tested it cuz I cannot see your error on my build. So plz let me know whether it works.