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

react-native android build error #78

Closed
AzharTechversant opened this issue Oct 31, 2022 · 23 comments
Closed

react-native android build error #78

AzharTechversant opened this issue Oct 31, 2022 · 23 comments
Labels
bug Something isn't working

Comments

@AzharTechversant
Copy link

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

  • What went wrong:
    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
> Failed to list versions for com.facebook.react:react-native.
> Unable to load Maven meta-data from https://jcenter.bintray.com/com/facebook/react/react-native/maven-metadata.xml.
> Could not HEAD 'https://jcenter.bintray.com/com/facebook/react/react-native/maven-metadata.xml'.
> Read timed out

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

@AzharTechversant AzharTechversant added the bug Something isn't working label Oct 31, 2022
@sametcl2
Copy link

sametcl2 commented Oct 31, 2022

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

@WassimYK
Copy link

same issue !

@saif-o99
Copy link

Same here, whats wrong?

@saif-o99
Copy link

@souvik-ghosh

@qusaieilouti99
Copy link

Same Issue

@WassimYK
Copy link

WassimYK commented Oct 31, 2022

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

@eltton
Copy link

eltton commented Oct 31, 2022

Same Issue

@Anzormumladze
Copy link

Anyone know how long this problem will last?

@parthkanani93
Copy link

Same Issue

@WassimYK
Copy link

WassimYK commented Nov 3, 2022

it works fine for me now

@custundag
Copy link

Same issue

1 similar comment
@AhmadAl-Ghalban
Copy link

Same issue

@justinadkins
Copy link

justinadkins commented Nov 5, 2022

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
Copy link

Likely related to this: facebook/react-native#35210

@Ppang0405
Copy link

+1

@hardikbhingradiya
Copy link

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

@marcoamt
Copy link

marcoamt commented Nov 7, 2022

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

@DanielAraldi
Copy link

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

@DanielAraldi
Copy link

DanielAraldi commented Nov 7, 2022

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
Copy link

FadiAboMsalam commented Jan 17, 2023

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
Copy link

bumpingChris commented May 10, 2023

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
Copy link

justinadkins commented May 10, 2023

@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
Copy link
Owner

closing due to inactivity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests