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

Keep com.facebook.react gradle plugin from silently adding project repositories

$
0
0

I'm configuring an existing Android app adding react native support. I already migrated gradle files in the documentation to Kotlin DSL and Versions catalog which is the target configuration required by the existing app.

The current configuration in settings.gradle.kts requires settings repositories:

dependencyResolutionManagement {    repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)    repositories {        google()        mavenCentral()        //...    }}

Right after applying the plugin in :app build.gradle.kts like this:

plugins {    //..    id("com.facebook.react")}

I get the following error:

Build was configured to prefer settings repositories over project repositories but repository 'maven' was added by plugin 'com.facebook.react'

Switching to repositoriesMode.set(RepositoriesMode.PREFER_SETTINGS) makes the error only a warning but then I get other errors when compiling probably because of the conflict and ultimately I need to stick to RepositoriesMode.FAIL_ON_PROJECT_REPOS to comply with the policies.

Here is the error I get when I use RepositoriesMode.PREFER_SETTINGS:

A problem occurred configuring project ':app'.> defaultConfig contains custom resource values, but the feature is disabled.

Here is the list of warnings I get:

Build was configured to prefer settings repositories over project repositories but repository 'maven' was added by plugin 'com.facebook.react'Build was configured to prefer settings repositories over project repositories but repository 'MavenRepo' was added by plugin 'com.facebook.react'Build was configured to prefer settings repositories over project repositories but repository 'maven2' was added by plugin 'com.facebook.react'Build was configured to prefer settings repositories over project repositories but repository 'Google' was added by plugin 'com.facebook.react'Build was configured to prefer settings repositories over project repositories but repository 'maven3' was added by plugin 'com.facebook.react'

I'm currently using com.facebook.react:react-android:0.73.4

Any ideas?


How to support old architecture in react-native package build on new architecture with NativeModules

$
0
0

I have created a react-native package with version 0.72 which has the NativeModules to fulfill the requirements. It's working fine with the apps which are on new architecture. But when it comes to old architecture or react-native e.g 0.68.x, the iOS dependency is not being installed when we run pod install and when i'm trying to link manually, using npx react-native link <package-id> it only links Android but not iOS.

PS: It's working fine on Android. Only iOS is causing issue.

MSAL - react native for android stuck dialog : "Are you trying to sign in to ...."?

$
0
0

I am a mobile developer (react native - android). I am using MSAL as login mechanism. I have been testing my application and I am stuck in the confirmation page of MSAL (this is the part when MSAL use the browser to interact with the user before allowing to enter the app or the page with "‌Are you trying to sign in to {your_appname}"‌?) when I click "‌Continue"‌ button it doesn't do anything, and there is no error message appeared, so I don'‌t have any clues about what is going on. This problem has never happened before.

enter image description here

I am trying to search all related issue, I found that it probably caused by AADSTS50199 CmsiInterrupt - For security reasons, user confirmation is required for this request. Because this is an "interaction_required" error, the client should do interactive auth.

I also found an article : MSAL Android Xamarin Stuck Dialog - "Are you trying to sign in to {your_appname}"?

but I think he is not using React native as programming language.

Is there a way to skip this confirmation page? or any solutions ?

how to add Admob in our react native expo app which expo version is 50 and 51

$
0
0

my package.json is

{"name": "admob","version": "1.0.0","main": "expo/AppEntry.js","scripts": {"start": "expo start","android": "expo run:android","ios": "expo run:ios","web": "expo start --web"  },"dependencies": {"expo": "^50.0.18","expo-ads-admob": "^13.0.0","expo-dev-client": "~3.3.11","expo-status-bar": "~1.11.1","react": "18.2.0","react-native": "0.73.6","react-native-google-mobile-ads": "^12.6.0","react-native-web": "~0.19.6","react-dom": "18.2.0","@expo/metro-runtime": "~3.1.3"  },}

i tried the plugins

1, "react-native-google-mobile-ads": "^12.6.0",2. "expo-ads-admob": "^13.0.0",

not workinghow to fix this issue and use in expo 50 or 51

EXPO 51 and gradle 8.7 returning a lot of errors when building

$
0
0

I'm currently working on a react native project and I have recently updated expo from 48 to 51 and gradle from 8.0 to 8.7 but I've been running into a lot of issues while building and I don't understand what's happening. If anyone has any idea please let me know

current configuration

// android => build.gradle

buildscript {    ext {        minSdkVersion = Integer.parseInt(findProperty('android.minSdkVersion') ?: '24')        compileSdkVersion = Integer.parseInt(findProperty('android.compileSdkVersion') ?: '34')        targetSdkVersion = Integer.parseInt(findProperty('android.targetSdkVersion') ?: '33')        kotlinVersion = findProperty('android.kotlinVersion') ?: '1.8.10'        frescoVersion = findProperty('expo.frescoVersion') ?: '2.5.0'        ndkVersion = "23.1.7779620"    }    repositories {        google()        mavenCentral()    }    dependencies {        classpath('com.android.tools.build:gradle:8.7')        classpath('com.facebook.react:react-native-gradle-plugin')    }}allprojects {    repositories {        maven {            url(new File(['node', '--print', "require.resolve('react-native/package.json')"].execute(null, rootDir).text.trim(), '../android'))        }        maven {            url(new File(['node', '--print', "require.resolve('jsc-android/package.json')"].execute(null, rootDir).text.trim(), '../dist'))        }        google()        mavenCentral()        maven { url 'https://www.jitpack.io' }    }}

When I run the command below, it starts building but then get a lot of errors

eas build --platform android

List of errors

FAILURE: Build completed with 2 failures.1: Task failed with an exception.-----------* What went wrong:Execution failed for task ':app:compileReleaseJavaWithJavac'.> Compilation failed; see the compiler error output for details.* Try:> Run with --info option to get more log output.> Run with --scan to get full insights.==============================================================================2: Task failed with an exception.-----------* What went wrong:Execution failed for task ':expo-modules-core:buildCMakeRelWithDebInfo[arm64-v8a]'.> com.android.ide.common.process.ProcessException: ninja: Entering directory `/home/expo/workingdir/build/node_modules/expo-modules-core/android/.cxx/RelWithDebInfo/44jo3q1u/arm64-v8a'  [1/31] Building CXX object CMakeFiles/expo-modules-core.dir/home/expo/workingdir/build/node_modules/expo-modules-core/common/cpp/NativeModule.cpp.o  [2/31] Building CXX object CMakeFiles/expo-modules-core.dir/home/expo/workingdir/build/node_modules/expo-modules-core/common/cpp/LazyObject.cpp.o  [3/31] Building CXX object CMakeFiles/expo-modules-core.dir/home/expo/workingdir/build/node_modules/expo-modules-core/common/cpp/ObjectDeallocator.cpp.o  [4/31] Building CXX object CMakeFiles/expo-modules-core.dir/home/expo/workingdir/build/node_modules/expo-modules-core/common/cpp/SharedObject.cpp.o  [5/31] Building CXX object CMakeFiles/expo-modules-core.dir/home/expo/workingdir/build/node_modules/expo-modules-core/common/cpp/TypedArray.cpp.o  [6/31] Building CXX object CMakeFiles/expo-modules-core.dir/home/expo/workingdir/build/node_modules/expo-modules-core/common/cpp/JSIUtils.cpp.o  [7/31] Building CXX object CMakeFiles/expo-modules-core.dir/src/main/cpp/JNIDeallocator.cpp.o  [8/31] Building CXX object CMakeFiles/expo-modules-core.dir/home/expo/workingdir/build/node_modules/expo-modules-core/common/cpp/EventEmitter.cpp.o  [9/31] Building CXX object CMakeFiles/expo-modules-core.dir/src/main/cpp/JNIInjector.cpp.o  [10/31] Building CXX object CMakeFiles/expo-modules-core.dir/src/main/cpp/Exceptions.cpp.o  [11/31] Building CXX object CMakeFiles/expo-modules-core.dir/src/main/cpp/JNIFunctionBody.cpp.o  [12/31] Building CXX object CMakeFiles/expo-modules-core.dir/src/main/cpp/ExpoModulesHostObject.cpp.o  [13/31] Building CXX object CMakeFiles/expo-modules-core.dir/src/main/cpp/types/FrontendConverterProvider.cpp.o  [14/31] Building CXX object CMakeFiles/expo-modules-core.dir/src/main/cpp/JavaReferencesCache.cpp.o  [15/31] Building CXX object CMakeFiles/expo-modules-core.dir/src/main/cpp/JSReferencesCache.cpp.o  [16/31] Building CXX object CMakeFiles/expo-modules-core.dir/src/main/cpp/JavaScriptFunction.cpp.o  [17/31] Building CXX object CMakeFiles/expo-modules-core.dir/src/main/cpp/JSIContext.cpp.o  [18/31] Building CXX object CMakeFiles/expo-modules-core.dir/src/main/cpp/JavaScriptModuleObject.cpp.o  FAILED: CMakeFiles/expo-modules-core.dir/src/main/cpp/JavaScriptModuleObject.cpp.o   /home/expo/Android/Sdk/ndk/23.1.7779620/toolchains/llvm/prebuilt/linux-x86_64/bin/clang++ --target=aarch64-none-linux-android24 --sysroot=/home/expo/Android/Sdk/ndk/23.1.7779620/toolchains/llvm/prebuilt/linux-x86_64/sysroot -Dexpo_modules_core_EXPORTS -I/home/expo/.gradle/caches/transforms-4/1b0d40195752a48d3828f4fabd5bb28b/transformed/jetified-react-android-0.74.1-release/prefab/modules/reactnativejni/include/react -I/home/expo/workingdir/build/node_modules/react-native/ReactAndroid/src/main/jni/react/turbomodule -I/home/expo/workingdir/build/node_modules/expo-modules-core/android/../common/cpp -I/home/expo/workingdir/build/node_modules/expo-modules-core/android/src/fabric -isystem /home/expo/.gradle/caches/transforms-4/ecfdad561a37bc96224ca22b4a190131/transformed/jetified-fbjni-0.6.0/prefab/modules/fbjni/include -isystem /home/expo/.gradle/caches/transforms-4/1b0d40195752a48d3828f4fabd5bb28b/transformed/jetified-react-android-0.74.1-release/prefab/modules/jsi/include -isystem /home/expo/.gradle/caches/transforms-4/1b0d40195752a48d3828f4fabd5bb28b/transformed/jetified-react-android-0.74.1-release/prefab/modules/reactnativejni/include -isystem /home/expo/.gradle/caches/transforms-4/1b0d40195752a48d3828f4fabd5bb28b/transformed/jetified-react-android-0.74.1-release/prefab/modules/folly_runtime/include -isystem /home/expo/.gradle/caches/transforms-4/1b0d40195752a48d3828f4fabd5bb28b/transformed/jetified-react-android-0.74.1-release/prefab/modules/react_nativemodule_core/include -DANDROID -fdata-sections -ffunction-sections -funwind-tables -fstack-protector-strong -no-canonical-prefixes -D_FORTIFY_SOURCE=2 -Wformat -Werror=format-security -fexceptions -frtti -stdlib=libc++ -DREACT_NATIVE_TARGET_VERSION=74 -O2 -g -DNDEBUG -fPIC -DFOLLY_NO_CONFIG=1 -DFOLLY_HAVE_CLOCK_GETTIME=1 -DFOLLY_USE_LIBCPP=1 -DFOLLY_CFG_NO_COROUTINES=1 -DFOLLY_MOBILE=1 -DFOLLY_HAVE_RECVMMSG=1 -DFOLLY_HAVE_PTHREAD=1 -DFOLLY_HAVE_XSI_STRERROR_R=1 -O2 -frtti -fexceptions -Wall -fstack-protector-all -DUSE_HERMES=0 -DUNIT_TEST=0 -std=gnu++20 -MD -MT CMakeFiles/expo-modules-core.dir/src/main/cpp/JavaScriptModuleObject.cpp.o -MF CMakeFiles/expo-modules-core.dir/src/main/cpp/JavaScriptModuleObject.cpp.o.d -o CMakeFiles/expo-modules-core.dir/src/main/cpp/JavaScriptModuleObject.cpp.o -c /home/expo/workingdir/build/node_modules/expo-modules-core/android/src/main/cpp/JavaScriptModuleObject.cpp  /home/expo/workingdir/build/node_modules/expo-modules-core/android/src/main/cpp/JavaScriptModuleObject.cpp:148:28: error: no viable constructor or deduction guide for deduction of template arguments of 'weak_ptr'      auto weakConstructor = std::weak_ptr(constructor);                             ^  /home/expo/Android/Sdk/ndk/23.1.7779620/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/include/c++/v1/memory:4690:51: note: candidate template ignored: couldn't infer template argument '_Tp'      template<class _Yp> _LIBCPP_INLINE_VISIBILITY weak_ptr(shared_ptr<_Yp> const& __r,                                                    ^  /home/expo/Android/Sdk/ndk/23.1.7779620/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/include/c++/v1/memory:4679:28: note: candidate template ignored: could not match 'weak_ptr' against 'shared_ptr'  class _LIBCPP_TEMPLATE_VIS weak_ptr                             ^  /home/expo/Android/Sdk/ndk/23.1.7779620/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/include/c++/v1/memory:4694:5: note: candidate template ignored: could not match 'weak_ptr' against 'shared_ptr'      weak_ptr(weak_ptr const& __r) _NOEXCEPT;      ^  /home/expo/Android/Sdk/ndk/23.1.7779620/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/include/c++/v1/memory:4695:51: note: candidate template ignored: could not match 'weak_ptr' against 'shared_ptr'      template<class _Yp> _LIBCPP_INLINE_VISIBILITY weak_ptr(weak_ptr<_Yp> const& __r,                                                    ^  /home/expo/Android/Sdk/ndk/23.1.7779620/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/include/c++/v1/memory:4701:5: note: candidate template ignored: could not match 'weak_ptr' against 'shared_ptr'      weak_ptr(weak_ptr&& __r) _NOEXCEPT;      ^  /home/expo/Android/Sdk/ndk/23.1.7779620/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/include/c++/v1/memory:4702:51: note: candidate template ignored: could not match 'weak_ptr' against 'shared_ptr'      template<class _Yp> _LIBCPP_INLINE_VISIBILITY weak_ptr(weak_ptr<_Yp>&& __r,                                                    ^  /home/expo/Android/Sdk/ndk/23.1.7779620/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/include/c++/v1/memory:4689:23: note: candidate function template not viable: requires 0 arguments, but 1 was provided      _LIBCPP_CONSTEXPR weak_ptr() _NOEXCEPT;                        ^  1 error generated.  [19/31] Building CXX object CMakeFiles/expo-modules-core.dir/src/main/cpp/JavaScriptRuntime.cpp.o  [20/31] Building CXX object CMakeFiles/expo-modules-core.dir/src/main/cpp/JavaScriptObject.cpp.o  [21/31] Building CXX object CMakeFiles/expo-modules-core.dir/src/main/cpp/JavaCallback.cpp.o  [22/31] Building CXX object CMakeFiles/expo-modules-core.dir/src/main/cpp/JavaScriptTypedArray.cpp.o  [23/31] Building CXX object CMakeFiles/expo-modules-core.dir/src/main/cpp/JavaScriptValue.cpp.o  ninja: build stopped: subcommand failed.  C++ build system [build] failed while executing:      /home/expo/Android/Sdk/cmake/3.22.1/bin/ninja \        -C \        /home/expo/workingdir/build/node_modules/expo-modules-core/android/.cxx/RelWithDebInfo/44jo3q1u/arm64-v8a \        expo-modules-core    from /home/expo/workingdir/build/node_modules/expo-modules-core/android* 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 7m 16s568 actionable tasks: 568 executedError: Gradle build failed with unknown error. See logs for the "Run gradlew" phase for more information.

How run the expo project?

$
0
0

Thanks for clicking.I have react-native project.But it's built long ago, and use expo.Now I can't run the project because version is not correct.How can I fix it.Plz help.

I reinstalled SDK and expo, and node modules, but I can't run it.

Android LocationManager not returning users location

$
0
0

This is a React Native app but in a Android Native module.

I am using the Android LocationManager to get the users current location via GPS but it is returning [0.000000,0.000000]

Location permissions are granted. And I can access the users location in React Native code using the Geolocation services, so this appears to only be an issue with native android code.

I have tried using network as a provider with the same result.

val startingLocation = Location(LocationManager.GPS_PROVIDER)        sendErrorToReact("Start Loc: $startingLocation")

Android Bundling failed

$
0
0
header 1header 2
cell 1cell 2
cell 3cell 4
header 1header 2
cell 1cell 2
cell 3cell 4
  1. I have problem when wrap app.js with <ClerkProvider> and after reaload the project i had this error message :

Android Bundling failed 589ms C:\My Work\React Native\First\node_modules\expo\AppEntry.js (1 module)

Unable to resolve "@clerk/shared" from "node_modules\@clerk\clerk-react\dist\index.js

Here's the app.js :

import { StatusBar } from 'expo-status-bar';import { StyleSheet, Text, View } from 'react-native';import Login from './Apps/Screens/LoginScreen/Login';import { ClerkProvider,SignedIn, SignedOut  } from "@clerk/clerk-expo";export default function App() {  return (<ClerkProvider publishableKey={'pk_test_ZGFzaGluZy1maXNoLTc0LmNsZXJrLmFjY291bnRzLmRldiQ'}><View style={styles.container}><SignedIn><Text>You are Signed in</Text></SignedIn><SignedOut><Login/></SignedOut><StatusBar style="auto" /></View></ClerkProvider>  );}

And here's the package.json :

{"name": "first","version": "1.0.0","main": "expo/AppEntry.js","scripts": {"start": "expo start --tunnel","android": "expo start --android","ios": "expo start --ios","web": "expo start --web"  },"dependencies": {"@clerk/clerk-expo": "^1.1.4","expo": "~51.0.8","expo-status-bar": "~1.12.1","react": "^18.3.1","react-dom": "^18.3.1","react-native": "0.74.1"  },"devDependencies": {"@babel/core": "^7.20.0"  },"private": true}

Android Bundling failed 589ms C:\My Work\React Native\First\node_modules\expo\AppEntry.js (1 module)

Unable to resolve "@clerk/shared" from "node_modules\@clerk\clerk-react\dist\index.js"


Alarm issue .it is not working when app is closed

$
0
0

iam developing an alarm app it is producing the sound when app is opening but when we closing the app doesn't producing the sound.can anyone help what packages to be installed and what should be changed to get the sound when app is closed

i need what packages to be installed

My Expo upgrade from 48 to 51 giving Problems

$
0
0

I am updating my expo project from expo 48 to expo 51 and I am getting same error again and again.

Error Image

And my package.json file after running, npm install expo@latest and npx expo install --fix command

{"name": "BelCitiSolSmartLighting","version": "1.0.0","scripts": {"start": "expo start --dev-client","android": "expo run:android","ios": "expo run:ios","web": "expo start --web","eject": "expo eject"  },"dependencies": {"@expo-google-fonts/pt-serif": "^0.2.2","@react-native-async-storage/async-storage": "1.23.1","@react-native-community/art": "^1.2.0","@react-native-community/datetimepicker": "7.7.0","@react-native-community/netinfo": "11.3.1","@react-native-picker/picker": "2.7.5","@react-navigation/bottom-tabs": "^6.3.1","@react-navigation/drawer": "^6.4.1","@react-navigation/native": "^6.1.6","@react-navigation/native-stack": "^6.6.2","axios": "^0.27.2","axios-auth-refresh": "^3.2.2","crypto-js": "^3.1.9-1","dotenv": "^16.0.1","exceljs": "^4.3.0","expo": "~51.0.4","expo-app-loading": "~2.0.0","expo-barcode-scanner": "~13.0.1","expo-build-properties": "~0.12.1","expo-camera": "~15.0.7","expo-constants": "~16.0.1","expo-crypto": "~13.0.2","expo-device": "~6.0.2","expo-file-system": "~17.0.1","expo-image-manipulator": "~12.0.4","expo-image-picker": "~15.0.4","expo-intent-launcher": "~11.0.1","expo-linking": "~6.3.1","expo-location": "~17.0.1","expo-media-library": "~16.0.3","expo-network": "~6.0.1","expo-permissions": "~14.1.1","expo-screen-orientation": "~7.0.4","expo-secure-store": "~13.0.1","expo-sharing": "~12.0.1","expo-splash-screen": "~0.27.4","expo-status-bar": "~1.12.1","expo-updates": "~0.25.11","fs": "0.0.1-security","link": "^1.5.1","material-icons": "^1.13.10","moment": "^2.29.3","native-base": "^3.4.4","react": "18.2.0","react-dom": "18.2.0","react-hook-form": "^7.45.4","react-native": "0.74.1","react-native-barcode-mask": "^1.2.4","react-native-calendars": "^1.1284.0","react-native-chart-kit": "^6.12.0","react-native-dotenv": "^3.3.1","react-native-dropdown-picker": "^5.4.2","react-native-elements": "^3.4.2","react-native-gesture-handler": "~2.16.1","react-native-indicator": "^1.2.2","react-native-keychain": "^8.0.0","react-native-maps": "1.14.0","react-native-material-menu": "^2.0.0","react-native-modern-datepicker": "^1.0.0-beta.91","react-native-paper": "^4.12.1","react-native-permissions": "^3.8.4","react-native-popable": "^0.4.3","react-native-popup-menu": "^0.15.12","react-native-qrcode-scanner": "^1.5.5","react-native-radio-buttons-group": "^3.0.3","react-native-reanimated": "~3.10.1","react-native-redash": "^16.3.0","react-native-root-siblings": "^4.1.1","react-native-root-toast": "^3.4.0","react-native-safe-area-context": "4.10.1","react-native-screens": "3.31.1","react-native-svg": "15.2.0","react-native-walkthrough-tooltip": "^1.3.1","react-native-web": "~0.19.10","react-navigation": "^4.4.4","recharts": "^2.1.9","rn-tooltip": "^3.0.1","safe-json-stringify": "^1.2.0","socket.io-client": "^2.0.4","victory-native": "^36.5.0"  },"devDependencies": {"@babel/core": "^7.24.0","@types/crypto-js": "^4.1.1","@types/react": "~18.2.79","@types/react-native": "~0.67.6","@types/react-native-vector-icons": "^6.4.10","@types/socket.io-client": "^3.0.0","react-native-vector-icons": "^9.2.0","typescript": "~5.3.3"  },"resolutions": {"@types/react": "~17.0.21","@types/react-native": "~0.64.12","crypto-js": "3.1.9-1","**/crypto-js": "3.1.9-1"  },"private": true,"rnpm": {"assets": ["./assests/fonts/"    ]  }}

Please provide me solution.

Also I unstalled one by one package to see what is problem but not getting solution

How to blur text in React Native

$
0
0

The question is simple. I have a View with a Text component in it. I just want this text to be blurred initially.The only solution I saw to blur something in React Native is for an Image via this "react-native-blur".

How can we blur a Text component in React Native?

Info: I just want to make an app where the user does not see the answer directly (via blurring).

My app shows google login panel, I changed the email and client Id in the code then get this error

$
0
0

I'm using for google sso

react-native-google-signin/google-signin

Error is:

{"nativeStackAndroid":[],"userInfo":null,"message":"A non-recoverablesign in failure occurred","code":"12500"}

code was working fine before change client ID:`

const googleSignIN = () => {GoogleSignin.configure({androidClientId: CLIENT_ID})    GoogleSignin.hasPlayServices().then((hasPlayService) => {        if (hasPlayService) {            GoogleSignin.signIn().then(async (userInfo) => {                console.log("userInfo", JSON.stringify(userInfo.user))                setLoading(true);                const social_Login_Data = {                    email: userInfo.user.email,                    name: userInfo.user.name                }                console.log("social_Login_Data : ", social_Login_Data);                try {                    const res = await api.post(`/Auth/login-single-signin`, social_Login_Data);                    console.log("response : ", res.data);                    if (res.data.ack === 1) {                        console.log('success');                        navigation.navigate('DrawerNavigation')                    } else {                        setItem('social_Login_Data', JSON.stringify(social_Login_Data))                        navigation.navigate('VerifyEmail',{msg:res.data.message})                    }                    setLoading(false);                } catch (e) {                    setLoading(false);                    alert(e)                }            }).catch((e) => {                setLoading(false);                console.log("ERROR IS1: " + JSON.stringify(e));            })        }    }).catch((e) => {        console.log("ERROR IS2: " + JSON.stringify(e));    })}`

Please help if anyone got this error and solved this.

Execution failed for task app:mergeReleaseResources

$
0
0

I have been trying to make android build in my react-native project using ./gradlew bundleRelease but I get this error

> Task :app:mergeReleaseResources FAILEDERROR:/Users/apple/.gradle/caches/transforms-3/ef7e3198104e6ed5b72438d3c2fc716c/transformed/material-1.9.0/res/values/values.xml: Resource and asset merger: Can't determine type for tag '<macro name="m3_comp_assist_chip_container_shape">?attr/shapeAppearanceCornerSmall</macro>'FAILURE: Build failed with an exception.* What went wrong:Execution failed for task ':app:mergeReleaseResources'.> /Users/apple/.gradle/caches/transforms-3/ef7e3198104e6ed5b72438d3c2fc716c/transformed/material-1.9.0/res/values/values.xml: Error: Can't determine type for tag '<macro name="m3_comp_assist_chip_container_shape">?attr/shapeAppearanceCornerSmall</macro>'

I searched for the solution over stackoverflow. Found this similar issue with no proper answer:

For the record, i haven't installed or upgraded any dependency that can cause issue

Opening android app trough deeplinks on Meta platforms

$
0
0

I have several deeplinks configured for my android app. They work like expected when clicking on them from an email, SMS, note and chrome browser etc. However I am unable to get the deeplinks working inside the Meta Platform (e.g. Instagram, Facebook).

I am trying the following scenarios:

  • Opening my app trough an Instagram profile with a deeplinked url results in just opening the url inside their browser instead of the intended app. example of URL in profile

  • Using their browser as step in between e.g. using a linktree with the deeplinked url as an option which is clickable results in opening the url inside their browser. Not opening the app as expected.

When inside their browser you are able to open the website inside a chrome browser (trough the kebab menu, top right), when doing so the app suddenly does open!

This makes me believe Meta is blocking deeplinks on purpose, which i cannot find any documentation or references about. This behavior can also be reproduced with https://youtube.com as deeplink for example opening the youtube app or inside their browser.

Hope someone can enlighten me on this behavior and if it is even possible to use deeplinks on their platform and/or their browser?.

React Native Jssip Webrtc unable to display remote video or play audio

$
0
0

I'm trying to build a simple React Native app (Jssip and WebRTC) that will receive and answer a call from a SIP door station (Akuvox).

The overall solution is intended for use on the local network only.

The local network sip server is Routr with RTPengine.

So far the door station initiates a call, the React Native Android client is able to answer the call, SDP offer and answer are exchanged, ontrack is event is emitted, the Jssip confirmed event is emitted, the peerconnection is showing as connected but I'm unable to display Video or play audio on the client. The door station is receiving audio from the clients microphone. Not sure which step I'm missing?

"react-native": "0.74.1""react-native-jssip": "3.7.6""react-native-webrtc": "^118.0.7"

SDP Offer From Door Station

v=0o=1101 5000 5000 IN IP4 172.18.0.3s=Talkc=IN IP4 172.18.0.3b=AS:4000t=0 0m=audio 25614 UDP/TLS/RTP/SAVPF 8 0 9 101a=mid:1a=rtpmap:8 PCMA/8000a=rtpmap:0 PCMU/8000a=rtpmap:9 G722/8000a=rtpmap:101 telephone-event/8000a=fmtp:101 0-15a=sendrecva=rtcp:25614a=rtcp-muxa=setup:actpassa=fingerprint:sha-256 F1:0A:15:B0:36:66:DA:5D:61:A5:C9:A8:5E:72:24:4B:E5:26:3E:0E:B0:4A:E2:08:A8:95:0B:EE:07:C7:0F:2Da=tls-id:65c686948f15c085408a7242c0c60246a=ptime:20a=ice-ufrag:nK9WTPofa=ice-pwd:Cv8ALuBGGxFfyj0GvVd2hkAIBAa=candidate:mrzwf4XLvFEvyPHC 1 UDP 2130706431 172.18.0.3 25614 typ hostm=video 32555 UDP/TLS/RTP/SAVPF 96a=mid:2a=rtpmap:96 H264/90000a=fmtp:96 profile-level-id=42e01f;packetization-mode=1;max-br=512;max-mbps=40500a=sendrecva=rtcp:32555a=rtcp-muxa=setup:actpassa=fingerprint:sha-256 F1:0A:15:B0:36:66:DA:5D:61:A5:C9:A8:5E:72:24:4B:E5:26:3E:0E:B0:4A:E2:08:A8:95:0B:EE:07:C7:0F:2Da=tls-id:842f7759383cdec3efbcbd7c1440ad77a=ptime:20a=ice-ufrag:Xs8w1N0la=ice-pwd:ilQ4EtLhw13mc1jtfw6M6dICxla=candidate:mrzwf4XLvFEvyPHC 1 UDP 2130706431 172.18.0.3 32555 typ host

SDP Answer

v=0o=- 949635043982078924 2 IN IP4 127.0.0.1s=-t=0 0a=msid-semantic: WMS 6677aff8-db93-400c-89ae-bfe1e92e4c0cm=audio 42489 UDP/TLS/RTP/SAVPF 8 0 9 101c=IN IP4 192.168.61.242a=rtcp:9 IN IP4 0.0.0.0a=candidate:370454302 1 udp 2122260223 192.168.61.242 42489 typ host generation 0 network-id 3 network-cost 10a=ice-ufrag:KUE+a=ice-pwd:+SYB8TMYatUez3K47PwIVH3ma=ice-options:trickle renominationa=fingerprint:sha-256 E4:09:B4:E4:4B:19:B8:75:39:54:00:AE:BF:35:C1:B4:22:B0:92:64:F0:3D:D2:F2:9E:EF:62:67:6B:34:24:85a=setup:activea=mid:1a=sendrecva=msid:6677aff8-db93-400c-89ae-bfe1e92e4c0c 4475b5a0-8f2c-4cc9-9111-877c5c31bfcea=rtcp-muxa=rtpmap:8 PCMA/8000a=rtpmap:0 PCMU/8000a=rtpmap:9 G722/8000a=rtpmap:101 telephone-event/8000a=ssrc:251028228 cname:EUjhx7RyFwKLwQi4a=ssrc:251028228 msid:6677aff8-db93-400c-89ae-bfe1e92e4c0c 4475b5a0-8f2c-4cc9-9111-877c5c31bfcem=video 41096 UDP/TLS/RTP/SAVPF 96c=IN IP4 192.168.61.242a=rtcp:9 IN IP4 0.0.0.0a=candidate:370454302 1 udp 2122260223 192.168.61.242 41096 typ host generation 0 network-id 3 network-cost 10a=ice-ufrag:PIXOa=ice-pwd:GFHcL+KIjarDtgiQeHpRneP5a=ice-options:trickle renominationa=fingerprint:sha-256 E4:09:B4:E4:4B:19:B8:75:39:54:00:AE:BF:35:C1:B4:22:B0:92:64:F0:3D:D2:F2:9E:EF:62:67:6B:34:24:85a=setup:activea=mid:2a=sendrecva=msid:6677aff8-db93-400c-89ae-bfe1e92e4c0c 074bfb5c-cbbb-44a1-8b87-7e19cba6f3e7a=rtcp-muxa=rtpmap:96 H264/90000a=fmtp:96 level-asymmetry-allowed=1;packetization-mode=1;profile-level-id=42e01fa=ssrc:3709015175 cname:EUjhx7RyFwKLwQi4a=ssrc:3709015175 msid:6677aff8-db93-400c-89ae-bfe1e92e4c0c 074bfb5c-cbbb-44a1-8b87-7e19cba6f3e7

peerConnection Status after call confirmed event emitted"signalingState": "stable","iceGatheringState": "complete","connectionState": "connected","iceConnectionState": "connected",

React Native Client Example

import { useEffect, useRef, useState } from 'react';import {StyleSheet, View} from 'react-native';import { WebSocketInterface, UA, debug } from 'react-native-jssip'import { RTCPeerConnection, RTCIceCandidate, RTCSessionDescription, mediaDevices, RTCView, MediaStream, MediaStreamTrack } from 'react-native-webrtc';global.RTCPeerConnection = RTCPeerConnection;global.RTCIceCandidate = RTCIceCandidate;global.RTCSessionDescription = RTCSessionDescription;global.navigator.mediaDevices = mediaDevices;// debug.enable('JsSIP:*')export  function IntercomHome({navigation, route}) {  const [setRemoteMedia, setsetRemoteMedia] = useState(null)  const remoteMedia = useRef({})  const myUa = useRef(null)  const myUaCurrentRtcSession = useRef(null)  const processNewRtcSession = (newRtc) => {    myUaCurrentRtcSession.current = newRtc.session    newRtc.session.on('confirmed',           async(e) => {        console.log('\n\n connections status')        console.log(JSON.stringify(myUaCurrentRtcSession.current.connection))    })    newRtc.session.on('sdp', (e) => {        console.log(e.type)        console.log(e.sdp)    })    if(newRtc.originator === 'remote'){      setTimeout(() => {        answerIncomingCall()      },2000)    }  }  const answerIncomingCall = () => {    let options = {      mediaConstraints: {        audio: true,         video: true      },      pcConfig: {          iceServers: [],          iceTransportPolicy: "all",          rtcpMuxPolicy: "negotiate"      },    }    myUaCurrentRtcSession.current.answer(options)    myUaCurrentRtcSession.current.connection.ontrack = async function(track){      if(track.track.kind === 'video'){        console.log('Video Track')        try{            setRemoteMedia(track.streams[0])        }catch(e){          console.log(e)        }      }    }  }  const createJsSipInstance = async() => {    console.log('Creating JsSip Instance')    await getUserMedia()    let socket = new WebSocketInterface('ws://***.***.**.**:5062');    let configuration = {        sockets: [socket],        uri          : 'sip:****@***.*****',        password     : "*****",        session_timers: true,        session_timers_force_refresher: true,    };    const ua = new UA(configuration);    myUa.current = ua    myUa.current.on('newRTCSession', processNewRtcSession)  useEffect(() => {    if (!myUa.current) {      createJsSipInstance()    }    return () => {    }  }) return(<View style={{...styles.mainView, backgroundColor:'yellow'}}>      {remoteUrl ? <RTCView           style={{flex:0.5, backgroundColor:'pink'}}          streamURL={remoteUrl.toURL()}          objectFit={'contain'}          zOrder={10}        />        :        null      }</View>  )}

Layout animation not working properly in android

$
0
0
import React, { useState } from 'react';import { View, Text, Button, LayoutAnimation, UIManager, Platform } from 'react-native';// Enable LayoutAnimation on Androidif (Platform.OS === 'android') {  UIManager.setLayoutAnimationEnabledExperimental(true);}const App = () => {  const [showHeaderFooter, setShowHeaderFooter] = useState(true);  const toggleHeaderFooter = () => {    LayoutAnimation.configureNext(LayoutAnimation.Presets.easeInEaseOut);    setShowHeaderFooter(!showHeaderFooter);  };  return (<View style={{ flex: 1, justifyContent: 'center', alignItems: 'center' }}>      {showHeaderFooter && <Header />}<Center />      {showHeaderFooter && <Footer />}<Button title="Toggle Header/Footer" onPress={toggleHeaderFooter} /></View>  );};const Header = () => (<View style={{ backgroundColor: 'lightblue', padding: 20 }}><Text>This is the header</Text></View>);const Center = () => (<View style={{ backgroundColor: 'lightgreen', padding: 20 }}><Text>This is the center content</Text></View>);const Footer = () => (<View style={{ backgroundColor: 'lightcoral', padding: 20 }}><Text>This is the footer</Text></View>);export default App;

In the above code i'm trying to hide header and footer with some animation (using layout animation).

But in android the the middle view is also getting removed on clicking the button. Also, on multiple clicks all the views are getting removed.I have already added setLayoutAnimationEnabledExperimental.

Works fine on IOS for some reason.

Expo link: https://snack.expo.dev/@mmt10470/layout-animation

does not install android application

$
0
0

my name is Holman and I am new. I'm making some changes to a mobile app using React-native and also Metro Builder. I start Metro normally, but when I start the application with the command: npm run wharehouse:Android. It should be noted that I am using my personal phone to test it. Everything is normal, when the phone asks me if I want to install the app, I say yes, but the app does not appear anywhere on my phone. I don't know what to do, there are no signs of any error.

I tried restarting my Laptop and Mobile phone, but nothing worked. I hope you can help me solve it and that the application can appear and I can use it to test it.

Can't restart mobile application in react native

$
0
0

Here is the code which should restart my application :

import RNRestart from 'react-native-restart';const VerificationCodeScreen = ({ navigation }: VerificationCodeScreenProps) => {  const { updateAuth0Config } = useAuth0Config();  const verifyCode = async () => {    await updateAuth0Config('hey', 'yo');    RNRestart.restart();  }

I test my application with android device conected and this command :

react-native run-android

When I execute this function (which is on a button). I got the following error :

"Unable to determine default activity for com.testapp. Does an activity specify the DEFAULT category in its intent filter?"

I tried many things but I think my manifest should be ok :

`<manifest xmlns:android="http://schemas.android.com/apk/res/android"><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"><activity        android:name=".MainActivity"        android:label="@string/app_name"        android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|screenSize|smallestScreenSize|uiMode"        android:launchMode="singleTask"        android:windowSoftInputMode="adjustResize"        android:exported="true"><intent-filter><action android:name="android.intent.action.MAIN" /><category android:name="android.intent.category.LAUNCHER" /><data                    android:scheme="scheme"                    android:host="host"                    android:pathPrefix="/android/com.testapp/callback"/></intent-filter></activity></application></manifest>`

I tried :

./gradlew clean

./gradlew clean build

./gradlew assembleDebug

I deleted node_modules and did :

npm install

How to connect to a WebSocket in React Native android with isTrusted:true? WebSocket in React Native returns "isTrusted": false (expo go, android)

$
0
0

I'm developing an app in React Native and I want to implement a WebSocket, but the WebSocket events come with isTrusted set to false, and I need it to be true.

When I test the same function in the browser console, isTrusted is true. Does anyone know what I could be doing wrong?

I'm using expo and expo go on my android phone to test

snack: https://snack.expo.dev/@pedroaf0/websocket-in-react-native-returns-istrusted-false-expo-go-android?platform=android

Code:

    import { StyleSheet, TouchableOpacity, Text, View } from 'react-native';    export default function app() {    function connectWebSocket() {        console.log('Conectando ao WebSocket...');        const socket = new WebSocket('wss://echo.websocket.org');        // Evento disparado quando a conexão é aberta        socket.addEventListener('open', function (event) {            console.log('Conexão aberta com sucesso.');            // Envia uma mensagem para o servidor WebSocket            socket.send('Olá, servidor WebSocket!');        });        // Evento disparado quando uma mensagem é recebida do servidor        socket.addEventListener('message', function (event) {            console.log('Mensagem recebida do servidor:', event.data);            console.log(event);        });        // Evento disparado quando ocorre um erro na conexão WebSocket        socket.addEventListener('error', function (event) {            console.error('Erro na conexão WebSocket:', event);        });        // Evento disparado quando a conexão é fechada        socket.addEventListener('close', function (event) {            console.log('Conexão WebSocket fechada:', event);        });        }        return (<View style={styles.conteiner}><TouchableOpacity style={styles.button} onPress={connectWebSocket}><Text style={styles.buttonText}>conectar</Text></TouchableOpacity></View>    );    }    const styles = StyleSheet.create({    button: {        backgroundColor: '#007AFF',        borderRadius: 8,        padding: 10,        marginTop: 10,    },    buttonText: {        color: 'white',        textAlign: 'center',    },    conteiner: {      flex: 1,      alignContent: 'center',      justifyContent: 'center',    },});

Logs in RN:

 LOG Connecting to WebSocket... LOG Connection opened successfully. LOG Message received from server: Request served by 7811941c69e658 LOG {"data": "Request served by 7811941c69e658", "isTrusted": false} LOG Message received from server: Hello, WebSocket server! LOG {"data": "Hello, WebSocket server!", "isTrusted": false}

The same function executed in the browser returns in the logs:

 connectWebSocket() Connecting to WebSocket... Connection opened successfully. Message received from server: Request served by 7811941c69e658 MessageEvent {isTrusted: true, data: 'Request served by 7811941c69e658', origin: 'wss://echo.websocket.org', lastEventId: '', source: null, …} Message received from server: Hello WebSocket server! MessageEvent {isTrusted: true, data: 'Hello, WebSocket server!', origin: 'wss://echo.websocket.org', lastEventId: '', source: null, …}

What is the difference?How to connect to a WebSocket in React Native android in a Trusted way (isTrusted)?

I tried variations of this code, but it didn't make a difference:

const options = {  headers: {'Sec-WebSocket-Protocol': 'echo-protocol',  },  rejectUnauthorized: false,};const ws = new WebSocket('wss://echo.websocket.org', [], options);

Samsung Galaxy S24 not working for react native Android app

$
0
0

React Native Android application is not working in Samsung Galaxy S24 and A55 after installing from Play Store. The app freezes on the default launcher screen.

I found the solution of making the app 64-bit compatible but it is already compatible.

Here is my Gradle file:

splits {    abi {        reset()        enable enableSeparateBuildPerCPUArchitecture        universalApk false // If true, also generate a universal APK        include “armeabi-v7a”, “x86”, “arm64-v8a”, “x86_64”    }}

Even when I extracted the APK file, I found all 4 folders in the lib folder.

Viewing all 29594 articles
Browse latest View live


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