Comments (17)
希望更新一下这个
from aliyun-oss-react-native.
非常需要!
from aliyun-oss-react-native.
然后呢?没有然后了?
from aliyun-oss-react-native.
没下文了,怕是作者一直没有时间
from aliyun-oss-react-native.
?
from aliyun-oss-react-native.
RN 0.66.3版本Xcode build出很多错误。
from aliyun-oss-react-native.
如果是个人维护,时间有限,或许可以考虑募捐资助作者进行module维护和更新。
from aliyun-oss-react-native.
https://github.com/hufans/react-native-alioss
可以关注下这个库,支持ts
from aliyun-oss-react-native.
alantoa
, 有使用经验可以分享吗?react-native-alioss
size小很多。我的使用环境是RN 0.66, both android/ios。主要是上传图像到OSS。Many thanks.
from aliyun-oss-react-native.
@emclab 简单测试了一下,两个库 Api 都是一样的,这里有问题的,react-native-alioss
也会又问题,但是react-native-alioss
sdk 会新一点,然后增加了 ts 的类型,作者也在维护。
然后说一下这个库是在 aliyun
组织下的,阿里云咱们用都也是付费服务,相应的阿里云也应该提供维护,但是这个库已经三年多不维护了,我提的 PR 也无人问津,九成是弃坑了,建议换掉吧,react-native-alioss
后面遇到问题的话我也会提PR。
from aliyun-oss-react-native.
alantoa
, 谢谢input。会考虑测试一下。我现在碰到一个棘手的问题,就是在安卓手机上传图像到OSS会出找不到文件的错误。但在安卓emulator上却没有同样的问题。不知道这个问题是否跟OSS模块有关系。
from aliyun-oss-react-native.
alantoa
, 但是react-native-alioss sdk 会新一点
, 你是指·react-native-alioss call 的OSS sdk 比这个模块call的版本更新?如果sdk更新,是不是模块会运行得更好?
from aliyun-oss-react-native.
这个是oss库,不会出现文件找不到的情况,你排除下是否是因为读写权限的问题或者是图片选择器的问题
from aliyun-oss-react-native.
问题确实很奇怪。已经试了另外一个popular的image picker,错误是一样的,这样基本可以排除image picker。我也怀疑是权限问题。在Android Manifest目前已经给了5个权限:
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW"/>
<uses-permission android:name="android.permission.CAMERA" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
不知道还缺什么权限。会需要给OSS模块单独授权吗?
from aliyun-oss-react-native.
alantoa
, 问题应该是android10用的是scoped storage,每个应用存储在自己的子目录下。而Android9以前,应用是共享一个存储子目录。本OSS库不知道scoped storage,而是仍然用共享存储,因此在Android10上出错。以下是关于EXTERNAL_STORAGE的文章
if (android.os.Build.VERSION.SDK_INT < 29) {
// ==> /storage/emulated/0 (Emulator)
File dir = Environment.getExternalStorageDirectory();
} else if (android.os.Build.VERSION.SDK_INT >= 29) {
// ==> /storage/emulated/0/Android/data/org.o7planning.externalstoragedemo/files
File dir = this.getExternalFilesDir(null);
}
本库对全部Android版本都仅仅使用了Environment.getExternalStorageDirectory();
。这也就是为何在错误信息中显示的是共享路径(Android9以前)的原因。本库的AliOssUploadManager.java
和FileUtils.java
需要update。或许还有其他的也需要update。
from aliyun-oss-react-native.
the following code change in FileUtils.java works in Android 10 emulator:
import android.os.Build;
public static String getFilePathFromURI(Context context, Uri contentUri) {
//copy file and send new file path
String fileName = getFileName(contentUri);
if (!TextUtils.isEmpty(fileName)) {
File copyFile;
if (Build.VERSION.SDK_INT >= 29) {
// ==> /storage/emulated/0/Android/data/org.o7planning.externalstoragedemo/files
copyFile = new File( context.getExternalFilesDir(null).getAbsolutePath() + File.separator + fileName);
} else {
copyFile = new File( Environment.getExternalStorageDirectory().getAbsolutePath() + File.separator + fileName);
}
FileUtils.copy(context, contentUri, copyFile);
return copyFile.getAbsolutePath();
}
return null;
}
from aliyun-oss-react-native.
the following code change in FileUtils.java works in Android 10 emulator:
import android.os.Build; public static String getFilePathFromURI(Context context, Uri contentUri) { //copy file and send new file path String fileName = getFileName(contentUri); if (!TextUtils.isEmpty(fileName)) { File copyFile; if (Build.VERSION.SDK_INT >= 29) { // ==> /storage/emulated/0/Android/data/org.o7planning.externalstoragedemo/files copyFile = new File( context.getExternalFilesDir(null).getAbsolutePath() + File.separator + fileName); } else { copyFile = new File( Environment.getExternalStorageDirectory().getAbsolutePath() + File.separator + fileName); } FileUtils.copy(context, contentUri, copyFile); return copyFile.getAbsolutePath(); } return null; }
@emclab 什么时候发包更新呢?
from aliyun-oss-react-native.
Related Issues (20)
- 请问还会更新吗? HOT 3
- 在pod install的时候 Installing AliyunOSSiOS 一直卡在这边 HOT 2
- com.aliyun.oss.clientError Code=6 HOT 1
- AliyunOSS.asyncDownload 下载文件问题
- android studio下,加载aliyun-oss-react-native包报错
- 请问下这个问题如何解决?Unable to resolve host "xxx.aliyuncs.com": No address associated with hostname
- 调用initWithSecurityToken会卡住js线程吗?
- 安装OSS模块后app launch compile错误 HOT 6
- asyncUpload method can't find the file path HOT 3
- android Q没有适配,上传图片路径会出错 HOT 1
- Attempt to invoke virtual method 'void com.reactlibrary.AliyunUploadManager.asyncUpload(com.facebook.react.bridge.ReactContext, java.lang.String, java.lang.String, java.lang.String, com.facebook.react.bridge.ReadableMap, com.facebook.react.bridge.Promise)' on a null object reference HOT 2
- 模块3年没有更新,已经abandoned? HOT 1
- AliyunUploadManager.java uses unchecked or unsafe operations.
- 上传图像在Android emulator运行通畅但在安桌手机上stuck HOT 1
- 请为 Expo 创建一个 Config Plugin
- yarn ios 报错 HOT 5
- 这个项目还在维护嘛?还能使用嘛? HOT 1
- Could not GET 'https://oss.sonatype.org/content/repositories/snapshots/com/aliyun/dpa/oss-android-sdk/2.3.0-SNAPSHOT/maven-metadata.xml'. Received status code 502 from server: Bad Gateway HOT 2
- 在Android10以上,上传文件失败,原因已找到,请修复
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from aliyun-oss-react-native.