[Android] crashes on api level 22
AhmadMHawwash opened this issue · comments
issue:
- android 5 and 5.1 crash on first open the app
error log:
E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.perfectfit.qurankareem, PID: 4021
java.lang.SecurityException: Neither user 10054 nor current process has android.permission.READ_PHONE_STATE.
at android.os.Parcel.readException(Parcel.java:1546)
at android.os.Parcel.readException(Parcel.java:1499)
at com.android.internal.telephony.ITelephonyRegistry$Stub$Proxy.listenForSubscriber(ITelephonyRegistry.java:544)
at android.telephony.TelephonyManager.listen(TelephonyManager.java:2413)
at com.audioStreaming.Signal.setData(Signal.java:92)
at com.audioStreaming.ReactNativeAudioStreamingModule.onServiceConnected(ReactNativeAudioStreamingModule.java:79)
at android.app.LoadedApk$ServiceDispatcher.doConnected(LoadedApk.java:1208)
at android.app.LoadedApk$ServiceDispatcher$RunConnection.run(LoadedApk.java:1225)
at android.os.Handler.handleCallback(Handler.java:739)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:135)
at android.app.ActivityThread.main(ActivityThread.java:5254)
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:372)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:903)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:698)
project dependencies:
- react-native: 0.57.8
- react-native-audio-stream: ^2.6.1
android dependecies:
- classpath 'com.android.tools.build:gradle:3.3.2'
some android project settings:
- buildToolsVersion = "27.0.3"
- minSdkVersion = 16
- compileSdkVersion = 27
- targetSdkVersion = 26
- supportLibVersion = "27.1.1"
any ideas?
add this to your AndroidManifest.xml
<uses-permission tools:node="remove" android:name="android.permission.READ_PHONE_STATE" />