souvik-ghosh / react-native-create-thumbnail

iOS/Android thumbnail generator with support for both local and remote videos
MIT License
252 stars 105 forks source link

react-native android build error #78

Closed AzharTechversant closed 11 months ago

AzharTechversant commented 2 years ago

Describe the bug While compile the app getting error * Where: Build file '...../node_modules/react-native-create-thumbnail/android/build.gradle' line: 114

To Reproduce Steps to reproduce the behavior:

Run the app for android with latest react native configuration

  1. either npx react-native run-android or ./gradlew build in android folder

Version "react": "18.2.0", "react-native": "0.70.3", "react-native-create-thumbnail": "^1.6.3"

Expected Results thumbnailnewissue

App should be compile and run on device

sametcl2 commented 2 years ago

I have the same issue, it was working fine a few days ago.

WassimYK commented 2 years ago

same issue !

saif-o99 commented 2 years ago

Same here, whats wrong?

saif-o99 commented 2 years ago

@souvik-ghosh

qusaieilouti99 commented 2 years ago

Same Issue

WassimYK commented 2 years ago

i think this is due to Jcenter server, they had an issue this morning

eltton commented 2 years ago

Same Issue

Anzormumladze commented 2 years ago

Anyone know how long this problem will last?

parthkanani93 commented 2 years ago

Same Issue

WassimYK commented 2 years ago

it works fine for me now

custundag commented 2 years ago

Same issue

AhmadAl-Ghalban commented 2 years ago

Same issue

justinadkins commented 2 years ago

Encountering this again as well, is this still due to jcenter?

Edit / mine is different:

A problem occurred configuring project ':react-native-create-thumbnail'.
> Could not resolve all files for configuration ':react-native-create-thumbnail:implementation'.
   > Could not resolve com.facebook.react:react-native:+.
     Required by:
         project :react-native-create-thumbnail
      > Cannot choose between the following variants of com.facebook.react:react-native:0.71.0-rc.0:
          - debugVariantDefaultRuntimePublication
          - releaseVariantDefaultRuntimePublication
        All of them match the consumer attributes:
          - Variant 'debugVariantDefaultRuntimePublication' capability com.facebook.react:react-native:0.71.0-rc.0:
              - Unmatched attributes:
                  - Provides com.android.build.api.attributes.BuildTypeAttr 'debug' but the consumer didn't ask for it
                  - Provides org.gradle.category 'library' but the consumer didn't ask for it
                  - Provides org.gradle.dependency.bundling 'external' but the consumer didn't ask for it
                  - Provides org.gradle.libraryelements 'aar' but the consumer didn't ask for it
                  - Provides org.gradle.status 'release' but the consumer didn't ask for it
                  - Provides org.gradle.usage 'java-runtime' but the consumer didn't ask for it
          - Variant 'releaseVariantDefaultRuntimePublication' capability com.facebook.react:react-native:0.71.0-rc.0:
              - Unmatched attributes:
                  - Provides com.android.build.api.attributes.BuildTypeAttr 'release' but the consumer didn't ask for it
                  - Provides org.gradle.category 'library' but the consumer didn't ask for it
                  - Provides org.gradle.dependency.bundling 'external' but the consumer didn't ask for it
                  - Provides org.gradle.libraryelements 'aar' but the consumer didn't ask for it
                  - Provides org.gradle.status 'release' but the consumer didn't ask for it
                  - Provides org.gradle.usage 'java-runtime' but the consumer didn't ask for it
justinadkins commented 2 years ago

Likely related to this: https://github.com/facebook/react-native/issues/35210

Ppang0405 commented 2 years ago

+1

hardikbhingradiya commented 2 years ago

Please update library version to 1.6.3, its working fine for me.

marcoamt commented 2 years ago

sorry but it doesn't work for us, we are using 1.6.3 version @hardikbhingradiya

DanielAraldi commented 2 years ago

I'm having the same problem, does anyone have any news?

DanielAraldi commented 2 years ago

I'm using React Native 0.63.4 and I had the same problem when generating the APK. I managed to solve it by adding the following code snippet in my android/build.gradle:

def REACT_NATIVE_VERSION = new File(['node', '--print',"JSON.parse(require('fs').readFileSync(require.resolve('react-native/package.json'), 'utf-8')).version"].execute(null, rootDir).text.trim())

allprojects {
    configurations.all {
        resolutionStrategy {
            force "com.facebook.react:react-native:" + REACT_NATIVE_VERSION
        }
    }
    // ...
}
FadiAboMsalam commented 1 year ago

what worked for me is adding the following to build.gradle inside allprojects-->repositories

exclusiveContent { filter { includeGroup "com.facebook.react" } forRepository { maven { url "$rootDir/../node_modules/react-native/android" } } }

   like below
Screenshot 2023-01-17 at 12 02 27
bumpingChris commented 1 year ago

We are upgrading our RN version from 0.69.7 to 0.71.7. Everything seemed fine in iOS. In Android, however, react-native-create-thumbnail gave us errors. We got the following error:

`Build file ‘/XXXXXX/node_modules/react-native-create-thumbnail/android/build.gradle’ line: 115 A problem occurred configuring project ‘:react-native-create-thumbnail’.

Could not resolve all files for configuration ‘:react-native-create-thumbnail:implementation’. Could not find react-native-0.71.0-rc.0-release.aar (com.facebook.react:react-native:0.71.0-rc.0). Searched in the following locations:`

We then tried to apply the recommended fixes above including: 1) exclusiveContent { filter { includeGroup "com.facebook.react" } forRepository { maven { url "$rootDir/../node_modules/react-native/android" } } }

2) def REACT_NATIVE_VERSION = new File(['node', '--print',"JSON.parse(require('fs').readFileSync(require.resolve('react-native/package.json'), 'utf-8')).version"].execute(null, rootDir).text.trim())

allprojects { configurations.all { resolutionStrategy { // Remove this override in 0.66, as a proper fix is included in react-native itself. force "com.facebook.react:react-native:" + REACT_NATIVE_VERSION } }

We still get this type of error:

`A problem occurred configuring project ‘:react-native-create-thumbnail’.

Could not resolve all files for configuration ‘:react-native-create-thumbnail:implementation’. Could not find any matches for com.facebook.react:react-native:+ as no versions of com.facebook.react:react-native are available. Searched in the following locations:

  • file:/XXXXXXX/node_modules/react-native/android/com/facebook/react/react-native/maven-metadata.xml Required by: project :react-native-create-thumbnail`

Any suggestions would be helpful.

justinadkins commented 1 year ago

@bumpingChris this was resolved for the latest versions of RN. Could it be that your app/build.gradle is incorrectly set up? There are some fairly large changes between the versions you mentioned. See example here.

souvik-ghosh commented 11 months ago

closing due to inactivity

kavinder123 commented 4 months ago

minSdkVersion = 21 compileSdkVersion = 33 targetSdkVersion = 33 "react-native-create-thumbnail": "^2.0.0",

still getting the same issue

nicoladj77 commented 1 month ago

@kavinder123 did you fix it?What react native version are you using?