aliyun / aliyun-oss-react-native

MIT License
148 stars 99 forks source link

安装OSS模块后app launch compile错误 #82

Open emclab opened 4 years ago

emclab commented 4 years ago

系统是RN 0.62.2, NodeJS12.18, Win10,在yarn add aliyun-oss-react-native后,app launch就开始出现错误。

Configure project :aliyun-oss-react-native WARNING: Configuration 'compile' is obsolete and has been replaced with 'implementation' and 'api'. It will be removed soon. For more information see: http://d.android.com/r/tools/update-dependency-configurations.html WARNING: The specified Android SDK Build Tools version (27.0.3) is ignored, as it is below the minimum supported version (28.0.3) for Android Gradle Plugin 3.5.2. Android SDK Build Tools 28.0.3 will be used. //《《《====app 用的是 29.0.3 To suppress this warning, remove "buildToolsVersion '27.0.3'" from your build.gradle file, as each version of the Android Gradle Plugin now has a default version of the build tools.

Task :app:processDebugManifest FAILED

See http://g.co/androidstudio/manifest-merger for more information about the manifest merger.

Deprecated Gradle features were used in this build, making it incompatible with Gradle 7.0. Use '--warning-mode all' to show the individual deprecation warnings. See https://docs.gradle.org/6.0.1/userguide/command_line_interface.html#sec:command_line_warnings 119 actionable tasks: 2 executed, 117 up-to-date C:\D\code\js\xyz_app\android\app\src\debug\AndroidManifest.xml:7:5-153 Error: tools:replace specified at line:7 for attribute android:allowBackup, but no new value specified //《《《《===根据提示修改。不好用 C:\D\code\js\xyz_app\android\app\src\debug\AndroidManifest.xml Error: Validation failed, exiting

FAILURE: Build failed with an exception.

BUILD FAILED in 19s

error Failed to install the app. Make sure you have the Android development environment set up: https://reactnative.dev/docs/environment-setup. Run CLI with --verbose flag for more details. Error: Command failed: gradlew.bat app:installDebug -PreactNativeDevServerPort=8081 C:\D\code\js\xyz_app\android\app\src\debug\AndroidManifest.xml:7:5-153 Error: tools:replace specified at line:7 for attribute android:allowBackup, but no new value specified C:\D\code\js\xyz_app\android\app\src\debug\AndroidManifest.xml Error: Validation failed, exiting

FAILURE: Build failed with an exception.

BUILD FAILED in 19s

at makeError (C:\d\code\js\xyz_app\node_modules\execa\index.js:174:9)
at C:\d\code\js\xyz_app\node_modules\execa\index.js:278:16
at processTicksAndRejections (internal/process/task_queues.js:97:5)
at async runOnAllDevices (C:\d\code\js\xyz_app\node_modules\@react-native-community\cli-platform-android\build\commands\runAndroid\runOnAllDevices.js:94:5)
at async Command.handleAction (C:\d\code\js\xyz_app\node_modules\@react-native-community\cli\build\index.js:186:9)

PS C:\d\code\js\xyz_app>

请问有什么方法可以fix问题。谢谢!

emclab commented 4 years ago

·Leo2018WU, 能否用REST API 在RN app里用HTTP/HTTPS client上传文件?这样就可以不用aliyun-oss-react-native模块。OSS支持RESTful,理论上应该是可以的。这个模块已经两年没有更新。感觉是弃用了。里面用的ali-oss的版本是4.0,目前最新版是6.9. 差两代。

emclab commented 4 years ago

https://help.aliyun.com/document_detail/31925.html?spm=a2c4g.11186623.2.12.577f58aboqgIXE

Here is an API example I found and it can run in browser. Please share any findings.

Leo2018Wu commented 4 years ago

Please share any findings.

你上面说的应该是可以的,我这边有进展会分享的。

Leo2018Wu commented 4 years ago

·Leo2018WU, 能否用REST API 在RN app里用HTTP/HTTPS client上传文件?这样就可以不用aliyun-oss-react-native模块。OSS支持RESTful,理论上应该是可以的。这个模块已经两年没有更新。感觉是弃用了。里面用的ali-oss的版本是4.0,目前最新版是6.9. 差两代。

编译报错的话建议重新init一个项目,然后试试报不报错,我试过新项目是不会报错的。之后再按照阿里云官方文档流程走看会遇到啥问题。

emclab commented 4 years ago

Leo2018Wu, 试得有进展吗?我新init了一个项目,然后把老code copy过来。刚试装,仅仅import. 又出compoile错误。这个module太老朽,不堪大用。

我正在转用Azure. setting up Azure在中国国内的账户。Azure的技术支持似乎很有诚意也很responsive。另外一个是亚马逊中国。但Azure中国比亚马逊强。

Leo2018Wu commented 4 years ago

Leo2018Wu, 试得有进展吗?我新init了一个项目,然后把老code copy过来。刚试装,仅仅import. 又出compoile错误。这个module太老朽,不堪大用。

我正在转用Azure. setting up Azure在中国国内的账户。Azure的技术支持似乎很有诚意也很responsive。另外一个是亚马逊中国。但Azure中国比亚马逊好用。 我这边已经弄好了,给一下你邮箱我发你我那个文档然后你对着我文档做应该没问题