Today I was adding In-App purchase support to my Android game using the Prime31 IAP Combo package. The game would crash on my device whenever I called IAP.init(...). Here's how I fixed it...
- I opened a DOS prompt and typed this in: adb.exe logcat > output.txt
- I ran the app and watched it crash.
- I clicked on the DOS prompt and pressed Ctrl-C to stop the logging. Then I opened output.txt.
- I discovered a fatal error near the end of the log; and determined it was caused by the the app lacking the ACCESS_NETWORK_STATE permission.
- From the Unity project navigation frame, I browsed into Plugins\Android\IAB_lib, opened AndroidManifest.xml and added this line:
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
After that everything worked fine.