THEOplayer / react-native-theoplayer

A React Native THEOplayerView component
https://theoplayer.github.io/react-native-theoplayer/
MIT License
64 stars 21 forks source link

Issues while compiling THEOplayer with ReNative framework #234

Closed andread95 closed 8 months ago

andread95 commented 10 months ago

Hi there, I'm experiencing issues while using ReNative framework and THEOplayer package.

To be more specific, the error appears while compiling for AndroidTV (haven't tested for other platforms yet)

`FAILURE: Build completed with 2 failures.

Task 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 any matches for com.theoplayer.theoplayer-sdk-android:unified:+ as no versions of com.theoplayer.theoplayer-sdk-android:unified are available. Searched in the following locations:

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.

Task failed with an exception.

What went wrong: Execution failed for task ':react-native-theoplayer:generateDebugRFile'.

Could not resolve all files for configuration ':react-native-theoplayer:debugCompileClasspath'. Could not find any matches for com.theoplayer.theoplayer-sdk-android:unified:+ as no versions of com.theoplayer.theoplayer-sdk-android:unified are available. Required by: project :react-native-theoplayer Could not find any matches for com.theoplayer.theoplayer-sdk-android:unified-ads:+ as no versions of com.theoplayer.theoplayer-sdk-android:unified-ads are available. Required by: project :react-native-theoplayer Could not find any matches for com.theoplayer.theoplayer-sdk-android:unified-ads-ima:+ as no versions of com.theoplayer.theoplayer-sdk-android:unified-ads-ima are available. Required by: project :react-native-theoplayer`

Among all these errors I noticed:

`What went wrong: Execution failed for task :react-native-theoplayer:generateDebugRFile.

Could not resolve all files for configuration ':react-native-theoplayer:debugCompileClasspath'. Could not find any matches for com.theoplayer.theoplayer-sdk-android:unified:+ as no versions of com.theoplayer.theoplayer-sdk-android:unified are available. Required by: project :react-native-theoplayer Could not find any matches for com.theoplayer.theoplayer-sdk-android:unified-ads:+ as no versions of com.theoplayer.theoplayer-sdk-android:unified-ads are available. Required by: project :react-native-theoplayer Could not find any matches for com.theoplayer.theoplayer-sdk-android:unified-ads-ima:+ as no versions of com.theoplayer.theoplayer-sdk-android:unified-ads-ima are available. Required by: project :react-native-theoplayer`

It seems like It can't find these packages which are required...any clue?

Any help on this It would be appreciated, thank you!

ReNative 0.37.4 React Native THEOplayer 3.2.1

tvanlaerhoven commented 10 months ago

It looks like it still tries to resolve pre-v6.0.0 native SDKs. Since 6.0, the native Android player SDK has been renamed from

com.theoplayer.theoplayer-sdk-android:unified:+ to com.theoplayer.theoplayer-sdk-android:core:+

The extension modules also have been renamed.

In react-native-theoplayer v3.0.0 support for renaming has been included (https://github.com/THEOplayer/react-native-theoplayer/blob/develop/CHANGELOG.md#300---23-10-06), so it looks like there is still a reference to an older react-native-theoplayer SDK version in the project.

Is it possible to verify this in your project? Maybe check in the resolved ./node_module/react-native-theoplayer if this really is a v3+ version?

andread95 commented 10 months ago

Hi there,

it seems to be 3.2.1 the version installed, here you are the package.json in ~/node_modules/react-native-theoplayer

{ "name": "react-native-theoplayer", "version": "3.2.1", "description": "A THEOplayer video component for react-native.", "main": "lib/commonjs/index", "module": "lib/module/index", "types": "lib/typescript/index.d.ts", "react-native": "src/index", "source": "src/index", "files": [ "src", "lib", "android", "ios", "cpp", "react-native-theoplayer.podspec", "react-native-theoplayer.json", "CHANGELOG.md", "!lib/typescript/example", "!android/build", "!ios/build", "!**/__fixtures__", "!**/__mocks__" ], "scripts": { "typescript": "tsc --noEmit", "lint": "eslint \"**/*.{ts,tsx}\"", "prepare": "bob build && husky install", "release": "release-it", "pods": "cd example && pod-install --quiet" }, "keywords": [ "react-native", "THEOplayer", "ios", "android" ], "repository": { "type": "git", "url": "git@github.com:THEOplayer/react-native-theoplayer.git" }, "author": "THEO Technologies", "license": "SEE LICENSE AT https://www.theoplayer.com/terms", "homepage": "https://theoplayer.com/", "publishConfig": { "registry": "https://registry.npmjs.org/" }, "devDependencies": { "@commitlint/config-conventional": "^11.0.0", "@react-native-community/eslint-config": "^2.0.0", "@release-it/conventional-changelog": "^7.0.2", "@types/react": "^18.2.24", "@types/react-native": "^0.72.3", "commitlint": "^17.7.2", "eslint": "^7.32.0", "eslint-config-prettier": "^7.2.0", "eslint-plugin-prettier": "^3.4.1", "eslint-plugin-react-native": "^4.1.0", "husky": "^6.0.0", "pod-install": "^0.1.39", "prettier": "^2.8.8", "react": "^18.2.0", "react-native": "^0.72.5", "react-native-builder-bob": "^0.18.3", "release-it": "^16.2.1", "theoplayer": "^6.1.0", "typescript": "^4.9.5" }, "peerDependencies": { "react": "*", "react-native": "*", "theoplayer": ">=5.0.1" }, "peerDependenciesMeta": { "theoplayer": { "optional": true } }, "commitlint": { "extends": [ "@commitlint/config-conventional" ] }, "release-it": { "git": { "commitMessage": "chore: release ${version}", "tagName": "v${version}" }, "npm": { "publish": true }, "github": { "release": true }, "plugins": { "@release-it/conventional-changelog": { "preset": "angular" } } }, "eslintIgnore": [ "node_modules/", "lib/" ], "react-native-builder-bob": { "source": "src", "output": "lib", "targets": [ "commonjs", "module", [ "typescript", { "project": "tsconfig.build.json" } ] ] }, "dependencies": { "buffer": "^6.0.3" } }

tvanlaerhoven commented 10 months ago

@andread95 OK we'll check it with a vanilla Renative project as well.

tvanlaerhoven commented 10 months ago

@michelecocuccio we created a sample app for ReNative here: https://github.com/THEOplayer/renative-theoplayer-sample

could you try this one?

Passing the extra repository is important:

https://github.com/THEOplayer/renative-theoplayer-sample#android-plugin-configuration

michelecocuccio commented 10 months ago

I am so sorry, I haven't properly read the issue and I easily mistaken "Renative" with "React Native". Mi issue (which is similar) happens in a expo managed project but this should not make a difference in fact I was able to build it until a couple of weeks ago. Should I open a separated issue? Sorry again if I made this mistake

tvanlaerhoven commented 10 months ago

@michelecocuccio OK no problem, Expo has similar issues with resolving the internal Maven modules. It doesn't process the custom repository url we provide in the gradle file. We are adding an Expo plugin to react-native-theoplayer to accommodate this: https://github.com/THEOplayer/react-native-theoplayer/pull/242

The plugin will add the Maven repo to the generated Android template when it is installed. We'll release it as soon as possible.

michelecocuccio commented 10 months ago

@michelecocuccio OK no problem, Expo has similar issues with resolving the internal Maven modules. It doesn't process the custom repository url we provide in the gradle file. We are adding an Expo plugin to react-native-theoplayer to accommodate this: #242

The plugin will add the Maven repo to the generated Android template when it is installed. We'll release it as soon as possible.

Thank you very much, it's very appreciated

tvanlaerhoven commented 10 months ago

@michelecocuccio could you try v3.4.1 of the react-native-theoplayer SDK?

Specify react-native-theoplayer as a plugin in the app.json file if your Expo app:

"plugins": ["react-native-theoplayer"]

We have a minimal Expo sample app, but it's not publicly available yet. Documentation is also pending.

andread95 commented 10 months ago

@tvanlaerhoven Hi there, I've tried your solution but without success. Still facing issues while building...I've tried with our project and with a sample one with just your RN SDK..we're getting this errors:

`FAILED with ERROR:

FAILURE: Build failed with an exception.

BUILD FAILED in 2s

Command failed with exit code 1: ./gradlew assembleDebug -x bundleReleaseJsAndAssets

FAILURE: Build failed with an exception.

BUILD FAILED in 2s Configuration on demand is an incubating feature.

Configure project :app Warning: The 'kotlin-android-extensions' Gradle plugin is deprecated. Please use this migration guide (https://goo.gle/kotlin-android-extensions-deprecation) to start working with View Binding (https://developer.android.com/topic/libraries/view-binding) and the 'kotlin-parcelize' plugin.

FAILURE: Build failed with an exception.

BUILD FAILED in 2s

Error: Command failed with exit code 1: ./gradlew assembleDebug -x bundleReleaseJsAndAssets

FAILURE: Build failed with an exception.

BUILD FAILED in 2s Configuration on demand is an incubating feature.

Configure project :app Warning: The 'kotlin-android-extensions' Gradle plugin is deprecated. Please use this migration guide (https://goo.gle/kotlin-android-extensions-deprecation) to start working with View Binding (https://developer.android.com/topic/libraries/view-binding) and the 'kotlin-parcelize' plugin. at makeError (/Volumes/CRUCIAL_M2/test_renative/test_app/node_modules/execa/lib/error.js:60:11) at handlePromise (/Volumes/CRUCIAL_M2/test_renative/test_app/node_modules/execa/index.js:118:26) at processTicksAndRejections (node:internal/process/task_queues:96:5)`

tvanlaerhoven commented 10 months ago

@michelecocuccio there was an issue when the plugin was used without arguments like this:

"plugins": ["react-native-theoplayer"]

for which we released a patched version (3.4.2).

Your build error indicated something else I think. Could you double check the package versions are correct. Maybe also post here what is on the failing line 31 of the build.gradle file. Which version of Expo are you using?

ceyhun-o commented 9 months ago

Hi @andread95,

Are you still having the same error while building with Renative?

Can you please let me know if you could build the sample app my colleague shared so that we know if something is missing on your development environment or on your project? Please try to build https://github.com/THEOplayer/renative-theoplayer-sample (you will need to use node 16 with it). This project currently only includes Android and Web.

tvanlaerhoven commented 8 months ago

@michelecocuccio @andread95 we'll close this ticket for now. Let us know if you still encounter issues regarding ReNative.