react-native-vlc-media-player-test icon indicating copy to clipboard operation
react-native-vlc-media-player-test copied to clipboard

Running Android has critical issues

Open amerllica opened this issue 5 years ago • 10 comments

Under trying to run this test on Android I got these errors:

> Task :react-native-vlc-media-player:compileDebugJavaWithJavac

> Task :app:transformNativeLibsWithMergeJniLibsForDebug FAILED

Deprecated Gradle features were used in this build, making it incompatible with Gradle 7.0.
Use '--warning-mode all' to show the individual deprecation warnings.
See https://docs.gradle.org/6.5/userguide/command_line_interface.html#sec:command_line_warnings
42 actionable tasks: 42 executed
warning: [options] source value 7 is obsolete and will be removed in a future release
warning: [options] target value 7 is obsolete and will be removed in a future release
warning: [options] To suppress warnings about obsolete options, use -Xlint:-options.
Note: /Users/amerllica/WebstormProjects/react-native-vlc-media-player-test/node_modules/react-native-vlc-media-player/android/src/main/java/com/yuanzhou/vlc/vlcplayer/ReactVlcPlayerView.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
3 warnings

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:transformNativeLibsWithMergeJniLibsForDebug'.
> More than one file was found with OS independent path 'lib/x86/libc++_shared.so'

amerllica avatar Jun 06 '20 12:06 amerllica

I've had trouble running on Android too. I got the following error:

Task :app:packageDebug FAILED

61 actionable tasks: 61 executed Note: <my_path>\react-native-vlc-media-player-test\node_modules\react-native-vlc-media-player\android\src\main\java\com\yuanzhou\vlc\vlcplayer\ReactVlcPlayerView.java uses or overrides a deprecated API. Note: Recompile with -Xlint:deprecation for details. Note: Some input files use or override a deprecated API. Note: Recompile with -Xlint:deprecation for details. Note: <my_path>\react-native-vlc-media-player-test\android\app\src\debug\java\com\vlctest\ReactNativeFlipper.java uses or overrides a deprecated API. Note: Recompile with -Xlint:deprecation for details.

FAILURE: Build failed with an exception.

  • What went wrong: Execution failed for task ':app:packageDebug'.

A failure occurred while executing com.android.build.gradle.tasks.PackageAndroidArtifact$IncrementalSplitterRunnable java.lang.OutOfMemoryError (no error message)

** Edit: manage to run on android using the rn-63 branch **

juliamsousa avatar Jan 15 '21 16:01 juliamsousa

Can you please try the test repo?

On Sat, 16 Jan 2021 at 5:20 AM, Júlia Miranda [email protected] wrote:

I've had trouble running on Android too. I got the following error:

Task :app:packageDebug FAILED

61 actionable tasks: 61 executed Note: <my_path>\react-native-vlc-media-player-test\node_modules\react-native-vlc-media-player\android\src\main\java\com\yuanzhou\vlc\vlcplayer\ReactVlcPlayerView.java uses or overrides a deprecated API. Note: Recompile with -Xlint:deprecation for details. Note: Some input files use or override a deprecated API. Note: Recompile with -Xlint:deprecation for details. Note: <my_path>\react-native-vlc-media-player-test\android\app\src\debug\java\com\vlctest\ReactNativeFlipper.java uses or overrides a deprecated API. Note: Recompile with -Xlint:deprecation for details.

FAILURE: Build failed with an exception.

  • What went wrong: Execution failed for task ':app:packageDebug'.

A failure occurred while executing com.android.build.gradle.tasks.PackageAndroidArtifact$IncrementalSplitterRunnable java.lang.OutOfMemoryError (no error message)

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/razorRun/react-native-vlc-media-player-test/issues/3#issuecomment-761038494, or unsubscribe https://github.com/notifications/unsubscribe-auth/AFB72EE2BLTEE2DY3H6RRD3S2BTL5ANCNFSM4NV5LWOA .

razorRun avatar Jan 15 '21 20:01 razorRun

@razorRun i tried the test repo and the rn-63 branch was functioning perfectly. I tried to install the package in a brand new and unmodified react-native app and had many issues. I managed to install it by making some changes in the native modules. Here's what i did:

i added this to my android/app/build.gradle

` packagingOptions {

    pickFirst 'lib/x86/libc++_shared.so'

    pickFirst 'lib/arm64-v8a/libc++_shared.so'

    pickFirst 'lib/x86_64/libc++_shared.so'

    pickFirst 'lib/armeabi-v7a/libc++_shared.so'
}`

also:

`defaultConfig { ...

    multiDexEnabled true //Add this line

}`

and finally upgraded my minSDKVersion to 17 ( android/build.gradle):

`buildscript {

ext {

    buildToolsVersion = "29.0.2"

    minSdkVersion = 17

    compileSdkVersion = 29

    targetSdkVersion = 29
}

}`

After these modifications I didn't have any more issues with building and using the package.

juliamsousa avatar Jan 19 '21 17:01 juliamsousa

Same issue for me on Android Works great on iOS though. React 0.64.1

Dropping the minSdkVersion to 17 is not an option as other libraries rely on minSdkVersion 21

If I add the advice above but leave the minSdkVersion 21 The error is:

  • What went wrong: Execution failed for task ':app:packageDebug'.

A failure occurred while executing com.android.build.gradle.tasks.PackageAndroidArtifact$IncrementalSplitterRunnable java.lang.OutOfMemoryError (no error message)

slaymantis avatar Sep 18 '21 00:09 slaymantis

Sorry guys. I am bit packed at the momeant and will have to leave these issues to the community. See the note regarding big fixes on the readme ( I am more than happy to merge or add you guys as contributers to the repo.)

Cheers

On Sat, 18 Sep 2021 at 12:59 PM, slaymantis @.***> wrote:

Same issue for me on Android Works great on iOS though. React 0.64.1

Dropping the minSdkVersion to 17 is not an option as other libraries rely on minSdkVersion 21

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/razorRun/react-native-vlc-media-player-test/issues/3#issuecomment-922151042, or unsubscribe https://github.com/notifications/unsubscribe-auth/AFB72EAY2E22MZGHGCD6PWDUCPP65ANCNFSM4NV5LWOA . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

razorRun avatar Sep 18 '21 01:09 razorRun

Thanks, all in your own time when you ready :) Just letting you know I also tried this test repo with react 0.63.4 but same error

  • What went wrong: Execution failed for task ':app:packageDebug'.

A failure occurred while executing com.android.build.gradle.tasks.PackageAndroidArtifact$IncrementalSplitterRunnable java.lang.OutOfMemoryError (no error message)

But I did finally manage to get it working by adding the tip above

added this to android/gradle.properties org.gradle.jvmargs=-Xmx4608m

added this to android/app/build.gradle packagingOptions { pickFirst 'lib/x86/libc++_shared.so' pickFirst 'lib/arm64-v8a/libc++_shared.so' pickFirst 'lib/x86_64/libc++_shared.so' pickFirst 'lib/armeabi-v7a/libc++_shared.so' }

defaultConfig { ... multiDexEnabled true }

dependencies { implementation 'com.android.support:multidex:2.0.1' }

Also not sure if it made a difference but I also rolled back to android studio 4.2.1 instead of 2021 And I installed oracle java instead of the homebrew one

slaymantis avatar Sep 22 '21 03:09 slaymantis

@slaymantis Thank you so much you save my day it work for me added this line added this to android/gradle.properties org.gradle.jvmargs=-Xmx4608m

musadiq123 avatar Oct 05 '21 07:10 musadiq123

a little change need:

implementation 'androidx.multidex:multidex:2.0.1'

StevenGardnerGMJ avatar May 26 '22 07:05 StevenGardnerGMJ

Hi there

Feel free to send a pr please

Cheers On Thu, 26 May 2022 at 7:13 PM, Steven Gardner @.***> wrote:

a little change need:

implementation 'androidx.multidex:multidex:2.0.1'

— Reply to this email directly, view it on GitHub https://github.com/razorRun/react-native-vlc-media-player-test/issues/3#issuecomment-1138237816, or unsubscribe https://github.com/notifications/unsubscribe-auth/AFB72EFPGCKSY3E72YODWUDVL4QBBANCNFSM4NV5LWOA . You are receiving this because you were mentioned.Message ID: @.*** com>

razorRun avatar May 26 '22 07:05 razorRun

Hi there,

Tested with react native 0.68, react-native-vlc-media-player 1.0.41

I did the following changes to make it work:

In android/build.gradle minSdkVersion =21

In android/app/build.gradle add this

defaultConfig{ .... multiDexEnabled true

}

and android { ..... packagingOptions {

pickFirst 'lib/x86/libc++_shared.so'

pickFirst 'lib/arm64-v8a/libc++_shared.so'

pickFirst 'lib/x86_64/libc++_shared.so'

pickFirst 'lib/armeabi-v7a/libc++_shared.so'

} }

in android/gradle.properties

add this org.gradle.jvmargs=--add-opens java.base/java.io=ALL-UNNAMED

NandanSpeedshield avatar Aug 22 '22 13:08 NandanSpeedshield