Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cannot read property 'IsAndroid' of undefined #567

Closed
xiaobei56 opened this issue Apr 26, 2019 · 2 comments
Closed

cannot read property 'IsAndroid' of undefined #567

xiaobei56 opened this issue Apr 26, 2019 · 2 comments

Comments

@xiaobei56
Copy link

+-- core-js@3.0.1
+-- npm@6.9.0
+-- react@16.8.3
+-- react-devtools@3.6.1
+-- react-native@0.59.5
`-- react-native-cli@2.0.1

000

i real did react-native link react-native-sound,.
but it still happen to this erro.
how shold i do. help me ,thanks.

@xiaobei56
Copy link
Author

xiaobei56 commented Apr 26, 2019

I had solve the problem by:
add code at MainApplication:
@OverRide
public void onCreate() {
super.onCreate();
reactInstanceManager = ReactInstanceManager.builder()
…………
.addPackage(new RNSoundPackage());
.build();
}

@james2doyle
Copy link

I had to manually add the package in protected List<ReactPackage> getPackages() { ... }

diff --git a/android/app/src/main/java/com/myapp/MainApplication.java b/android/app/src/main/java/com/myapp/MainApplication.java
index 8b3c131..d1d31d4 100644
--- a/android/app/src/main/java/com/myapp/MainApplication.java
+++ b/android/app/src/main/java/com/myapp/MainApplication.java
@@ -19,6 +19,7 @@ import com.facebook.react.ReactNativeHost;
 import com.facebook.react.ReactPackage;
 import com.facebook.react.shell.MainReactPackage;
 import com.facebook.soloader.SoLoader;
+import com.zmxv.RNSound.RNSoundPackage;
 
 import java.util.Arrays;
 import java.util.List;
@@ -46,6 +47,7 @@ public class MainApplication extends Application implements ReactApplication {
             new ReactVideoPackage(),
             new VectorIconsPackage(),
             new RCTPdfView(),
+            new RNSoundPackage(),
             new RNGestureHandlerPackage()
       );
     }

fullStackOasis pushed a commit to fullStackOasis/react-native-audio-player-demo that referenced this issue Mar 20, 2020
com.zmxv.RNSound.RNSoundPackage needs to be manually added to package list.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants