numandev1 / react-native-compressor

๐Ÿ—œ๏ธCompress Image, Video, and Audio same like Whatsapp ๐Ÿš€โœจ
MIT License
885 stars 85 forks source link

Failed build on android #135

Closed Colt-ain closed 1 year ago

Colt-ain commented 1 year ago

Hello to all. Build fail when add react-native-compressor package in project build failed on android only. On iOS works well.

REACT NATIVE VERSION - 0.67.5

File build.gradle

    ext {
        buildToolsVersion = "30.0.2"
        minSdkVersion = 21
        compileSdkVersion = 30
        targetSdkVersion = 30
        ndkVersion = "21.4.7075529"
        googlePlayServicesVersion = "18.0.2"
        androidMapsUtilsVersion = "2.3.0"
        supportLibVersion = "28.0.0"
    }
    repositories {
        google()
        mavenCentral()
    }
    dependencies {
        classpath("com.android.tools.build:gradle:4.2.2")
    }
}

allprojects {
    repositories {
        maven {
            url("$rootDir/../node_modules/react-native/android")
        }
        maven {
            url("$rootDir/../node_modules/jsc-android/dist")
        }
        mavenCentral {
            content {
                excludeGroup "com.facebook.react"
            }
        }
        google()
        maven { url 'https://jcenter.bintray.com' }
    }
}

BUILD OUTPUT

> react-native run-android

info Running jetifier to migrate libraries to AndroidX. You can disable it using "--no-jetifier" flag.
Jetifier found 1348 file(s) to forward-jetify. Using 12 workers...
info JS server already running.
info Installing the app...

> Configure project :react-native-mmkv-storage

> Task :app:checkDebugAarMetadata FAILED

Deprecated Gradle features were used in this build, making it incompatible with Gradle 8.0.

You can use '--warning-mode all' to show the individual deprecation warnings and determine if they come from your own scripts or plugins.

See https://docs.gradle.org/7.2/userguide/command_line_interface.html#sec:command_line_warnings
62 actionable tasks: 59 executed, 3 up-to-date
Warning: Mapping new ns http://schemas.android.com/repository/android/common/02 to old ns http://schemas.android.com/repository/android/common/01
Warning: Mapping new ns http://schemas.android.com/repository/android/generic/02 to old ns http://schemas.android.com/repository/android/generic/01
Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/addon2/02 to old ns http://schemas.android.com/sdk/android/repo/addon2/01
Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/addon2/03 to old ns http://schemas.android.com/sdk/android/repo/addon2/01
Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/repository2/02 to old ns http://schemas.android.com/sdk/android/repo/repository2/01
Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/repository2/03 to old ns http://schemas.android.com/sdk/android/repo/repository2/01
Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/sys-img2/03 to old ns http://schemas.android.com/sdk/android/repo/sys-img2/01
Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/sys-img2/02 to old ns http://schemas.android.com/sdk/android/repo/sys-img2/01

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:checkDebugAarMetadata'.
> Could not resolve all files for configuration ':app:debugRuntimeClasspath'.
   > Could not find com.github.numandev1:VideoCompressor:715bcc16e9.
     Searched in the following locations:
       - file:/Users/user/project/node_modules/react-native/android/com/github/numandev1/VideoCompressor/715bcc16e9/VideoCompressor-715bcc16e9.pom
       - file:/Users/user/project/node_modules/jsc-android/dist/com/github/numandev1/VideoCompressor/715bcc16e9/VideoCompressor-715bcc16e9.pom
       - https://repo.maven.apache.org/maven2/com/github/numandev1/VideoCompressor/715bcc16e9/VideoCompressor-715bcc16e9.pom
       - https://dl.google.com/dl/android/maven2/com/github/numandev1/VideoCompressor/715bcc16e9/VideoCompressor-715bcc16e9.pom
       - https://jcenter.bintray.com/com/github/numandev1/VideoCompressor/715bcc16e9/VideoCompressor-715bcc16e9.pom
     Required by:
         project :app > project :react-native-compressor

* 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

Packge.json

  "name": "my-project",
  "version": "0.0.1",
  "private": true,
  "scripts": {
    "android": "react-native run-android",
    "ios": "react-native run-ios",
    "lint": "eslint .",
    "start": "react-native start --reset-cache",
    "test": "jest",
  },
  "dependencies": {
    "@hookform/resolvers": "^2.8.8",
    "@ngneat/falso": "^3.0.0",
    "@react-native-community/datetimepicker": "^5.1.0",
    "@react-native-community/masked-view": "^0.1.11",
    "@react-native-community/netinfo": "^9.3.0",
    "@react-navigation/bottom-tabs": "^6.2.0",
    "@react-navigation/native": "^6.0.8",
    "@react-navigation/native-stack": "^6.4.0",
    "appcenter": "4.4.3",
    "appcenter-analytics": "4.4.3",
    "appcenter-crashes": "4.4.3",
    "axios": "^0.25.0",
    "babel-plugin-module-resolver": "^4.1.0",
    "base64-arraybuffer": "^1.0.2",
    "date-fns": "^2.28.0",
    "immutable": "^4.0.0",
    "install": "^0.13.0",
    "libphonenumber-js": "^1.9.47",
    "miragejs": "^0.1.45",
    "native-base": "3.3.12",
    "npm": "^8.4.0",
    "patch-package": "^6.4.7",
    "prop-types": "^15.8.1",
    "react": "17.0.2",
    "react-dom": "^17.0.2",
    "react-hook-form": "^7.25.1",
    "react-native": "0.67.5",
    "react-native-blob-util": "^0.16.2",
    "react-native-calendars": "^1.1284.0",
    "react-native-compressor": "^1.5.2",
    "react-native-document-picker": "^8.0.0",
    "react-native-dotenv": "^3.3.1",
    "react-native-exception-handler": "^2.10.10",
    "react-native-fs": "^2.19.0",
    "react-native-geocoding": "^0.5.0",
    "react-native-gesture-handler": "^2.5.0",
    "react-native-get-random-values": "^1.8.0",
    "react-native-google-places-autocomplete": "^2.5.1",
    "react-native-inappbrowser-reborn": "^3.6.3",
    "react-native-keyboard-aware-scroll-view": "^0.9.5",
    "react-native-maps": "0.30.1",
    "react-native-markdown-view": "^1.1.4",
    "react-native-mmkv-storage": "^0.7.6",
    "react-native-modal-datetime-picker": "^13.0.1",
    "react-native-pager-view": "^5.4.24",
    "react-native-read-more-text": "^1.1.2",
    "react-native-reanimated": "~2.2.4",
    "react-native-redash": "^16.2.3",
    "react-native-safe-area-context": "3.1.9",
    "react-native-screens": "^3.10.2",
    "react-native-splash-screen": "^3.3.0",
    "react-native-svg": "^12.1.0",
    "react-native-tab-view": "^3.1.1",
    "react-native-uuid": "^2.0.1",
    "react-native-uuid-generator": "^6.1.1",
    "react-native-view-overflow": "^0.0.5",
    "react-native-view-pdf": "^0.13.2",
    "react-native-walkthrough-tooltip": "^1.3.0",
    "react-phone-number-input": "^3.1.46",
    "react-redux": "^7.2.6",
    "redux": "^4.1.2",
    "redux-devtools-extension": "^2.13.9",
    "redux-logger": "^3.0.6",
    "redux-persist": "^6.0.0",
    "redux-saga": "^1.1.3",
    "redux-thunk": "^2.4.1",
    "xdate": "^0.8.2",
    "yup": "^0.32.11"
  },
  "devDependencies": {
    "@babel/core": "^7.16.12",
    "@babel/runtime": "^7.16.7",
    "@react-native-community/eslint-config": "^3.0.1",
    "@typescript-eslint/eslint-plugin": "^5.28.0",
    "babel-jest": "^27.4.6",
    "eslint": "^8.8.0",
    "eslint-config-jest-enzyme": "^7.1.2",
    "eslint-config-react-app": "^7.0.0",
    "eslint-plugin-eslint-comments": "^3.2.0",
    "eslint-plugin-extra-rules": "^0.0.0-development",
    "eslint-plugin-flowtype": "^8.0.3",
    "eslint-plugin-import": "^2.25.4",
    "eslint-plugin-jest": "^26.0.0",
    "eslint-plugin-json-format": "^2.0.1",
    "eslint-plugin-react-hooks": "^4.3.0",
    "jest": "^27.4.7",
    "metro-react-native-babel-preset": "^0.66.2",
    "react-test-renderer": "17.0.2"
  }
}
github-actions[bot] commented 1 year ago

๐Ÿ‘‹ @Colt-ain Thanks for opening your issue here! If you find this package useful hit the star๐ŸŒŸ!

numandev1 commented 1 year ago

maven { url 'https://jitpack.io' } add this in repositories { like this

allprojects {
    repositories {
        maven {
            url("$rootDir/../node_modules/react-native/android")
        }
        maven {
            url("$rootDir/../node_modules/jsc-android/dist")
        }
        mavenCentral {
            content {
                excludeGroup "com.facebook.react"
            }
        }
        google()
        maven { url 'https://jcenter.bintray.com' }
        maven { url 'https://jitpack.io' }
    }
}
Colt-ain commented 1 year ago

Holy Moly, that works! Thank you @numandev1 ๐Ÿ™๐Ÿ™Œ