Quantcast
Channel: Active questions tagged react-native+android - Stack Overflow
Viewing all 28480 articles
Browse latest View live

Detox - DetoxManager can not find kotlin/jvm/functions/Function1 at runtime

$
0
0

To reproduce the issue I'm facing I used the react-native example project demo-react-native from `Detox.

After installing the packages with yarn I executed the 2 commands to run the test:

1) cd android && ./gradlew assembleRelease assembleAndroidTest -DtestBuildType=release && cd ..

2) npx detox test -l error --configuration android.emu.release

So far everything works as expected but as soon I add the dependency of the Kotlin standard library in the android/app/build.gradle file like that

dependencies {  ...  androidTestImplementation('com.wix:detox:+')  implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.3.71" // <-- line added}

and run the 2 steps again I get the following error

04-05 20:21:06.709 16552 16615 E AndroidRuntime: FATAL EXCEPTION: com.wix.detox.manager04-05 20:21:06.709 16552 16615 E AndroidRuntime: Process: com.test.app, PID: 1655204-05 20:21:06.709 16552 16615 E AndroidRuntime: java.lang.NoClassDefFoundError: Failed resolution of: Lkotlin/jvm/functions/Function1;04-05 20:21:06.709 16552 16615 E AndroidRuntime:    at com.wix.detox.Detox$1.run(Detox.java:134)04-05 20:21:06.709 16552 16615 E AndroidRuntime:    at java.lang.Thread.run(Thread.java:764)04-05 20:21:06.709 16552 16615 E AndroidRuntime: Caused by: java.lang.ClassNotFoundException: Didn't find class "kotlin.jvm.functions.Function1" on path: DexPathList[[zip file "/system/framework/android.test.runner.jar", zip file "/system/framework/android.test.mock.jar", zip file "/data/app/com.test.app.test-xbA2GW9WwS_BxzRNPa2waQ==/base.apk", zip file "/data/app/com.test.app-g_-tD026mxddTh82TmdYGg==/base.apk"],nativeLibraryDirectories=[/data/app/com.test.app.test-xbA2GW9WwS_BxzRNPa2waQ==/lib/x86, /data/app/com.test.app-g_-tD026mxddTh82TmdYGg==/lib/x86, /data/app/com.test.app.test-xbA2GW9WwS_BxzRNPa2waQ==/base.apk!/lib/x86, /data/app/com.test.app-g_-tD026mxddTh82TmdYGg==/base.apk!/lib/x86, /system/lib]]04-05 20:21:06.709 16552 16615 E AndroidRuntime:    at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:134)04-05 20:21:06.709 16552 16615 E AndroidRuntime:    at java.lang.ClassLoader.loadClass(ClassLoader.java:379)04-05 20:21:06.709 16552 16615 E AndroidRuntime:    at java.lang.ClassLoader.loadClass(ClassLoader.java:312)

I have tried to load the JVM plugin in the android/build.gradle file as described here but it doesn't help.

What else can I do to make org.jetbrains.kotlin.jvm work in that project?

Thank you in advance.

Edit 1

I added kotlin.jvm.functions.Function1 to the MainApplication.java to test whether the Kotlin JVM is actually accessible by the project by adding the following code

...import kotlin.jvm.functions.Function0;import kotlin.jvm.functions.Function1;public class MainApplication extends Application implements ReactApplication {    private Function1<Throwable, String> errorParseFn = new Function1<Throwable, String>() {        @Override        public String invoke(Throwable t) {            return Log.getStackTraceString(t);        }    };    ...    @Override    public void onCreate() {        super.onCreate();        SoLoader.init(this, /* native exopackage */ false);        Log.d("@@@@@@", "onCreate");        Log.d("@@@@@@", errorParseFn.invoke(new Exception("Test Exception message")));    }}

after I ran npx detox test -l error --configuration android.emu.release once again I could see the logs in the console.

04-06 21:24:06.715 23836 23836 D @@@@@@  : onCreate04-06 21:24:06.716 23836 23836 D @@@@@@  : java.lang.Exception: Test Exception message 

That means that the app itself has access to the kotlin.jvm, which means the gradle setup is correct.

Has anyone an idea how DetoxManager.java can access the Kotlin JVM at runtime?


No sound when receiving push notification

$
0
0

i am using react-native-firebase v6 to handle the push notification. The problem is there is no sound played when the push notification received.

I have create a channel and set it to high priority since the default channel created by react-native-firebase has no sound. Here the code i used in the MainActivity.java

protected void onCreate(Bundle savedInstanceState) {  super.onCreate(savedInstanceState);  if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {        NotificationChannel notificationChannel = new NotificationChannel("notifid", "App notification channel", NotificationManager.IMPORTANCE_HIGH);    notificationChannel.setShowBadge(true);    notificationChannel.setDescription("custom notification channel");    notificationChannel.enableVibration(true);    notificationChannel.enableLights(true);    notificationChannel.setVibrationPattern(new long[]{400, 200, 400});    //notificationChannel.setLockscreenVisibility(Notification.VISIBILITY_PUBLIC);    NotificationManager manager = getSystemService(NotificationManager.class);    manager.createNotificationChannel(notificationChannel);  }}

And here is the code to change the channel in firebase.json

{"react-native": {"messaging_android_notification_channel_id": "notifid"  }}

But the sound still not playing when the notification received.

React native Android - network request failed error with fetch() method

$
0
0

Currently, my app is not working, and it prints out an error message "network request failed".

The URL is correct - the URL is woking properly in Chrome, however, it only not working on the android.

I am assuming that it is basically because I am using private certificate for https.

Below is my code, please let me know if you find an answer.

fetch(url) .then(res => res.json()) .then( (result) => { const companyName = result['name']; const companyId = 'ID '+ result['id'];

      this.setState({        isLoaded: true,        siteData: result,        companyName: companyName,        companyID: companyId      });    }  )  .catch((error) => {    console.log(error);    this.setState({      isLoaded: false,      error    });  });

Ignore SSL certificates error in axios/fetch call in react-native expo android

$
0
0

I just started using react-native and am trying to build an android app with it.. I used create-react-native-app and used the expo template. But I'm not able to fetch data from my server kepp getting "Network Error". My server doesn't have a valid certificate currently. Is there any way to ignore ssl certificate errors in my fetch calls?

Firebase deeplink url is null when installing application - React native

$
0
0

I am using react-native-firebase in react native project. I am able to get link when app is open. but when app is not installed and if I install app from firebase deeplink then I am not getting data.

React native code :

await firebase.links()            .getInitialLink()            .then((url) => {                if (url) {                    // app opened from a url                    Logger.log("-----url-----"+ url)                    this.showAlert(url, url)                } else {                    // app NOT opened from a url                    Logger.log("-----else url-----"+ url)                    this.showAlert(url, url)                }            });

In android side I am getting null in the module :

enter image description here

I have tried following solutions :

https://github.com/invertase/react-native-firebase/issues/1084

https://github.com/invertase/react-native-firebase/issues/1273

but nothing is working. Please help if you have done this type of things.

Thank you!

Issue using android DownloadManager with rn-fetch-blob (Status Code = 16)

$
0
0

I'm trying to use the library rn-fetch-blob to download a file from a response from my api. I want to use the android download manager so the user can access the file outside of the app.

if (granted === PermissionsAndroid.RESULTS.GRANTED) {   let DownloadDir = fs.dirs.DownloadDir //android only directory   let options = {       fileCache: true,       addAndroidDownloads: {          useDownloadManager: true,          notification: true,          path: DownloadDir +"/"+ name,          description: 'Downloading image.'          }        }        try {             config(options).fetch('POST', `${apiBaseUrl}/document/download/requirement`,             {                Authorization: "Bearer "+ this.props.userDetails.token,'Content-Type': "application/json"             },             data             ).then((res) => {                            console.log("TEST")                            console.log(res);                        }).catch((error) => {                            console.error('Error:', error);                        });                    }         catch (err) {           console.log(err)           }}

When this runs, the response block is being skipped and the line console.error('Error:', error); is returning the following error: 'Error:', { [Error: Download manager failed to download from https://myurl.com/api/document/download. Status Code = 16]

When I comment out the line useDownloadManager, I get a successful response from the api, so I know that's working. I believe a status code 16 refers to a problem with the android file path, but after hours of research I'm unable to determine what could be wrong in regard to that.

Using custom fonts in React native Webview

$
0
0

I'm using custom fonts in my entire React native application. I have linked them using react-native link command. They work everywhere except inside the Webview component of Android. It works properly in iOS Webview.

import React, { Component } from "react"import { View, StyleSheet, Text, WebView, ScrollView, Image } from "react-native"import HTMLView from "react-native-htmlview"export class PostDetailPage extends Component {  static navigationOptions = {    title: ({ state }) => state.params.post.title,    header: {      style: {        backgroundColor: '#FF9800',      },      titleStyle: {        color: 'white',        fontFamily: "Ekatra",        fontWeight: "normal"      },      tintColor: 'white'    }  }  constructor(props) {    super(props)  }  render() {    const post = this.props.navigation.state.params.post    const html = `<!DOCTYPE html><html><head><style type="text/css">          body {            font-family: Lohit-Gujarati;            font-size: 1.25rem;            color: black;            padding: 0px 10px 10px 10px;          }          p {            text-align: justify;          }</style></head><body>        ${post.content}</body></html>    `    return (<View style={{ flex: 1, overflow: "visible" }}><Image source={{ uri: post.featured_image }} style={{ height: 150 }} /><WebView          source={{html}}          style={{flex: 1}}          /></View>    )  }}

I have tried creating a font-face inside the webview css with url("file:///android_assets/fonts/Lohit-Gujarati"). It doesn't work. Importing google fonts css works. What is the right way to use local custom fonts in React native Android Webview?

How to keep react-native app as LTR (left to right)

$
0
0

I have created a simple chat application with react-native, it looks very nice when the device language is left to right, but on devices with RTL (right to left) Language it looks very bad and layout is not responsive.

So how Can I forcefully keep it as LTR(left to right) even on devices with RTL languages like persian, arabic, dari, pashto, urdo..


React Native android: An absolute positioned, touchable element outside of the bounds of its parent is not clickable

$
0
0

I have a TouchableOpacity inside of a view. The view is small (height: 60) and the TouchableOpacity lies outside the bounds of its parent (position: absolute, top: 70). When the child is inside of the parent, i.e. top: 30, it's clickable, but when it's outside, it's not. And only the regions inside of the parent view are clickable (touch events pass through the regions out of bounds).Does anyone know of a way to register TouchableOpacity clicks even when it's outside the bounds of its parent?

Note that this works on iOS. It seems to only be a bug on android.

<View style={{height: 60, width: '100%', zIndex: 1}}><TouchableOpacity onPress={() => console.log('pressed')} style={{position: 'absolute', zIndex: 2, backgroundColor: 'yellow', width: 100, height: 50, top: 70}} /></View>

React native, Unable to resolve module for static image

$
0
0

I'm using react-native 0.14.1

react-native run-android[3:10:56 PM] <START> find dependenciesUnable to resolve module image!ic_action_android_back_white3 from /Users/lion/Desktop/Developer/AwesomeProject/NewTrackActivity.jsUnable to resolve module image!ic_action_android_back_white3 from /Users/lion/Desktop/Developer/AwesomeProject/NewTrackActivity.js

If I force open my app in Genymotion it can't find my image.

Requiring unknown module image!ic_action_android_back_white3

I'm tried to move image to both ./android/app/src/main/res/drawable-xxx and ./assets/drawable-xxx but neither work.

Error:Execution failed for task ':app:packageDebug' for gradle version 3.5.2

$
0
0

Expected file collection to contain exactly one file, however, it contains more than one file.

  • 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.

  • Get more help at https://help.gradle.org

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.

How to detect Developer Options are enabled in react native?

$
0
0

For some security reasons i want to restrict the users who are enabled the developer options. How can i detect in react native?

Thanks in advance

Problem in build android device react native

$
0
0

i have a problem with a proyect of react native

all was ok .my gradle is 4.0 i dont know if it is the problem and i dont know how uodate it ,i was try but i wasnt able to do it

Configure project :app registerResGeneratingTask is deprecated, use registerGeneratedResFolders(FileCollection) registerResGeneratingTask is deprecated, use registerGeneratedResFolders(FileCollection)

Task :@react-native-community_async-storage:compileDebugJavaWithJavac

Task :@react-native-community_viewpager:compileDebugJavaWithJavac here start the problem

Task :app:generateDebugBuildConfig FAILED

Deprecated Gradle features were used in this build, making it incompatible with Gradle 6.0.Use '--warning-mode all' to show the individual deprecation warnings.See https://docs.gradle.org/5.5/userguide/command_line_interface.html#sec:command_line_warnings80 actionable tasks: 80 executedNote: C:\re-pro\node_modules@react-native-community\async-storage\android\src\main\java\com\reactnativecommunity\asyncstorage\AsyncStorageModule.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: C:re-pro\node_modules@react-native-community\viewpager\android\src\main\java\com\reactnativecommunity\viewpager\ReactViewPagerManager.java uses unchecked or unsafe operations.Note: Recompile with -Xlint:unchecked for details.

FAILURE: Build failed with an exception.

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

    java.io.IOException: Unable to delete directory C:re-pro\android\app\build\generated\source\buildConfig\debug\com\inspireui.

  • 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.

  • Get more help at https://help.gradle.org

BUILD FAILED in 9m 1s

error Failed to install the app. Make sure you have the Android development environment set up: https://facebook.github.io/react-native/docs/getting-started.html#android-development-environment. Run CLI with --verbose flag for more details.Error: Command failed: gradlew.bat app:installDebug -PreactNativeDevServerPort=8081Note: C:\re-pro\node_modules@react-native-community\async-storage\android\src\main\java\com\reactnativecommunity\asyncstorage\AsyncStorageModule.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: C:\re-pro\node_modules@react-native-community\viewpager\android\src\main\java\com\reactnativecommunity\viewpager\ReactViewPagerManager.java uses unchecked or unsafe operations.Note: Recompile with -Xlint:unchecked for details.

FAILURE: Build failed with an exception.

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

    java.io.IOException: Unable to delete directory C:\re-pro\android\app\build\generated\source\buildConfig\debug\com\inspireui.

  • 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.

  • Get more help at https://help.gradle.org

BUILD FAILED in 9m 1s

at checkExecSyncError (child_process.js:629:11)at execFileSync (child_process.js:647:13)at runOnAllDevices (C:\re-pro\node_modules\@react-native-community\cli-platform-android\build\commands\runAndroid\runOnAllDevices.js:94:39)at buildAndRun (C:\re-pro\node_modules\@react-native-community\cli-platform-android\build\commands\runAndroid\index.js:158:41)at then.result (C:\re-pro\node_modules\@react-native-community\cli-platform-android\build\commands\runAndroid\index.js:125:12)at process._tickCallback (internal/process/next_tick.js:68:7)

ReactNative unlink not working with react-native-push-notification?

$
0
0

Recently I added react-native-push-notification to my react native project and this error appears when project startup.

> react-native run-android

error React Native CLI uses autolinking for native dependencies, but the following modules are linked manually:   - react-native-push-notification (to unlink run: "react-native unlink react-native-push-notification")This is likely happening when upgrading React Native from below 0.60 to 0.60 or above. Going forward,you can unlink this dependency via "react-native unlink <dependency>" and it will be included in yourapp automatically. If a library isn't compatible with autolinking, disregard this message andnotify the library maintainers.

I used unlink command and it says successfully unlinked, but error doesn't disappear. I manually checked in those files too,

android>settings.gradle
android>app>build.gradle

Error in Task :app:mergeExtDexDebug FAILED for gradle version 3.5.2

$
0
0

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.0.1/userguide/command_line_interface.html#sec:command_line_warnings37 actionable tasks: 2 executed, 35 up-to-datejava.nio.file.NoSuchFileException: /Users/shashankparikh/Desktop/Bus-Mobile/nca/android/app/build/intermediates/external_file_lib_dex_archives/debug/out at sun.nio.fs.UnixException.translateToIOException(UnixException.java:86) at sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:102) at sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:107) at sun.nio.fs.UnixFileSystemProvider.newDirectoryStream(UnixFileSystemProvider.java:407) at java.nio.file.Files.newDirectoryStream(Files.java:457) at java.nio.file.Files.list(Files.java:3451) at com.android.build.gradle.internal.tasks.DexMergingParams.getAllDexFiles(DexMergingTask.kt:502) at com.android.build.gradle.internal.tasks.DexMergingTaskRunnable.run(DexMergingTask.kt:423) at com.android.build.gradle.internal.tasks.Workers$ActionFacade.run(Workers.kt:335) at org.gradle.workers.internal.AdapterWorkAction.execute(AdapterWorkAction.java:50) at org.gradle.workers.internal.DefaultWorkerServer.execute(DefaultWorkerServer.java:50) at org.gradle.workers.internal.NoIsolationWorkerFactory$1$1$1.create(NoIsolationWorkerFactory.java:65) at org.gradle.workers.internal.NoIsolationWorkerFactory$1$1$1.create(NoIsolationWorkerFactory.java:61) at org.gradle.internal.classloader.ClassLoaderUtils.executeInClassloader(ClassLoaderUtils.java:98) at org.gradle.workers.internal.NoIsolationWorkerFactory$1$1.execute(NoIsolationWorkerFactory.java:61) at org.gradle.workers.internal.AbstractWorker$1.call(AbstractWorker.java:44) at org.gradle.workers.internal.AbstractWorker$1.call(AbstractWorker.java:41) at org.gradle.internal.operations.DefaultBuildOperationExecutor$CallableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:416) at org.gradle.internal.operations.DefaultBuildOperationExecutor$CallableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:406) at org.gradle.internal.operations.DefaultBuildOperationExecutor$1.execute(DefaultBuildOperationExecutor.java:165) at org.gradle.internal.operations.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:250) at org.gradle.internal.operations.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:158) at org.gradle.internal.operations.DefaultBuildOperationExecutor.call(DefaultBuildOperationExecutor.java:102) at org.gradle.internal.operations.DelegatingBuildOperationExecutor.call(DelegatingBuildOperationExecutor.java:36) at org.gradle.workers.internal.AbstractWorker.executeWrappedInBuildOperation(AbstractWorker.java:41) at org.gradle.workers.internal.NoIsolationWorkerFactory$1.execute(NoIsolationWorkerFactory.java:53) at org.gradle.workers.internal.DefaultWorkerExecutor$3.call(DefaultWorkerExecutor.java:217) at org.gradle.workers.internal.DefaultWorkerExecutor$3.call(DefaultWorkerExecutor.java:212) at java.util.concurrent.FutureTask.run(FutureTask.java:266) at org.gradle.internal.work.DefaultConditionalExecutionQueue$ExecutionRunner.runExecution(DefaultConditionalExecutionQueue.java:215) at org.gradle.internal.work.DefaultConditionalExecutionQueue$ExecutionRunner.runBatch(DefaultConditionalExecutionQueue.java:164) at org.gradle.internal.work.DefaultConditionalExecutionQueue$ExecutionRunner.run(DefaultConditionalExecutionQueue.java:131) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) at java.util.concurrent.FutureTask.run(FutureTask.java:266) at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:64) at org.gradle.internal.concurrent.ManagedExecutorImpl$1.run(ManagedExecutorImpl.java:48) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) at org.gradle.internal.concurrent.ThreadFactoryImpl$ManagedThreadRunnable.run(ThreadFactoryImpl.java:56) at java.lang.Thread.run(Thread.java:748)

FAILURE: Build failed with an exception.

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

    A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$ActionFacade java.nio.file.NoSuchFileException: /Users/shashankparikh/Desktop/Bus-Mobile/nca/android/app/build/intermediates/external_file_lib_dex_archives/debug/out

  • Try:Run with --stack trace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

  • Get more help at https://help.gradle.org

BUILD FAILED in 7s

error Failed to install the app. Make sure you have the Android development environment set up: https://reactnative.dev/docs/getting-started.html#android-development-environment. Run CLI with --verbose flag for more details.Error: Command failed: ./gradlew app:installDebug -PreactNativeDevServerPort=8081java.nio.file.NoSuchFileException: /Users/shashankparikh/Desktop/Bus-Mobile/nca/android/app/build/intermediates/external_file_lib_dex_archives/debug/out at sun.nio.fs.UnixException.translateToIOException(UnixException.java:86) at sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:102) at sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:107) at sun.nio.fs.UnixFileSystemProvider.newDirectoryStream(UnixFileSystemProvider.java:407) at java.nio.file.Files.newDirectoryStream(Files.java:457) at java.nio.file.Files.list(Files.java:3451) at com.android.build.gradle.internal.tasks.DexMergingParams.getAllDexFiles(DexMergingTask.kt:502) at com.android.build.gradle.internal.tasks.DexMergingTaskRunnable.run(DexMergingTask.kt:423) at com.android.build.gradle.internal.tasks.Workers$ActionFacade.run(Workers.kt:335) at org.gradle.workers.internal.AdapterWorkAction.execute(AdapterWorkAction.java:50) at org.gradle.workers.internal.DefaultWorkerServer.execute(DefaultWorkerServer.java:50) at org.gradle.workers.internal.NoIsolationWorkerFactory$1$1$1.create(NoIsolationWorkerFactory.java:65) at org.gradle.workers.internal.NoIsolationWorkerFactory$1$1$1.create(NoIsolationWorkerFactory.java:61) at org.gradle.internal.classloader.ClassLoaderUtils.executeInClassloader(ClassLoaderUtils.java:98) at org.gradle.workers.internal.NoIsolationWorkerFactory$1$1.execute(NoIsolationWorkerFactory.java:61) at org.gradle.workers.internal.AbstractWorker$1.call(AbstractWorker.java:44) at org.gradle.workers.internal.AbstractWorker$1.call(AbstractWorker.java:41) at org.gradle.internal.operations.DefaultBuildOperationExecutor$CallableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:416) at org.gradle.internal.operations.DefaultBuildOperationExecutor$CallableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:406) at org.gradle.internal.operations.DefaultBuildOperationExecutor$1.execute(DefaultBuildOperationExecutor.java:165) at org.gradle.internal.operations.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:250) at org.gradle.internal.operations.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:158) at org.gradle.internal.operations.DefaultBuildOperationExecutor.call(DefaultBuildOperationExecutor.java:102) at org.gradle.internal.operations.DelegatingBuildOperationExecutor.call(DelegatingBuildOperationExecutor.java:36) at org.gradle.workers.internal.AbstractWorker.executeWrappedInBuildOperation(AbstractWorker.java:41) at org.gradle.workers.internal.NoIsolationWorkerFactory$1.execute(NoIsolationWorkerFactory.java:53) at org.gradle.workers.internal.DefaultWorkerExecutor$3.call(DefaultWorkerExecutor.java:217) at org.gradle.workers.internal.DefaultWorkerExecutor$3.call(DefaultWorkerExecutor.java:212) at java.util.concurrent.FutureTask.run(FutureTask.java:266) at org.gradle.internal.work.DefaultConditionalExecutionQueue$ExecutionRunner.runExecution(DefaultConditionalExecutionQueue.java:215) at org.gradle.internal.work.DefaultConditionalExecutionQueue$ExecutionRunner.runBatch(DefaultConditionalExecutionQueue.java:164) at org.gradle.internal.work.DefaultConditionalExecutionQueue$ExecutionRunner.run(DefaultConditionalExecutionQueue.java:131) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) at java.util.concurrent.FutureTask.run(FutureTask.java:266) at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:64) at org.gradle.internal.concurrent.ManagedExecutorImpl$1.run(ManagedExecutorImpl.java:48) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) at org.gradle.internal.concurrent.ThreadFactoryImpl$ManagedThreadRunnable.run(ThreadFactoryImpl.java:56) at java.lang.Thread.run(Thread.java:748)

FAILURE: Build failed with an exception.

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

    A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$ActionFacade java.nio.file.NoSuchFileException: /Users/shashankparikh/Desktop/Bus-Mobile/nca/android/app/build/intermediates/external_file_lib_dex_archives/debug/out

  • Try:Run with --stack trace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

  • Get more help at https://help.gradle.org

BUILD FAILED in 7s

at makeError (/Users/shashankparikh/Desktop/Bus-Mobile/nca/node_modules/execa/index.js:174:9)at Promise.all.then.arr (/Users/shashankparikh/Desktop/Bus-Mobile/nca/node_modules/execa/index.js:278:16)at process.internalTickCallback (internal/process/next_tick.js:77:7)

Cant run React Native Project on Emulator anymore

$
0
0

for some reason my App wont start up on my AS Emulator. Yesterday everything was working great but today it doenst work - might be because I moved npm and npm-cache folder but they are set correctly with npm config.

Metro server starts OK and if I just selected the app it would load it up but now it insta crashes..

If I try to run npm android I am getting the error below:

    PS C:\Dev\Programmierung\FitnessApp\FitnessApp> npm run android> FitnessApp@0.0.1 android C:\Dev\Programmierung\FitnessApp\FitnessApp> react-native run-androidinfo Running jetifier to migrate libraries to AndroidX. You can disable it using "--no-jetifier" flag.Jetifier found 1158 file(s) to forward-jetify. Using 6 workers...info Starting JS server...Der Befehl "adb" ist entweder falsch geschrieben oderkonnte nicht gefunden werden.info Launching emulator...error Failed to launch emulator. Reason: No emulators found as an output of `emulator -list-avds`.warn Please launch an emulator manually or connect a device. Otherwise app may fail to launch.info Installing the app...> Task :app:transformClassesWithDexBuilderForDebug FAILEDDeprecated 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.0.1/userguide/command_line_interface.html#sec:command_line_warnings147 actionable tasks: 3 executed, 144 up-to-dateFAILURE: Build failed with an exception.* What went wrong:Execution failed for task ':app:transformClassesWithDexBuilderForDebug'.> Unable to delete directory 'C:\Dev\Programmierung\FitnessApp\FitnessApp\android\app\build\intermediates\transforms\dexBuilder\debug\0\androidx\appcompat' after 10 attempts* 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.* Get more help at https://help.gradle.orgBUILD FAILED in 17serror Failed to install the app. Make sure you have the Android development environment set up: https://reactnative.dev/docs/getting-started.html#android-development-environment. Run CLI with --verbose flag for more details.Error: Command failed: gradlew.bat app:installDebug -PreactNativeDevServerPort=8081FAILURE: Build failed with an exception.* What went wrong:Execution failed for task ':app:transformClassesWithDexBuilderForDebug'.> Unable to delete directory 'C:\Dev\Programmierung\FitnessApp\FitnessApp\android\app\build\intermediates\transforms\dexBuilder\debug\0\androidx\appcompat' after 10 attempts* 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.* Get more help at https://help.gradle.orgBUILD FAILED in 17s    at makeError (C:\Dev\Programmierung\FitnessApp\FitnessApp\node_modules\execa\index.js:174:9)    at C:\Dev\Programmierung\FitnessApp\FitnessApp\node_modules\execa\index.js:278:16    at processTicksAndRejections (internal/process/task_queues.js:94:5)    at async runOnAllDevices (C:\Dev\Programmierung\FitnessApp\FitnessApp\node_modules\@react-native-community\cli-platform-android\build\commands\runAndroid\runOnAllDevices.js:94:5)    at async Command.handleAction (C:\Dev\Programmierung\FitnessApp\FitnessApp\node_modules\react-native\node_modules\@react-native-community\cli\build\index.js:186:9)npm ERR! code ELIFECYCLEnpm ERR! errno 1npm ERR! FitnessApp@0.0.1 android: `react-native run-android`npm ERR! Exit status 1npm ERR!npm ERR! Failed at the FitnessApp@0.0.1 android script.npm ERR! This is probably not a problem with npm. There is likely additional logging output above.npm ERR! A complete log of this run can be found in:npm ERR!     C:\Dev\npm\npm-cache\_logs\2020-04-24T08_01_58_811Z-debug.log

react-native-webview crashes application when invoked

$
0
0

I am using react-native-webview library to load webpage, it works fine in debuging, but when I create release build. And click on the tab to load webview , application crashes. following is the error. I have attached error trace as well in the end.

I am using react-native: "0.62.0"react-native-webview : "^9.0.2",

sve

this is the trace when I click on the button to load webview screen.

> 2020-04-10 11:39:44.812 2584-2646/com.trackplayer E/ReactNativeJS:> Error: crypto.getRandomValues() not supported. See> https://github.com/uuidjs/uuid#getrandomvalues-not-supported>     >     This error is located at:>         in n>         in RCTView>         in y>         in Unknown>         in Unknown>         in Unknown>         in Unknown>         in RCTView>         in S>         in RCTView>         in RCTView>         in E>         in RCTView>         in c>         in RCTView>         in Unknown>         in v>         in Unknown>         in w>         in Unknown>         in Unknown>         in Unknown>         in Unknown>         in RCTView>         in RCTView>         in RCTView>         in RCTView>         in k>         in ForwardRef>         in PanGestureHandler>         in RCTView>         in k>         in ForwardRef>         in RCTView>         in D>         in Unknown>         in RCTView>         in C>         in RCTView>         in H>         in S>         in h>         in RNCSafeAreaView>         in Unknown>         in Unknown>         in GestureHandlerRootView>         in Unknown>         in b>         in Unknown>         in O>         in Unknown>         in ForwardRef>         in Unknown>         in ForwardRef>         in S>         in RCTView>         in RCTView>         in E 2020-04-10 11:39:44.818 2584-2646/com.trackplayer E/ReactNativeJS: Error: crypto.getRandomValues() not supported. See> https://github.com/uuidjs/uuid#getrandomvalues-not-supported>     >     This error is located at:>         in n>         in RCTView>         in y>         in Unknown>         in Unknown>         in Unknown>         in Unknown>         in RCTView>         in S>         in RCTView>         in RCTView>         in E>         in RCTView>         in c>         in RCTView>         in Unknown>         in v>         in Unknown>         in w>         in Unknown>         in Unknown>         in Unknown>         in Unknown>         in RCTView>         in RCTView>         in RCTView>         in RCTView>         in k>         in ForwardRef>         in PanGestureHandler>         in RCTView>         in k>         in ForwardRef>         in RCTView>         in D>         in Unknown>         in RCTView>         in C>         in RCTView>         in H>         in S>         in h>         in RNCSafeAreaView>         in Unknown>         in Unknown>         in GestureHandlerRootView>         in Unknown>         in b>         in Unknown>         in O>         in Unknown>         in ForwardRef>         in Unknown>         in ForwardRef>         in S>         in RCTView>         in RCTView>         in E 2020-04-10 11:39:44.822 2584-2647/com.trackplayer E/unknown:ReactNative: Error: crypto.getRandomValues() not supported.> See https://github.com/uuidjs/uuid#getrandomvalues-not-supported>     >     This error is located at:>         in n>         in RCTView>         in y>         in Unknown>         in Unknown>         in Unknown>         in Unknown>         in RCTView>         in S>         in RCTView>         in RCTView>         in E>         in RCTView>         in c>         in RCTView>         in Unknown>         in v>         in Unknown>         in w>         in Unknown>         in Unknown>         in Unknown>         in Unknown>         in RCTView>         in RCTView>         in RCTView>         in RCTView>         in k>         in ForwardRef>         in PanGestureHandler>         in RCTView>         in k>         in ForwardRef>         in RCTView>         in D>         in Unknown>         in RCTView>         in C>         in RCTView>         in H>         in S>         in h>         in RNCSafeAreaView>         in Unknown>         in Unknown>         in GestureHandlerRootView>         in Unknown>         in b>         in Unknown>         in O>         in Unknown>         in ForwardRef>         in Unknown>         in ForwardRef>         in S>         in RCTView>         in RCTView>         in E, stack:>     default@717:132>     f@722:329>     n@714:2621>     Bn@92:31529>     ui@92:49357>     ja@92:72034>     Oa@92:71959>     Ia@92:69253>     Ia@-1>     <unknown>@92:25480>     unstable_runWithPriority@183:3503>     dn@92:25427>     fn@92:25362>     Pe@92:90879>     Re@92:13478>     Ie@92:13664>     receiveTouches@92:14448>     value@27:3544>     <unknown>@27:840>     value@27:2798>     value@27:812>     value@-1 2020-04-10 11:39:44.831 2584-2647/com.trackplayer E/AndroidRuntime: FATAL EXCEPTION: mqt_native_modules>     Process: com.trackplayer, PID: 2584>     com.facebook.react.common.JavascriptException: Error: crypto.getRandomValues() not supported. See> https://github.com/uuidjs/uuid#getrandomvalues-not-supported>     >     This error is located at:>         in n>         in RCTView>         in y>         in Unknown>         in Unknown>         in Unknown>         in Unknown>         in RCTView>         in S>         in RCTView>         in RCTView>         in E>         in RCTView>         in c>         in RCTView>         in Unknown>         in v>         in Unknown>         in w>         in Unknown>         in Unknown>         in Unknown>         in Unknown>         in RCTView>         in RCTView>         in RCTView>         in RCTView>         in k>         in ForwardRef>         in PanGestureHandler>         in RCTView>         in k>         in ForwardRef>         in RCTView>         in D>         in Unknown>         in RCTView>         in C>         in RCTView>         in H>         in S>         in h>         in RNCSafeAreaView>         in Unknown>         in Unknown>         in GestureHandlerRootView>         in Unknown>         in b>         in Unknown>         in O>         in Unknown>         in ForwardRef>         in Unknown>         in ForwardRef>         in S>         in RCTView>         in RCTView>         in E, stack:>     default@717:132>     f@722:329>     n@714:2621>     Bn@92:31529>     ui@92:49357>     ja@92:72034>     Oa@92:71959>     Ia@92:69253>     Ia@-1>     <unknown>@92:25480>     unstable_runWithPriority@183:3503>     dn@92:25427>     fn@92:25362>     Pe@92:90879>     Re@92:13478>     Ie@92:13664>     receiveTouches@92:14448>     value@27:3544>     <unknown>@27:840>     value@27:2798>     value@27:812>     value@-1>     >         at com.facebook.react.modules.core.ExceptionsManagerModule.reportException(ExceptionsManagerModule.java:79)>         at java.lang.reflect.Method.invoke(Native Method)>         at com.facebook.react.bridge.JavaMethodWrapper.invoke(JavaMethodWrapper.java:372)>         at com.facebook.react.bridge.JavaModuleWrapper.invoke(JavaModuleWrapper.java:151)>         at com.facebook.react.bridge.queue.NativeRunnable.run(Native Method)>         at android.os.Handler.handleCallback(Handler.java:883)>         at android.os.Handler.dispatchMessage(Handler.java:100)>         at com.facebook.react.bridge.queue.MessageQueueThreadHandler.dispatchMessage(MessageQueueThreadHandler.java:27)>         at android.os.Looper.loop(Looper.java:214)>         at com.facebook.react.bridge.queue.MessageQueueThreadImpl$4.run(MessageQueueThreadImpl.java:226)>         at java.lang.Thread.run(Thread.java:919) 2020-04-10 11:39:44.850 2584-2647/com.trackplayer I/Process: Sending signal. PID:> 2584 SIG: 9

react-native How to judge if it is a directory?

$
0
0
    import RNFS from 'react-native-fs';    const dirs = await RNFS.readdir(RNFS.ExternalDirectoryPath +'/data');    for (let i = 0; i < dirs.length; i++) {      // How to judge if it is a directory ?      // fs.lstatSync(dirs[i]).isDirectory() // Similar to this effect    }

How to judge if it is a directory ?

Similar to this effect:fs.lstatSync(dirs[i]).isDirectory()

How to implement RTL in iOS using EXPO/react-native

$
0
0

I have added two localization file (arabic and english) in my react native application file names like ar.json and en.json.

My en.json file looks like

"fieldNames": {"enterEmail" : "Enter the email address"  },

My ar.json file looks like

"fieldNames": {"enterEmail" : "أدخلعنوانالبريدالإلكتروني"  },

One of the file I used like the following

<Text>{string('fieldNames.enterEmail')}</Text>

Localization is working fine with both languages.

But when I choose arabic its not aligned to right side in iOS.

In my android device its working properly.This issue appear only in iOS .

Could you please help me to resolve the issue

react native maps android studio build failure

$
0
0
  • By following below steps I am able to get the react native maps working in ios simulator,
  • but for android I am getting the below issue
Could not determine the dependencies of task ':app:mergeProdReleaseAssets'.> Could not resolve all task dependencies for configuration ':app:prodReleaseRuntimeClasspath'.> Could not find com.google.android.gms:play-services-base:19.1.0.     Searched in the following locations:       - file:/Users/reyu6723huyjh/.m2/repository/com/google/android/gms/play-services-base/19.1.0/play-services-base-19.1.0.pom       - file:/Users/reyu6723huyjh/.m2/repository/com/google/android/gms/play-services-base/19.1.0/play-services-base-19.1.0.jar       - file:/Users/reyu6723huyjh/Desktop/codebase/star-3/frontendapp/sports/node_modules/react-native/android/com/google/android/gms/play-services-base/19.1.0/play-services-base-19.1.0.pom       - file:/Users/reyu6723huyjh/Desktop/codebase/star-3/frontendapp/sports/node_modules/react-native/android/com/google/android/gms/play-services-base/19.1.0/play-services-base-19.1.0.jar       - file:/Users/reyu6723huyjh/Desktop/codebase/star-3/frontendapp/sports/node_modules/jsc-android/dist/com/google/android/gms/play-services-base/19.1.0/play-services-base-19.1.0.pom       - file:/Users/reyu6723huyjh/Desktop/codebase/star-3/frontendapp/sports/node_modules/jsc-android/dist/com/google/android/gms/play-services-base/19.1.0/play-services-base-19.1.0.jar       - dl.google.com/dl/android/maven2/com/google/android/gms/play-services-base/19.1.0/play-services-base-19.1.0.pom       - dl.google.com/dl/android/maven2/com/google/android/gms/play-services-base/19.1.0/play-services-base-19.1.0.jar       - jcenter.bintray.com/com/google/android/gms/play-services-base/19.1.0/play-services-base-19.1.0.pom       - ://jcenter.bintray.com/com/google/android/gms/play-services-base/19.1.0/play-services-base-19.1.0.jar       - ://jitpack.io/com/google/android/gms/play-services-base/19.1.0/play-services-base-19.1.0.pom       - ://jitpack.io/com/google/android/gms/play-services-base/19.1.0/play-services-base-19.1.0.jar     Required by:         project :app > project :react-native-maps> Could not find com.google.android.gms:play-services-maps:19.1.0.     Searched in the following locations:       - file:/Users/reyu6723huyjh/.m2/repository/com/google/android/gms/play-services-maps/19.1.0/play-services-maps-19.1.0.pom       - file:/Users/reyu6723huyjh/.m2/repository/com/google/android/gms/play-services-maps/19.1.0/play-services-maps-19.1.0.jar       - file:/Users/reyu6723huyjh/Desktop/codebase/star-3/frontendapp/sports/node_modules/react-native/android/com/google/android/gms/play-services-maps/19.1.0/play-services-maps-19.1.0.pom       - file:/Users/reyu6723huyjh/Desktop/codebase/star-3/frontendapp/sports/node_modules/react-native/android/com/google/android/gms/play-services-maps/19.1.0/play-services-maps-19.1.0.jar       - file:/Users/reyu6723huyjh/Desktop/codebase/star-3/frontendapp/sports/node_modules/jsc-android/dist/com/google/android/gms/play-services-maps/19.1.0/play-services-maps-19.1.0.pom       - file:/Users/reyu6723huyjh/Desktop/codebase/star-3/frontendapp/sports/node_modules/jsc-android/dist/com/google/android/gms/play-services-maps/19.1.0/play-services-maps-19.1.0.jar       - //dl.google.com/dl/android/maven2/com/google/android/gms/play-services-maps/19.1.0/play-services-maps-19.1.0.pom       - ://dl.google.com/dl/android/maven2/com/google/android/gms/play-services-maps/19.1.0/play-services-maps-19.1.0.jar       - ://jcenter.bintray.com/com/google/android/gms/play-services-maps/19.1.0/play-services-maps-19.1.0.pom       - ://jcenter.bintray.com/com/google/android/gms/play-services-maps/19.1.0/play-services-maps-19.1.0.jar       - ://jitpack.io/com/google/android/gms/play-services-maps/19.1.0/play-services-maps-19.1.0.pom       - ://jitpack.io/com/google/android/gms/play-services-maps/19.1.0/play-services-maps-19.1.0.jar     Required by:         project :app > project :react-native-maps> Could not find com.google.android.gms:play-services-base:19.1.0.     Searched in the following locations:       - file:/Users/reyu6723huyjh/.m2/repository/com/google/android/gms/play-services-base/19.1.0/play-services-base-19.1.0.pom       - file:/Users/reyu6723huyjh/.m2/repository/com/google/android/gms/play-services-base/19.1.0/play-services-base-19.1.0.jar       - file:/Users/reyu6723huyjh/Desktop/codebase/star-3/frontendapp/sports/node_modules/react-native/android/com/google/android/gms/play-services-base/19.1.0/play-services-base-19.1.0.pom       - file:/Users/reyu6723huyjh/Desktop/codebase/star-3/frontendapp/sports/node_modules/react-native/android/com/google/android/gms/play-services-base/19.1.0/play-services-base-19.1.0.jar       - file:/Users/reyu6723huyjh/Desktop/codebase/star-3/frontendapp/sports/node_modules/jsc-android/dist/com/google/android/gms/play-services-base/19.1.0/play-services-base-19.1.0.pom       - file:/Users/reyu6723huyjh/Desktop/codebase/star-3/frontendapp/sports/node_modules/jsc-android/dist/com/google/android/gms/play-services-base/19.1.0/play-services-base-19.1.0.jar       - dl.google.com/dl/android/maven2/com/google/android/gms/play-services-base/19.1.0/play-services-base-19.1.0.pom       - dl.google.com/dl/android/maven2/com/google/android/gms/play-services-base/19.1.0/play-services-base-19.1.0.jar       - jcenter.bintray.com/com/google/android/gms/play-services-base/19.1.0/play-services-base-19.1.0.pom       - jcenter.bintray.com/com/google/android/gms/play-services-base/19.1.0/play-services-base-19.1.0.jar       - jitpack.io/com/google/android/gms/play-services-base/19.1.0/play-services-base-19.1.0.pom       - jitpack.io/com/google/android/gms/play-services-base/19.1.0/play-services-base-19.1.0.jar     Required by:         project :app > project :react-native-geolocation-service > com.google.android.gms:play-services-location:17.0.0
  • when I try to sync with gradle I am getting the below issue

    ERROR: Failed to resolve: com.google.android.gms:play-services-base:19.1.0

Add Google Maven repository and sync projectShow in Project Structure dialogAffected Modules: react-native-maps

-so I googled and found the the below link and in the app build.gradle I used the below configuration, but still same issue.- i even changed react-native-maps node modules build.gradle but still no luck.- can you tell me how to fix it.providing my androidmanifest.xml, build.gradle which is present in app and android folder

build.gradle which is present in app

apply plugin: "com.android.application"import com.android.build.OutputFileproject.ext.react = [    entryFile: "index.js",    enableHermes: false,  // clean and rebuild if changing]project.ext.envConfigFiles = [        dev : ".env",        qa  : ".env.qa",        uat : ".env.uat",        prod: ".env.prod",]apply from: "../../node_modules/react-native/react.gradle"/** * Set this to true to create two separate APKs instead of one: *   - An APK that only works on ARM devices *   - An APK that only works on x86 devices * The advantage is the size of the APK is reduced by about 4MB. * Upload all the APKs to the Play Store and people will download * the correct one based on the CPU architecture of their device. */def enableSeparateBuildPerCPUArchitecture = false/** * Run Proguard to shrink the Java bytecode in release builds. */def enableProguardInReleaseBuilds = true/** * The preferred build flavor of JavaScriptCore. * * For example, to use the international variant, you can use: * `def jscFlavor = 'org.webkit:android-jsc-intl:+'` * * The international variant includes ICU i18n library and necessary data * allowing to use e.g. `Date.toLocaleString` and `String.localeCompare` that * give correct results when using with locales other than en-US.  Note that * this variant is about 6MiB larger per architecture than default. */def jscFlavor = 'org.webkit:android-jsc:+'/** * Whether to enable the Hermes VM. * * This should be set on project.ext.react and mirrored here.  If it is not set * on project.ext.react, JavaScript will not be compiled to Hermes Bytecode * and the benefits of using Hermes will therefore be sharply reduced. */def enableHermes = project.ext.react.get("enableHermes", false);android {    compileSdkVersion rootProject.ext.compileSdkVersion    compileOptions {        sourceCompatibility JavaVersion.VERSION_1_8        targetCompatibility JavaVersion.VERSION_1_8    }    defaultConfig {        applicationId "com.seven.eleven.sports"        resValue "string", "build_config_package", "com.seven.eleven.sports"        minSdkVersion rootProject.ext.minSdkVersion        targetSdkVersion rootProject.ext.targetSdkVersion        versionCode 1        versionName "1.0"        multiDexEnabled true    }    flavorDimensions "default"    productFlavors {        dev {            // Pre-compile run ENVFILE=.env.dev            dimension "default"            applicationIdSuffix ".dev"            versionNameSuffix "-dev"            resValue "string", "app_name", "7-Track_DEV"        }        qa {            // Pre-compile run ENVFILE=.env.dev            dimension "default"            applicationIdSuffix ".qa"            versionNameSuffix "-qa"            resValue "string", "app_name", "7-Track_QA"        }        uat {            // Pre-compile run ENVFILE=.env.dev            dimension "default"            applicationIdSuffix ".uat"            versionNameSuffix "-uat"            resValue "string", "app_name", "7-Track_UAT"        }        prod {            // Pre-compile run ENVFILE=.env.prod            dimension "default"            versionNameSuffix ""            resValue "string", "app_name", "7-Track"        }    }    splits {        abi {            reset()            enable enableSeparateBuildPerCPUArchitecture            universalApk false  // If true, also generate a universal APK            include "armeabi-v7a", "x86", "arm64-v8a", "x86_64"        }    }    signingConfigs {        debug {            storeFile file('debug.keystore')            storePassword 'android'            keyAlias 'androiddebugkey'            keyPassword 'android'        }    }    buildTypes {         debug {            signingConfig signingConfigs.debug             applicationIdSuffix ".dev"             resValue "string", "app_name", "7-Track_DEV"        }        release {            // Caution! In production, you need to generate your own keystore file.            // see facebook.github.io/react-native/docs/signed-apk-android.            signingConfig signingConfigs.debug            shrinkResources enableProguardInReleaseBuilds            zipAlignEnabled enableProguardInReleaseBuilds            minifyEnabled enableProguardInReleaseBuilds            proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro"            minifyEnabled true        }    }    // applicationVariants are e.g. debug, release    applicationVariants.all { variant ->        variant.outputs.each { output ->            // For each separate APK per architecture, set a unique version code as described here:            // //developer.android.com/studio/build/configure-apk-splits.html            def versionCodes = ["armeabi-v7a": 1, "x86": 2, "arm64-v8a": 3, "x86_64": 4]            def abi = output.getFilter(OutputFile.ABI)            if (abi != null) {  // null for the universal-debug, universal-release variants                output.versionCodeOverride =                        versionCodes.get(abi) * 1048576 + defaultConfig.versionCode            }        }    }}dependencies {//     implementation(project(':react-native-maps')){//        exclude group: 'com.google.android.gms', module: 'play-services-base'//        exclude group: 'com.google.android.gms', module: 'play-services-maps'//    }//    implementation 'com.google.android.gms:play-services-base:10.0.1'//    implementation 'com.google.android.gms:play-services-maps:10.0.1'    implementation fileTree(dir: "libs", include: ["*.jar"])    implementation "com.facebook.react:react-native:+"  // From node_modules    implementation 'androidx.appcompat:appcompat:1.1.0-rc01'    implementation 'androidx.swiperefreshlayout:swiperefreshlayout:1.1.0-alpha02'    if (enableHermes) {        def hermesPath = "../../node_modules/hermes-engine/android/";        debugImplementation files(hermesPath +"hermes-debug.aar")        releaseImplementation files(hermesPath +"hermes-release.aar")    } else {        implementation jscFlavor    }}// Run this once to be able to run the application with BUCK// puts all compile dependencies into folder libs for BUCK to usetask copyDownloadableDepsToLibs(type: Copy) {    from configurations.compile    into 'libs'}apply from: file("../../node_modules/@react-native-community/cli-platform-android/native_modules.gradle");apply from: file("../../node_modules/react-native-vector-icons/fonts.gradle");applyNativeModulesAppBuildGradle(project)apply from: project(':react-native-config').projectDir.getPath() +"/dotenv.gradle"

build.gradle which is present in android

// Top-level build file where you can add configuration options common to all sub-projects/modules.buildscript {    ext {        buildToolsVersion = "28.0.3"        minSdkVersion = 16        compileSdkVersion = 28        targetSdkVersion = 28                playServicesVersion = "19.1.0"    }    repositories {        google()        jcenter()    }    dependencies {        classpath('com.android.tools.build:gradle:3.5.3')        // NOTE: Do not place your application dependencies here; they belong        // in the individual module build.gradle files    }}allprojects {    repositories {        mavenLocal()        maven {            // All of React Native (JS, Obj-C sources, Android binaries) is installed from npm            url("$rootDir/../node_modules/react-native/android")        }        maven {            // Android JSC is installed from npm            url("$rootDir/../node_modules/jsc-android/dist")        }        google()        jcenter()       maven { url 'jitpack.io' }        //  maven {        //     url 'maven.google.com/'        //     name 'Google'        // }    }}**react-native-maps build.gradle files**
apply plugin: 'com.android.library'if (project.hasProperty('POM_ARTIFACT_ID')) {  apply from: 'gradle-maven-push.gradle'}def safeExtGet(prop, fallback) {  rootProject.ext.has(prop) ? rootProject.ext.get(prop) : fallback}android {  compileSdkVersion safeExtGet('compileSdkVersion', 28)  defaultConfig {    minSdkVersion safeExtGet('minSdkVersion', 16)    targetSdkVersion safeExtGet('targetSdkVersion', 27)  }}dependencies {  def supportLibVersion = safeExtGet('supportLibVersion', '28.0.0')  def supportLibMajorVersion = supportLibVersion.split('\\.')[0] as int  def appCompatLibName =  (supportLibMajorVersion < 20) ? "androidx.appcompat:appcompat" : "com.android.support:appcompat-v7"  implementation "$appCompatLibName:$supportLibVersion"  implementation('com.facebook.react:react-native:+') {    exclude group: 'com.android.support'  }  implementation "com.google.android.gms:play-services-base:${safeExtGet('playServicesVersion', '17.0.0')}"  implementation "com.google.android.gms:play-services-maps:${safeExtGet('playServicesVersion', '17.0.0')}"  implementation "com.google.android.gms:play-services-location:17.0.0"  implementation 'com.google.maps.android:android-maps-utils:0.5'}

package.json

{"name": "sports","version": "0.0.1","private": true,"scripts": {"ios": "react-native run-ios","start": "react-native start","android-clean": "echo 'CLEANING ...'&& cd android/ && ./gradlew clean && cd ..","android-build-all": "build_scripts/start_build_android.sh","android": "react-native run-android --variant=devDebug --appIdSuffix=dev","android-prod": "react-native run-android --variant=prodRelease","android-qa": "react-native run-android --variant=qaRelease --appIdSuffix=qa","android-uat": "react-native run-android --variant=uatRelease --appIdSuffix=uat","ios-dev": "react-native run-ios --scheme sports","ios-qa": "react-native run-ios --scheme sportsQA","ios-uat": "react-native run-ios --scheme sportsUAT ","ios-prod": "react-native run-ios --scheme sportsPROD","test": "jest","lint": "eslint . --ext .js,.jsx,.ts,.tsx"    },"dependencies": {"@react-native-community/async-storage": "^1.8.1","@react-native-community/masked-view": "^0.1.6","@react-navigation/bottom-tabs": "^5.0.7","@react-navigation/drawer": "^5.0.7","@react-navigation/native": "^5.0.7","@react-navigation/stack": "^5.0.8","axios": "^0.19.2","axios-retry": "^3.1.2","haversine": "^1.1.1","immutable": "^4.0.0-rc.12","jwt-decode": "^2.2.0","moment": "^2.24.0","react": "16.9.0","react-devtools": "^4.4.0","react-jwt-store": "^1.7.0","react-native": "0.61.5","react-native-check-box": "^2.1.7","react-native-config": "^0.12.0","react-native-elements": "^1.2.7","react-native-geolocation-service": "^4.0.0","react-native-gesture-handler": "^1.6.1","react-native-keyboard-aware-scroll-view": "^0.9.1","react-native-lazyload": "^1.1.0","react-native-maps": "0.27.1","react-native-orientation-loading-overlay": "^0.1.6","react-native-picker-select": "^6.6.0","react-native-ratings": "^6.5.0","react-native-reanimated": "^1.7.0","react-native-safe-area-context": "^0.7.3","react-native-screens": "^2.2.0","react-native-scrolling-menu": "^0.1.1","react-native-sendgrid": "^1.0.1","react-native-sha256": "^1.3.6","react-native-splash-screen": "^3.2.0","react-native-table-component": "^1.2.1","react-native-vector-icons": "^6.6.0","react-native-webview-leaflet": "^5.0.2","react-navigation": "^4.2.1","react-navigation-stack": "^1.10.3","react-redux": "^7.2.0","react-swipeable-views-native": "^0.13.2","react-use": "^13.27.1","redux": "^4.0.5","redux-devtools-extension": "^2.13.8","redux-persist": "^6.0.0","redux-persist-transform-immutable": "^5.0.0","redux-saga": "^1.1.3","redux-saga-jwt": "^1.0.4-beta.0","redux-thunk": "^2.3.0","toggle-switch-react-native": "^2.1.0"    },"devDependencies": {"@babel/core": "^7.9.0","@babel/preset-env": "^7.9.0","@babel/runtime": "^7.8.4","@react-native-community/eslint-config": "^0.0.5","@types/jest": "^24.0.24","@types/react-native": "^0.60.25","@types/react-test-renderer": "16.9.1","@typescript-eslint/eslint-plugin": "^2.12.0","@typescript-eslint/parser": "^2.12.0","babel-core": "^6.26.3","babel-jest": "^25.1.0","babel-preset-env": "^1.7.0","eslint": "^5.16.0","jest": "^25.1.0","metro-react-native-babel-preset": "^0.56.0","react-native-obfuscating-transformer": "^1.0.0","react-test-renderer": "16.9.0","remote-redux-devtools": "^0.5.16","typescript": "^3.7.3"    },"jest": {"preset": "react-native","moduleFileExtensions": ["ts","tsx","js","jsx","json","node"        ]    }}

androidmanifest.xml,

<manifest xmlns:android="http://schemas.android.com/apk/res/android"  package="com.seven.eleven.sports"><uses-permission android:name="android.permission.INTERNET" /><application      android:name=".MainApplication"      android:label="@string/app_name"      android:icon="@mipmap/ic_launcher"      android:roundIcon="@mipmap/ic_launcher_round"      android:allowBackup="false"      android:theme="@style/AppTheme"><!-- You will only need to add this meta-data tag, but make sure it's a child of application --><meta-data     android:name="com.google.android.geo.API_KEY"     android:value=""/><!-- You will also only need to add this uses-libray tag --><uses-library android:name="org.apache.http.legacy" android:required="false"/><activity        android:name=".MainActivity"        android:label="@string/app_name"        android:configChanges="keyboard|keyboardHidden|orientation|screenSize"        android:windowSoftInputMode="adjustResize"><intent-filter><action android:name="android.intent.action.MAIN" /><category android:name="android.intent.category.LAUNCHER" /></intent-filter></activity><activity android:name="com.facebook.react.devsupport.DevSettingsActivity" /></application></manifest>
Viewing all 28480 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>