flurry / react-native-flurry-sdk

React Native Flurry SDK
Apache License 2.0
45 stars 13 forks source link

Could not resolve all files for configuration ':react-native-flurry-sdk:androidApis' #41

Closed supagu closed 2 years ago

supagu commented 2 years ago

Describe the bug Building android throws the following error:

FAILURE: Build failed with an exception. 2022-04-11T16:39:48.082+0930 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] 2022-04-11T16:39:48.082+0930 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] * What went wrong: 2022-04-11T16:39:48.082+0930 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] Execution failed for task ':react-native-flurry-sdk:parseReleaseLocalResources'. 2022-04-11T16:39:48.082+0930 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] > Could not resolve all files for configuration ':react-native-flurry-sdk:androidApis'. 2022-04-11T16:39:48.082+0930 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] > Failed to transform android.jar to match attributes {artifactType=android-platform-attr, org.gradle.libraryelements=jar, org.gradle.usage=java-runtime}. 2022-04-11T16:39:48.082+0930 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] > Execution failed for PlatformAttrTransform: /Users/fabian/Library/Android/sdk/platforms/android-28/android.jar. 2022-04-11T16:39:48.082+0930 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] > /Users/fabian/Library/Android/sdk/platforms/android-28/android.jar

This Bug is About Please choose the closest item by replacing [ ] with [x].

Platform Please choose the platform(s) that you are having the issue by replacing [ ] with [x].

Environment Please tell us the versions of SDKs you are using. If you are not sure about React Native version, you can run react-native --version under your project.

To Reproduce Steps to reproduce the behavior: yarn add react-native-flurry-sdk then try to do an android build in the android directory with: ./gradlew assembleRelease

Add any other context about the problem here. iOS integration is working fine for the same project.

poting-oath commented 2 years ago

@supagu the latest React Native version is 0.68. https://reactnative.dev/versions

$ cd $project/android
$ ./gradlew :react-native-flurry-sdk:parseReleaseLocalResources

Works fine. Is it a regress? Or it's the first time you try the plugin?

supagu commented 2 years ago

I thought this might be a problem due to me upgrading an old project, so I've tried a new project from scratch and I get the same error: https://pastebin.com/akxmXRNk

Here is my react-native test project: https://drive.google.com/file/d/1sMqvENtm4MLvrf2_k1VCGEXEIft-U59P/view?usp=sharing

If this is working for other people, then it must be something in my environment breaking things as this is just a stock react-native project with flurry sdk added.

poting-oath commented 2 years ago

@supagu Download and unzip your test project.

  1. $ cd rntest
  2. $ npm insstall
  3. $ npx react-native run-android No any error!

FYI, it asks > Android Gradle plugin requires Java 11 to run. You are currently using Java 1.8. So I update my JAVA_HOME point to my Java 11 instead of my default Java 1.8.

And here is my React Native versions:

$ react-native --version
react-native-cli: 2.0.1
react-native: 0.68.0
$ npx --version
8.5.1
supagu commented 2 years ago

I'm quite sure this is an environment issue so I'm closing the issue. Thanks for your help!