Open Mobuis opened 5 years ago
This looks like an error coming from the actual streaming SDK itself, which is unfortunately deprecated now. I don't think there's really much I can do to fix this. Is it possible to use the debug version for release on Android?
It may also work if you use an older API version, although I'm not entirely sure.
Thanks for your quick response !
Is it possible to use the debug version for release on Android?
I really don't know..
It may also work if you use an older API version, although I'm not entirely sure.
Like how ?
You said you were using Android API 28. Try using an older version.
I've tested with Android API 26/27 right now, it's not working..
Then I'm honestly not sure. I'd try and see if you can force using the debug version of the android streaming SDK
Yeah, I don't know how to do force one package to use debug version haha I'll try to find it and keep an eye here if you have time to test also !
It seems "enableProguardInReleaseBuilds" (minifyEnabled = true) is crashing the app
From the app's gradle file or the react native module's gradle file?
On Thu, Sep 19, 2019, 2:40 PM Nolane notifications@github.com wrote:
It seems "enableProguardInReleaseBuilds" (minifyEnabled = true) is crashing the app
— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/lufinkey/react-native-spotify/issues/143?email_source=notifications&email_token=AB3VGUN5RKHXYVELLO54PXLQKPBRFA5CNFSM4IYMAYM2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD7EN5GI#issuecomment-533257881, or mute the thread https://github.com/notifications/unsubscribe-auth/AB3VGUMAHJDYB2CF6AZHKMDQKPBRFANCNFSM4IYMAYMQ .
From the app's gradle file ! I didn't try from the react native module, maybe it's a good idea
/**
* Run Proguard to shrink the Java bytecode in release builds.
*/
def enableProguardInReleaseBuilds = false
android {
buildTypes {
release {
lintOptions {
checkReleaseBuilds false
abortOnError false
}
minifyEnabled enableProguardInReleaseBuilds
shrinkResources enableProguardInReleaseBuilds
proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro"
signingConfig signingConfigs.release
}
}
}
It's not a bad things to disable minifyEnabled ? Android Console will warned me about that no?
Ok so, I've tried to update the "proguard-rules.pro" file like this (and it works!):
-keep class com.lufinkey.react.spotify.RNSpotifyPackage.** { *; }
-keep class com.lufinkey.react.spotify.** { *; }
-keep class com.spotify.sdk.android.authentication.RNSpotifyPackage.** { *; }
-keep class com.spotify.sdk.android.player.SpotifyPlayer.** { *; }
-keep class com.spotify.sdk.android.player.** { *; }
Would you be open to making a PR?
On Thu, Sep 19, 2019, 4:19 PM Nolane notifications@github.com wrote:
Ok so, I've tried to update the proguard rule like this (and it works!):
-keep class com.lufinkey.react.spotify.RNSpotifyPackage. { *; } -keep class com.lufinkey.react.spotify.* { ; } -keep class com.spotify.sdk.android.authentication.RNSpotifyPackage. { *; } -keep class com.spotify.sdk.android.player.SpotifyPlayer.* { ; } -keep class com.spotify.sdk.android.player.* { ; }
— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/lufinkey/react-native-spotify/issues/143?email_source=notifications&email_token=AB3VGUKQNBUTTH6ZZ7R3IVTQKPNEZA5CNFSM4IYMAYM2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD7EWSAQ#issuecomment-533293314, or mute the thread https://github.com/notifications/unsubscribe-auth/AB3VGUIRUCFOHMYOJ47UPYLQKPNEZANCNFSM4IYMAYMQ .
I don't know how to modify this rule on app's proguard-rules.pro (clearly I'm new on React Native development), maybe making a note/add troubleshooting in the readme is better ?
On real device with intern test on Android, App is crashing :
java.lang.RuntimeException:
at com.facebook.react.bridge.JavaMethodWrapper.invoke (JavaMethodWrapper.java:193)
at com.facebook.react.bridge.JavaModuleWrapper.invoke (JavaModuleWrapper.java:21)
at com.facebook.react.bridge.queue.NativeRunnable.run (NativeRunnable.java)
at android.os.Handler.handleCallback (Handler.java:873)
at android.os.Handler.dispatchMessage (Handler.java:99)
at com.facebook.react.bridge.queue.MessageQueueThreadHandler.dispatchMessage (MessageQueueThreadHandler.java)
at android.os.Looper.loop (Looper.java:201)
at com.facebook.react.bridge.queue.MessageQueueThreadImpl$4.run (MessageQueueThreadImpl.java:37)
at java.lang.Thread.run (Thread.java:764)
Caused by: java.lang.reflect.InvocationTargetException:
at java.lang.reflect.Method.invoke (Method.java)
at com.facebook.react.bridge.JavaMethodWrapper.invoke (JavaMethodWrapper.java:149)
at com.facebook.react.bridge.JavaModuleWrapper.invoke (JavaModuleWrapper.java:21)
at com.facebook.react.bridge.queue.NativeRunnable.run (NativeRunnable.java)
at android.os.Handler.handleCallback (Handler.java:873)
at android.os.Handler.dispatchMessage (Handler.java:99)
at com.facebook.react.bridge.queue.MessageQueueThreadHandler.dispatchMessage (MessageQueueThreadHandler.java)
at android.os.Looper.loop (Looper.java:201)
at com.facebook.react.bridge.queue.MessageQueueThreadImpl$4.run (MessageQueueThreadImpl.java:37)
at java.lang.Thread.run (Thread.java:764)
Caused by: java.lang.UnsatisfiedLinkError:
at java.lang.Runtime.loadLibrary0 (Runtime.java:1012)
at java.lang.System.loadLibrary (System.java:1669)
at com.spotify.sdk.android.player.SpotifyPlayer.nativeInit (SpotifyPlayer.java:2)
at com.spotify.sdk.android.player.SpotifyPlayer.<clinit> (SpotifyPlayer.java)
at com.spotify.sdk.android.player.SpotifyPlayer.access$000 (SpotifyPlayer.java)
at com.spotify.sdk.android.player.SpotifyPlayer$Builder.build (SpotifyPlayer.java:11)
at com.spotify.sdk.android.player.Spotify.getPlayer (Spotify.java:11)
at com.lufinkey.react.spotify.RNSpotifyModule.initializePlayerIfNeeded (RNSpotifyModule.java:94)
at com.lufinkey.react.spotify.RNSpotifyModule.loginWithSession (RNSpotifyModule.java:20)
at java.lang.reflect.Method.invoke (Method.java)
at com.facebook.react.bridge.JavaMethodWrapper.invoke (JavaMethodWrapper.java:149)
at com.facebook.react.bridge.JavaModuleWrapper.invoke (JavaModuleWrapper.java:21)
at com.facebook.react.bridge.queue.NativeRunnable.run (NativeRunnable.java)
at android.os.Handler.handleCallback (Handler.java:873)
at android.os.Handler.dispatchMessage (Handler.java:99)
at com.facebook.react.bridge.queue.MessageQueueThreadHandler.dispatchMessage (MessageQueueThreadHandler.java)
at android.os.Looper.loop (Looper.java:201)
at com.facebook.react.bridge.queue.MessageQueueThreadImpl$4.run (MessageQueueThreadImpl.java:37)
at java.lang.Thread.run (Thread.java:764)
Is this after you've disabled proguard completely?
Not completely, I just activate proguard and put the rules I wrote right upon
Hi,
I'm currently trying to build my project in Release mode on Android and it keep crashing when using Spotify.login() or Spotify.loginWithSession().
I'm building to a Google Pixel 3 with API 28. In debug mode (on iOS and Android) it works like a charm but in release (only for Android) it's not working.
The error :
React: 16.8.3 React Native: 0.59.9 RN Spotify SDK: 1.2.10 Android API: 28 (v9.0 Pie) Gradle: 5.4.1 Android Plugin Version: 3.4.0