tapsellorg/TapsellPlusSDK-ReactNativePlugin

[Error]: Unable to load script. Make sure you're either running metro ...

Closed this issue · 13 comments

I get this error while run npm install react-native-tapsell-plus --save and after forcing install project wasn't be able to run anymore and Metro server ran into problem.
So, Is there any solution or i should downgrade node or RN version?
Thanks.

Screenshot_1630180440

Hello

Doesn't look like a package-related issue to me

This may be the reason: https://stackoverflow.com/a/50834600/6678991

When you launch debug mode you have to allow localhost for Android 9 or higher as a clearTextTraffic.

Why this happens exactly after using tapsell-plus? I'm not sure. TargetSDK version maybe? Android related docs

Hi
I've tested those solution before i submit an issue here but no one of them make's no difference and error is still there.
Could you please add TapselPlus sdk in a project with RN 0.64.2 and test it by your own?

Here is my Android SDK and System informations

android/app/src/build.gradle:

buildscript {
    ext {
        buildToolsVersion = "29.0.3"
        minSdkVersion = 21
        compileSdkVersion = 29
        targetSdkVersion = 29
        ndkVersion = "20.1.5948944"
    }
    repositories {
        google()
        jcenter()
    }
    dependencies {
        classpath("com.android.tools.build:gradle:4.1.0")
        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}

System Information :

System:
    OS: macOS 11.5.2
    CPU: (8) x64 Apple M1
    Memory: 25.53 MB / 8.00 GB
    Shell: 5.8 - /bin/zsh
  Binaries:
    Node: 14.17.5 - /usr/local/bin/node
    Yarn: 1.22.11 - ~/node_modules/.bin/yarn
    npm: 7.21.0 - /usr/local/bin/npm
    Watchman: 2021.08.02.00 - /opt/homebrew/bin/watchman
  Managers:
    CocoaPods: Not Found
  SDKs:
    iOS SDK: Not Found
    Android SDK:
      API Levels: 29, 30, 31
      Build Tools: 29.0.2, 30.0.2, 31.0.0
      System Images: android-29 | Google APIs ARM 64 v8a, android-31 | Google APIs ARM 64 v8a
      Android NDK: Not Found
  IDEs:
    Android Studio: 2020.3 AI-203.7717.56.2031.7583922
    Xcode: /undefined - /usr/bin/xcodebuild
  Languages:
    Java: 1.8.0_292 - /usr/bin/javac
  npmPackages:
    @react-native-community/cli: Not Found
    react: 17.0.1 => 17.0.1 
    react-native: 0.64.2 => 0.64.2 
    react-native-macos: Not Found
  npmGlobalPackages:
    *react-native*: Not Found

Thanks.

Also i've initialized a test project with RN 0.63.4 (as peerDependencies pointed to) following the updated Docs but still get same error

You did not mention the state of the clearTextTraffic in your project. That's in the AndroidManifest.xml

Something like this in the sample code: Link to sample manifest

From react native docs:

image

I did in both projects but that by itself didn't fixed the error! It seems it is some react native bug and should follow this solution: facebook/react-native#25348

با توجه به اینکه مشکل حل نشده

رو اپلیکیشن سمپل هم این مشکل رو میتونید تولید کنید؟
تو چه حالتی؟

نه روی حالت دیباگ توی پروژه سمپل هیچ مشکلی نیست من یه احتمال میدم که شاید بخاطر نسخه `metro-react-native-babel-preset` روی اپلیکیشن سمپل باشه

I'm facing this issue too

https://stackoverflow.com/a/50834600/6678991 worked for me!

and this solution didn't work for me

any other solution?

Getting back to this one again

The issue could be caused by various reasons. To recognize the one for your own follow these steps:

  1. Have something to look at logcat of the device (Such as Android studio)
  2. Run the app in debug mode
  3. Open up logcat [and clear] and wait for the error from metro
  4. An error will be published.
  5. See if it's related to any package

@amirito You might want to do this if it's still bothering

e.g My issue that I tried to produce was related to this one from RN

Same issue here

I've installed tapsell-plus library from both way via npm and manually in android/app/build.gradle.
I faced this issue just when i added this package, nothing more.

metro was running but when app run, app doesn't works (debug mode)

when i remove this package, everything just works fine.

Environment:

react native: 0.71.4
android build tools version: 33.0
tapsell-plus: 2.1.8

any solutions?

Note
Issue solved
at least for me

Use https://stackoverflow.com/a/59918130/3062856 instead https://stackoverflow.com/a/50834600/3062856

<?xml version="1.0" encoding="utf-8"?>
<network-security-config>
    <base-config cleartextTrafficPermitted="true">
        <trust-anchors>
            <certificates src="system" />
        </trust-anchors>
    </base-config>
</network-security-config>
<?xml version="1.0" encoding="utf-8"?>
<manifest ...>
    <uses-permission android:name="android.permission.INTERNET" />
    <application
        ...
        android:networkSecurityConfig="@xml/network_security_config"
        ...>
        ...
    </application>
</manifest>

This is fixed in 2.1.8. Also tested with RN 0.71.6, Please refer to the sample app.
So I’m gonna close it. Feel free to reopen if you think it exists in the latest version.