Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

android cannot display webp #47607

Open
nianxiongdi opened this issue Nov 14, 2024 · 4 comments
Open

android cannot display webp #47607

nianxiongdi opened this issue Nov 14, 2024 · 4 comments
Labels
Needs: Attention Issues where the author has responded to feedback. Needs: Repro This issue could be improved with a clear list of steps to reproduce the issue. Platform: Android Android applications.

Comments

@nianxiongdi
Copy link
Contributor

nianxiongdi commented Nov 14, 2024

Description

<Image style={{width: 100, height: 100}} source={{uri: 'https://xxx.webp'}}/>

Steps to reproduce

  1. add dependecy in build.gradle file.
     // For animated GIF support
        implementation 'com.facebook.fresco:animated-gif:3.1.3'

        // For WebP support, including animated WebP
        implementation 'com.facebook.fresco:animated-webp:3.1.3'
        implementation 'com.facebook.fresco:webpsupport:3.1.3'

        // For WebP support, without animations
        implementation 'com.facebook.fresco:webpsupport:3.1.3'
  1. ./gradlew clean build
FAILURE: Build failed with an exception.

* Where:
Build file '/Users/didi/Desktop/data/test123/11/Awesome/android/build.gradle' line: 15

* What went wrong:
A problem occurred evaluating root project 'Awesome'.
> Could not find method implementation() for arguments [com.facebook.fresco:animated-base-support:1.3.0] on object of type org.gradle.api.internal.artifacts.dsl.dependencies.DefaultDependencyHandler.

* 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 746ms
error Failed to install the app. Command failed with exit code 1: ./gradlew app:installDebug -PreactNativeDevServerPort=8081 FAILURE: Build failed with an exception. * Where:
Build file '/Users/didi/Desktop/data/test123/11/Awesome/android/build.gradle' line: 15 * What went wrong:
A problem occurred evaluating root project 'Awesome'.
> Could not find method implementation() for arguments [com.facebook.fresco:animated-base-support:1.3.0] on object of type org.gradle.api.internal.artifacts.dsl.dependencies.DefaultDependencyHandler. * 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 746ms.
info Run CLI with --verbose flag for more details.
  1. If you run npm run android. directly, the static image will be displayed.

React Native Version

0.76.1

Affected Platforms

Runtime - Android

Output of npx react-native info

info Fetching system and libraries information...
System:
  OS: macOS 14.5
  CPU: (12) arm64 Apple M3 Pro
  Memory: 83.16 MB / 18.00 GB
  Shell:
    version: "5.9"
    path: /bin/zsh
Binaries:
  Node:
    version: 20.11.0
    path: ~/.nvm/versions/node/v20.11.0/bin/node
  Yarn:
    version: 1.22.22
    path: ~/.nvm/versions/node/v20.11.0/bin/yarn
  npm:
    version: 10.2.4
    path: ~/.nvm/versions/node/v20.11.0/bin/npm
  Watchman:
    version: 2024.08.26.00
    path: /opt/homebrew/bin/watchman
Managers:
  CocoaPods:
    version: 1.15.2
    path: /opt/homebrew/bin/pod
SDKs:
  iOS SDK:
    Platforms:
      - DriverKit 23.5
      - iOS 17.5
      - macOS 14.5
      - tvOS 17.5
      - visionOS 1.2
      - watchOS 10.5
  Android SDK: Not Found
IDEs:
  Android Studio: 2024.1 AI-241.18034.62.2412.12266719
  Xcode:
    version: 15.4/15F31d
    path: /usr/bin/xcodebuild
Languages:
  Java:
    version: 17.0.12
    path: /usr/bin/javac
  Ruby:
    version: 2.6.10
    path: /usr/bin/ruby
npmPackages:
  "@react-native-community/cli":
    installed: 15.0.0-alpha.2
    wanted: 15.0.0-alpha.2
  react:
    installed: 18.3.1
    wanted: 18.3.1
  react-native:
    installed: 0.76.0
    wanted: 0.76.0
  react-native-macos: Not Found
npmGlobalPackages:
  "*react-native*": Not Found
Android:
  hermesEnabled: true
  newArchEnabled: true
iOS:
  hermesEnabled: true
  newArchEnabled: true

info React Native v0.76.1 is now available (your project is running on v0.76.0).
info Changelog: https://github.com/facebook/react-native/releases/tag/v0.76.1
info Diff: https://react-native-community.github.io/upgrade-helper/?from=0.76.0&to=0.76.1
info For more info, check out "https://reactnative.dev/docs/upgrading?os=macos".

Stacktrace or Logs

FAILURE: Build failed with an exception.

* Where:
Build file '/Users/didi/Desktop/data/test123/11/Awesome/android/build.gradle' line: 15

* What went wrong:
A problem occurred evaluating root project 'Awesome'.
> Could not find method implementation() for arguments [com.facebook.fresco:animated-base-support:1.3.0] on object of type org.gradle.api.internal.artifacts.dsl.dependencies.DefaultDependencyHandler.

* 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 746ms
error Failed to install the app. Command failed with exit code 1: ./gradlew app:installDebug -PreactNativeDevServerPort=8081 FAILURE: Build failed with an exception. * Where:
Build file '/Users/didi/Desktop/data/test123/11/Awesome/android/build.gradle' line: 15 * What went wrong:
A problem occurred evaluating root project 'Awesome'.
> Could not find method implementation() for arguments [com.facebook.fresco:animated-base-support:1.3.0] on object of type org.gradle.api.internal.artifacts.dsl.dependencies.DefaultDependencyHandler. * 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 746ms.
info Run CLI with --verbose flag for more details.

Reproducer

none

Screenshots and Videos

No response

@react-native-bot react-native-bot added Platform: Android Android applications. Needs: Author Feedback Needs: Repro This issue could be improved with a clear list of steps to reproduce the issue. labels Nov 14, 2024
@react-native-bot
Copy link
Collaborator

Warning

Missing reproducer: We could not detect a reproducible example in your issue report. Please provide either:

@shubhamguptadream11
Copy link
Collaborator

@nianxiongdi Try checking once on latest fresco version? Refer here: https://github.com/facebook/fresco

@nianxiongdi
Copy link
Contributor Author

nianxiongdi commented Nov 14, 2024

@shubhamguptadream11

android git:(master)  ./gradlew clean build

> Configure project :expo

Using expo modules
  - expo-asset (10.0.10)
  - expo-brightness (12.0.1)
  - expo-clipboard (6.0.3)
  - expo-constants (16.0.2)
  - expo-file-system (17.0.1)
  - expo-font (12.0.10)
  - expo-keep-awake (13.0.2)
  - expo-modules-core (1.12.24)


> Configure project :react-native-reanimated
Android gradle plugin: 8.5.0
Gradle: 8.8

> Task :expo-modules-core:externalNativeBuildCleanDebug
Clean expo-modules-core-armeabi-v7a
Clean expo-modules-core-arm64-v8a
Clean expo-modules-core-x86
Clean expo-modules-core-x86_64

> Task :expo-modules-core:externalNativeBuildCleanRelease FAILED
Clean expo-modules-core-x86
C/C++: CMake Error in CMakeLists.txt:
C/C++:   Imported target "ReactAndroid::jsi" includes non-existent path
C/C++:     "/Users/.gradle/caches/8.8/transforms/e9ece4ab06dce1d987888c4dc6dad0c4/transformed/react-android-0.75.2-release/prefab/modules/jsi/include"
C/C++:   in its INTERFACE_INCLUDE_DIRECTORIES.  Possible reasons include:
C/C++:   * The path was deleted, renamed, or moved to another location.
C/C++:   * An install or uninstall procedure did not complete successfully.
C/C++:   * The installation package was faulty and references files it does not
C/C++:   provide.
C/C++: CMake Generate step failed.  Build files cannot be regenerated correctly.
C/C++: ninja: error: rebuilding 'build.ninja': subcommand failed

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':expo-modules-core:externalNativeBuildCleanRelease'.
> com.android.ide.common.process.ProcessException: ninja: Entering directory `/Users/Desktop/rn/awesomeprojectdemo/node_modules/expo-modules-core/android/.cxx/RelWithDebInfo/303t2c6e/x86'
  [0/1] Re-running CMake...
  -- Configuring done
  -- Generating done
  FAILED: build.ninja
  /Users/Library/Android/sdk/cmake/3.22.1/bin/cmake --regenerate-during-build -S/Users/Desktop/rn/awesomeprojectdemo/node_modules/expo-modules-core/android -B/Users/Desktop/rn/awesomeprojectdemo/node_modules/expo-modules-core/android/.cxx/RelWithDebInfo/303t2c6e/x86

  C++ build system [clean] failed while executing:
      /Users/Library/Android/sdk/cmake/3.22.1/bin/ninja \
        -C \
        /Users/Desktop/rn/awesomeprojectdemo/node_modules/expo-modules-core/android/.cxx/RelWithDebInfo/303t2c6e/x86 \
        clean
    from /Users/didDesktop/rn/awesomeprojectdemo/node_modules/expo-modules-core/android
  CMake Error in CMakeLists.txt:
    Imported target "ReactAndroid::jsi" includes non-existent path

      "/Users/.gradle/caches/8.8/transforms/e9ece4ab06dce1d987888c4dc6dad0c4/transformed/react-android-0.75.2-release/prefab/modules/jsi/include"

    in its INTERFACE_INCLUDE_DIRECTORIES.  Possible reasons include:

    * The path was deleted, renamed, or moved to another location.

    * An install or uninstall procedure did not complete successfully.

    * The installation package was faulty and references files it does not
    provide.



  CMake Generate step failed.  Build files cannot be regenerated correctly.
  ninja: error: rebuilding 'build.ninja': subcommand failed

* 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 6s
25 actionable tasks: 15 executed, 10 up-to-date

@github-actions github-actions bot added Needs: Attention Issues where the author has responded to feedback. and removed Needs: Author Feedback labels Nov 14, 2024
@nianxiongdi
Copy link
Contributor Author

@shubhamguptadream11 can you provide a configuration?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Needs: Attention Issues where the author has responded to feedback. Needs: Repro This issue could be improved with a clear list of steps to reproduce the issue. Platform: Android Android applications.
Projects
None yet
Development

No branches or pull requests

3 participants