Skip to content
This repository has been archived by the owner on Aug 21, 2020. It is now read-only.

错误: 程序包android.support.v4.content不存在 #368

Open
MelodyYM opened this issue May 22, 2020 · 4 comments
Open

错误: 程序包android.support.v4.content不存在 #368

MelodyYM opened this issue May 22, 2020 · 4 comments

Comments

@MelodyYM
Copy link

Version

Tell us which versions you are using ( you can see the versions in your package.json ):

react-native-audio :
react-native :
react :
using react-native-sound ? Yes/No

Expected behaviour :

What were you trying to do and what did you expect to happen ?

Actual behaviour

What happened when your issue occurred ? The more details you provide here the better the odds are that someone will help you resolve your issue

Steps to reproduce

Please provide us with some code that we can run to reproduce your error.

Link to a git repo that reproduces bug

If you put a GitHub repo that reproduces your issue then you significantly increase your chances of getting help !

@inkCrazy
Copy link

inkCrazy commented Jul 23, 2020

+1,
"react-native-audio": "^4.3.0",
"react": "16.11.0",
"react-native": "0.62.2",

/Users/inkcrazy/Documents/Daling062/node_modules/react-native-audio/android/src/main/java/com/rnim/rn/audio/AudioRecorderManager.java:30: 错误: 找不到符号
import android.support.v4.app.ActivityCompat;
                             ^
  符号:   类 ActivityCompat
  位置: 程序包 android.support.v4.app
/Users/inkcrazy/Documents/Daling062/node_modules/react-native-audio/android/src/main/java/com/rnim/rn/audio/AudioRecorderManager.java:31: 错误: 程序包android.support.v4.content不存在
import android.support.v4.content.ContextCompat;
                                 ^
/Users/inkcrazy/Documents/Daling062/node_modules/react-native-audio/android/src/main/java/com/rnim/rn/audio/AudioRecorderManager.java:105: 错误: 找不到符号
    int permissionCheck = ContextCompat.checkSelfPermission(getCurrentActivity(),
                          ^
  符号:   变量 ContextCompat
  位置: 类 AudioRecorderManager
3 个错误

@inkCrazy
Copy link

麻烦同步发布一下版本4.3.1到npm

@inkCrazy
Copy link

@inkCrazy
Copy link

作者GitHub更新4.3.1,虽然作者修改了gradle文件,但是AudioRecorderManager文件还是有问题,需要手动修改。
import android.support.v4.app.ActivityCompat;
import android.support.v4.content.ContextCompat;
手动修改一下:
import androidx.core.app.ActivityCompat;
import androidx.core.content.ContextCompat;

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

No branches or pull requests

2 participants