wonday / react-native-aliyun-push

A react native wrapper for aliyun push SDK
MIT License
218 stars 64 forks source link

not work android(Task :app:processDebugManifest FAILED) #143

Open chenweigh opened 4 years ago

chenweigh commented 4 years ago

Environment

"react": "16.11.0",
"react-native": "0.62.2",
"react-native-aliyun-push": "^1.0.22",

Action

The problem as follow, I need help.

Log

yarn run v1.21.1
$ react-native run-android
info Running jetifier to migrate libraries to AndroidX. You can disable it using "--no-jetifier" flag.
Jetifier found 1283 file(s) to forward-jetify. Using 4 workers...
info JS server already running.
info Installing the app...

> Configure project :
Repository https://jcenter.bintray.com/ replaced by https://maven.aliyun.com/repository/jcenter.
Repository https://jcenter.bintray.com/ replaced by https://maven.aliyun.com/repository/jcenter.
Repository https://jcenter.bintray.com/ replaced by https://maven.aliyun.com/repository/jcenter.
Repository https://jcenter.bintray.com/ replaced by https://maven.aliyun.com/repository/jcenter.
Repository https://jcenter.bintray.com/ replaced by https://maven.aliyun.com/repository/jcenter.
Repository https://jcenter.bintray.com/ replaced by https://maven.aliyun.com/repository/jcenter.
Repository https://jcenter.bintray.com/ replaced by https://maven.aliyun.com/repository/jcenter.
Repository https://jcenter.bintray.com/ replaced by https://maven.aliyun.com/repository/jcenter.
Repository https://jcenter.bintray.com/ replaced by https://maven.aliyun.com/repository/jcenter.
Repository https://jcenter.bintray.com/ replaced by https://maven.aliyun.com/repository/jcenter.
Repository https://jcenter.bintray.com/ replaced by https://maven.aliyun.com/repository/jcenter.
Repository https://jcenter.bintray.com/ replaced by https://maven.aliyun.com/repository/jcenter.
Repository https://jcenter.bintray.com/ replaced by https://maven.aliyun.com/repository/jcenter.
Repository https://jcenter.bintray.com/ replaced by https://maven.aliyun.com/repository/jcenter.
Repository https://jcenter.bintray.com/ replaced by https://maven.aliyun.com/repository/jcenter.
Repository https://jcenter.bintray.com/ replaced by https://maven.aliyun.com/repository/jcenter.
Repository https://jcenter.bintray.com/ replaced by https://maven.aliyun.com/repository/jcenter.
Repository https://jcenter.bintray.com/ replaced by https://maven.aliyun.com/repository/jcenter.
Repository https://jcenter.bintray.com/ replaced by https://maven.aliyun.com/repository/jcenter.
Repository https://jcenter.bintray.com/ replaced by https://maven.aliyun.com/repository/jcenter.

> Configure project :react-native-aliyun-push
Repository https://jcenter.bintray.com/ replaced by https://maven.aliyun.com/repository/jcenter.

> Configure project :react-native-community_async-storage
Repository https://jcenter.bintray.com/ replaced by https://maven.aliyun.com/repository/jcenter.

> Configure project :react-native-community_clipboard
Repository https://jcenter.bintray.com/ replaced by https://maven.aliyun.com/repository/jcenter.

> Configure project :react-native-community_masked-view
Repository https://jcenter.bintray.com/ replaced by https://maven.aliyun.com/repository/jcenter.

> Configure project :react-native-image-picker
Repository https://jcenter.bintray.com/ replaced by https://maven.aliyun.com/repository/jcenter.

> Configure project :react-native-pdf
Repository https://jcenter.bintray.com/ replaced by https://maven.aliyun.com/repository/jcenter.

> Configure project :react-native-reanimated
Repository https://jcenter.bintray.com/ replaced by https://maven.aliyun.com/repository/jcenter.

> Configure project :react-native-safe-area-context
Repository https://jcenter.bintray.com/ replaced by https://maven.aliyun.com/repository/jcenter.

> Configure project :react-native-screens
Repository https://jcenter.bintray.com/ replaced by https://maven.aliyun.com/repository/jcenter.

> Configure project :react-native-svg
Repository https://jcenter.bintray.com/ replaced by https://maven.aliyun.com/repository/jcenter.

> Configure project :react-native-view-shot
Repository https://jcenter.bintray.com/ replaced by https://maven.aliyun.com/repository/jcenter.

> Configure project :react-native-webview
Repository https://jcenter.bintray.com/ replaced by https://maven.aliyun.com/repository/jcenter.

> Configure project :react-native-wechat
Repository https://jcenter.bintray.com/ replaced by https://maven.aliyun.com/repository/jcenter.

> Configure project :rn-fetch-blob
Repository https://jcenter.bintray.com/ replaced by https://maven.aliyun.com/repository/jcenter.
WARNING: The specified Android SDK Build Tools version (28.0.3) is ignored, as it is below the minimum supported version (29.0.2) for Android Gradle Plugin 4.0.0.
Android SDK Build Tools 29.0.2 will be used.
To suppress this warning, remove "buildToolsVersion '28.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
[com.aliyun.ams:alicloud-android-third-push:3.1.0] /Users/chen/.gradle/caches/transforms-2/files-2.1/0cdfef5e32191d9dc21b8432b786dbc2/jetified-alicloud-android-third-push-3.1.0/AndroidManifest.xml:25:5-79 Warning:
        Element uses-permission#android.permission.ACCESS_NETWORK_STATE at [com.aliyun.ams:alicloud-android-third-push:3.1.0] AndroidManifest.xml:25:5-79 duplicated with element declared at [com.aliyun.ams:alicloud-android-third-push:3.1.0] AndroidManifest.xml:11:5-79
[com.aliyun.ams:alicloud-android-third-push:3.1.0] /Users/chen/.gradle/caches/transforms-2/files-2.1/0cdfef5e32191d9dc21b8432b786dbc2/jetified-alicloud-android-third-push-3.1.0/AndroidManifest.xml:26:5-67 Warning:
        Element uses-permission#android.permission.INTERNET at [com.aliyun.ams:alicloud-android-third-push:3.1.0] AndroidManifest.xml:26:5-67 duplicated with element declared at [com.aliyun.ams:alicloud-android-third-push:3.1.0] AndroidManifest.xml:12:5-67
[com.aliyun.ams:alicloud-android-third-push:3.1.0] /Users/chen/.gradle/caches/transforms-2/files-2.1/0cdfef5e32191d9dc21b8432b786dbc2/jetified-alicloud-android-third-push-3.1.0/AndroidManifest.xml:27:5-82 Warning:
        Element uses-permission#com.google.android.c2dm.permission.RECEIVE at [com.aliyun.ams:alicloud-android-third-push:3.1.0] AndroidManifest.xml:27:5-82 duplicated with element declared at [com.aliyun.ams:alicloud-android-third-push:3.1.0] AndroidManifest.xml:14:5-82

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.1.1/userguide/command_line_interface.html#sec:command_line_warnings
80 actionable tasks: 2 executed, 78 up-to-date
/Users/chen/ReactNative/CxyParent1/android/app/src/debug/AndroidManifest.xml:13:7-34 Error:
    Attribute application@allowBackup value=(false) from AndroidManifest.xml:13:7-34
    is also present at [com.aliyun.ams:alicloud-android-third-push:3.1.0] AndroidManifest.xml:45:9-35 value=(true).
    Suggestion: add 'tools:replace="android:allowBackup"' to <application> element at AndroidManifest.xml:7:5-117 to override.

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:processDebugManifest'.
> Manifest merger failed with multiple errors, see logs

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org

BUILD FAILED in 9s

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 app:installDebug -PreactNativeDevServerPort=8081
/Users/chen/ReactNative/CxyParent1/android/app/src/debug/AndroidManifest.xml:13:7-34 Error:
    Attribute application@allowBackup value=(false) from AndroidManifest.xml:13:7-34
    is also present at [com.aliyun.ams:alicloud-android-third-push:3.1.0] AndroidManifest.xml:45:9-35 value=(true).
    Suggestion: add 'tools:replace="android:allowBackup"' to <application> element at AndroidManifest.xml:7:5-117 to override.

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:processDebugManifest'.
> Manifest merger failed with multiple errors, see logs

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org

BUILD FAILED in 9s

    at makeError (/Users/chen/ReactNative/CxyParent1/node_modules/execa/index.js:174:9)
    at /Users/chen/ReactNative/CxyParent1/node_modules/execa/index.js:278:16
    at processTicksAndRejections (internal/process/task_queues.js:97:5)
    at async runOnAllDevices (/Users/chen/ReactNative/CxyParent1/node_modules/@react-native-community/cli-platform-android/build/commands/runAndroid/runOnAllDevices.js:94:5)
    at async Command.handleAction (/Users/chen/ReactNative/CxyParent1/node_modules/@react-native-community/cli/build/index.js:186:9)
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
chenweigh commented 4 years ago

I have solved it. only update AndroidManifest.xml

canyuegongzi commented 3 years ago

I have solved it. only update AndroidManifest.xml

  • manifest config
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
  xmlns:tools="http://schemas.android.com/tools"
  package="your package name">
  • application config
<application
    tools:replace="android:allowBackup"
    ...>

hope to help guys! 也遇到了这个问题 ,已经解决了,谢谢