{"action":"created","issue":{"url":"https://api.github.com/repos/tlenclos/react-native-audio-streaming/issues/53","repository_url":"https://api.github.com/repos/tlenclos/react-native-audio-streaming","labels_url":"https://api.github.com/repos/tlenclos/react-native-audio-streaming/issues/53/labels{/name}","comments_url":"https://api.github.com/repos/tlenclos/react-native-audio-streaming/issues/53/comments","events_url":"https://api.github.com/repos/tlenclos/react-native-audio-streaming/issues/53/events","html_url":"https://github.com/tlenclos/react-native-audio-streaming/issues/53","id":195386142,"number":53,"title":"android - Attempt to invoke virtual method 'java.lang.Class java.lang.Object.getClass()' on a null object reference","user":{"login":"arshavinho","id":1016441,"avatar_url":"https://avatars.githubusercontent.com/u/1016441?v=3","gravatar_id":"","url":"https://api.github.com/users/arshavinho","html_url":"https://github.com/arshavinho","followers_url":"https://api.github.com/users/arshavinho/followers","following_url":"https://api.github.com/users/arshavinho/following{/other_user}","gists_url":"https://api.github.com/users/arshavinho/gists{/gist_id}","starred_url":"https://api.github.com/users/arshavinho/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/arshavinho/subscriptions","organizations_url":"https://api.github.com/users/arshavinho/orgs","repos_url":"https://api.github.com/users/arshavinho/repos","events_url":"https://api.github.com/users/arshavinho/events{/privacy}","received_events_url":"https://api.github.com/users/arshavinho/received_events","type":"User","site_admin":false},"labels":[{"id":411988552,"url":"https://api.github.com/repos/tlenclos/react-native-audio-streaming/labels/bug","name":"bug","color":"ee0701","default":true}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":8,"created_at":"2016-12-13T22:23:32Z","updated_at":"2016-12-19T00:44:32Z","closed_at":null,"body":"Hello guys,\r\n\r\ni'm trying to build an app i made on iOS to Android, and i have this error at startup:\r\n\r\n```\r\n12-13 17:18:36.483  5384  5384 E AndroidRuntime: java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.Class java.lang.Object.getClass()' on a null object reference\r\n12-13 17:18:36.483  5384  5384 E AndroidRuntime: \tat com.audioStreaming.ReactNativeAudioStreamingModule.getClassActivity(ReactNativeAudioStreamingModule.java:43)\r\n12-13 17:18:36.483  5384  5384 E AndroidRuntime: \tat com.audioStreaming.Signal.setData(Signal.java:66)\r\n12-13 17:18:36.483  5384  5384 E AndroidRuntime: \tat com.audioStreaming.ReactNativeAudioStreamingModule.onServiceConnected(ReactNativeAudioStreamingModule.java:78)\r\n12-13 17:18:36.483  5384  5384 E AndroidRuntime: \tat android.app.LoadedApk$ServiceDispatcher.doConnected(LoadedApk.java:1223)\r\n12-13 17:18:36.483  5384  5384 E AndroidRuntime: \tat android.app.LoadedApk$ServiceDispatcher$RunConnection.run(LoadedApk.java:1240)\r\n12-13 17:18:36.483  5384  5384 E AndroidRuntime: \tat android.os.Handler.handleCallback(Handler.java:739)\r\n12-13 17:18:36.483  5384  5384 E AndroidRuntime: \tat android.os.Handler.dispatchMessage(Handler.java:95)\r\n12-13 17:18:36.483  5384  5384 E AndroidRuntime: \tat android.os.Looper.loop(Looper.java:148)\r\n12-13 17:18:36.483  5384  5384 E AndroidRuntime: \tat android.app.ActivityThread.main(ActivityThread.java:5417)\r\n12-13 17:18:36.483  5384  5384 E AndroidRuntime: \tat java.lang.reflect.Method.invoke(Native Method)\r\n12-13 17:18:36.483  5384  5384 E AndroidRuntime: \tat com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)\r\n12-13 17:18:36.483  5384  5384 E AndroidRuntime: \tat com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)\r\n12-13 17:18:36.484   816  2166 W ActivityManager:   Force finishing activity com.app/.MainActivity\r\n```\r\n\r\nDo you have any idea?\r\nThanks!\r\n\r\n\"react-native-audio-streaming\": \"^2.2.0\",\r\n\"react-native\": \"0.35.0\",\r\n\"react\": \"15.3.2\"\r\n\r\nMy MainApplication.java:\r\n\r\n```\r\npackage com.app;\r\n\r\nimport android.app.Application;\r\nimport android.support.annotation.NonNull;\r\nimport android.util.Log;\r\n\r\nimport com.facebook.react.ReactApplication;\r\nimport com.reactnativenavigation.NavigationApplication;\r\nimport com.wog.videoplayer.VideoPlayerPackage;\r\nimport com.cmcewen.blurview.BlurViewPackage;\r\nimport com.audioStreaming.ReactNativeAudioStreamingPackage;\r\nimport com.rnim.rn.audio.ReactNativeAudioPackage;\r\nimport com.brentvatne.react.ReactVideoPackage;\r\nimport fr.bamlab.rnimageresizer.ImageResizerPackage;\r\nimport com.reactnative.ivpusic.imagepicker.PickerPackage;\r\nimport com.microsoft.codepush.react.CodePush;\r\nimport com.geektime.reactnativeonesignal.ReactNativeOneSignalPackage;\r\nimport com.imagepicker.ImagePickerPackage;\r\nimport com.RNFetchBlob.RNFetchBlobPackage;\r\nimport com.oblador.vectoricons.VectorIconsPackage;\r\nimport com.facebook.react.ReactInstanceManager;\r\nimport com.facebook.react.ReactNativeHost;\r\nimport com.facebook.react.ReactPackage;\r\n\r\nimport java.util.Arrays;\r\nimport java.util.List;\r\n\r\npublic class MainApplication extends NavigationApplication {\r\n\r\n  @Override\r\n  public boolean isDebug() {\r\n      return BuildConfig.DEBUG;\r\n  }\r\n\r\n  @NonNull\r\n  @Override\r\n  public List<ReactPackage> createAdditionalReactPackages() {\r\n      return Arrays.<ReactPackage>asList(\r\n          new VideoPlayerPackage(),\r\n          new BlurViewPackage(),\r\n          new ReactNativeAudioStreamingPackage(),\r\n          new ReactNativeAudioPackage(),\r\n          new ReactVideoPackage(),\r\n          new ImageResizerPackage(),\r\n          new PickerPackage(),\r\n          new CodePush(null, getApplicationContext(), BuildConfig.DEBUG),\r\n          new ReactNativeOneSignalPackage(),\r\n          new ImagePickerPackage(),\r\n          new RNFetchBlobPackage(),\r\n          new VectorIconsPackage()\r\n      );\r\n  }\r\n}\r\n```"},"comment":{"url":"https://api.github.com/repos/tlenclos/react-native-audio-streaming/issues/comments/267859653","html_url":"https://github.com/tlenclos/react-native-audio-streaming/issues/53#issuecomment-267859653","issue_url":"https://api.github.com/repos/tlenclos/react-native-audio-streaming/issues/53","id":267859653,"user":{"login":"arshavinho","id":1016441,"avatar_url":"https://avatars.githubusercontent.com/u/1016441?v=3","gravatar_id":"","url":"https://api.github.com/users/arshavinho","html_url":"https://github.com/arshavinho","followers_url":"https://api.github.com/users/arshavinho/followers","following_url":"https://api.github.com/users/arshavinho/following{/other_user}","gists_url":"https://api.github.com/users/arshavinho/gists{/gist_id}","starred_url":"https://api.github.com/users/arshavinho/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/arshavinho/subscriptions","organizations_url":"https://api.github.com/users/arshavinho/orgs","repos_url":"https://api.github.com/users/arshavinho/repos","events_url":"https://api.github.com/users/arshavinho/events{/privacy}","received_events_url":"https://api.github.com/users/arshavinho/received_events","type":"User","site_admin":false},"created_at":"2016-12-19T00:44:32Z","updated_at":"2016-12-19T00:44:32Z","body":"@Arkanine i already have new ReactNativeAudioStreamingPackage(); in my MainApplication.java\r\n@tlenclos thanks for your time, when i open my project in Android Studio i have this:\r\n![screen shot 2016-12-19 at 01 35 13](https://cloud.githubusercontent.com/assets/1016441/21298122/70817194-c58c-11e6-8854-a04b064ed688.png)\r\n\r\nand in ReactNativeAudioStreamingModule.java:\r\n![screen shot 2016-12-19 at 01 41 24](https://cloud.githubusercontent.com/assets/1016441/21298131/8c3014ae-c58c-11e6-94e2-270c23ab7a66.png)\r\n\r\nMaybe it's related to react-native-navigation ? For android we need to change or MainApplication.java and MainActivity:\r\n\r\nhttps://github.com/wix/react-native-navigation/wiki/Installation---Android"}}
{"actor":{"display_login":"arshavinho"}}