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

On Creation of apk #138

Open
ehmadjawad opened this issue Feb 7, 2022 · 5 comments
Open

On Creation of apk #138

ehmadjawad opened this issue Feb 7, 2022 · 5 comments

Comments

@ehmadjawad
Copy link

I am have an issue after building the apk .
On development mode the this package works fine but when i create apk build the soundplayer does not works.

@Vente16
Copy link

Vente16 commented Apr 11, 2022

I have the same issue, any fix?

@pavanmasterji
Copy link

I have the same issue any idea what is the fix @Vente16 @ehmadjawad @jonasb @assertchris @victor36max

@assertchris
Copy link
Contributor

Please link to a repo that reproduces the problem (in the least amount of code possible) or provide version numbers so someone else can create this reproduction. I'm not sure ow any of you expect this to be fixed without providing any of the info required to reproduce this problem.

@david-allison
Copy link

david-allison commented Jun 13, 2022

I get a hang, then a crash only after gradlew assembleRelease.

My use case is calling SoundPlayer.playUrl on an mp3 using a http url pointing to an IP.

Reproduction:

"react-native-sound-player": "^0.12.1"

        SoundPlayer.playUrl(`http://download.samplelib.com/mp3/sample-3s.mp3`) 

Cause of crash: MediaPlayer.create() may return null

Stack trace/additional info
    java.lang.NullPointerException: Attempt to invoke virtual method 'void android.media.MediaPlayer.setOnCompletionListener(android.media.MediaPlayer$OnCompletionListener)' on a null object reference
        at com.johnsonsu.rnsoundplayer.RNSoundPlayerModule.prepareUrl(RNSoundPlayerModule.java:210)
        at com.johnsonsu.rnsoundplayer.RNSoundPlayerModule.playUrl(RNSoundPlayerModule.java:80)
        at java.lang.reflect.Method.invoke(Native Method)
        at com.facebook.react.bridge.JavaMethodWrapper.invoke(JavaMethodWrapper.java:372)
        at com.facebook.react.bridge.JavaModuleWrapper.invoke(JavaModuleWrapper.java:188)
        at com.facebook.react.bridge.queue.NativeRunnable.run(Native Method)
        at android.os.Handler.handleCallback(Handler.java:938)
        at android.os.Handler.dispatchMessage(Handler.java:99)
        at com.facebook.react.bridge.queue.MessageQueueThreadHandler.dispatchMessage(MessageQueueThreadHandler.java:27)
        at android.os.Looper.loop(Looper.java:223)
        at com.facebook.react.bridge.queue.MessageQueueThreadImpl$4.run(MessageQueueThreadImpl.java:228)
        at java.lang.Thread.run(Thread.java:923)

Fixing the crash likely won't resolve the underlying issue of why .create() returns null

Android 11, Google Pixel 3a

I have tried

  • android:usesCleartextTraffic="true"
  • <network-security-config>
  • An <intent-filter> to the IP

@matsuda-argano
Copy link

Add this one to proguard-rules/pro and it should work.

-keep class **.R$* {
    public static final int raw.*;
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants