klarna / react-native-klarna-inapp-sdk

Klarna's React Native wrapper for the In-App SDK
Apache License 2.0
22 stars 25 forks source link

"Unable to load script from assets 'index.android.bundle'..." after integrating SDK using NPM or manual installation #90

Closed EndLess728 closed 3 years ago

EndLess728 commented 3 years ago

Describe the bug A clear and concise description of what the bug is.

To Reproduce Steps to reproduce the behavior:

  1. npm install this package
  2. try to run using npx react-native run-android
  3. see error
* What went wrong:
Execution failed for task ':app:checkDebugAarMetadata'.
> Could not resolve all files for configuration ':app:debugRuntimeClasspath'.
   > Could not find com.klarna.mobile:sdk:2.0.16.
     Searched in the following locations:
       - file:/Users/ios/.m2/repository/com/klarna/mobile/sdk/2.0.16/sdk-2.0.16.pom
       - file:/Users/ios/Desktop/demo_tests/paymentDemo/node_modules/react-native/android/com/klarna/mobile/sdk/2.0.16/sdk-2.0.16.pom
       - file:/Users/ios/Desktop/demo_tests/paymentDemo/node_modules/jsc-android/dist/com/klarna/mobile/sdk/2.0.16/sdk-2.0.16.pom
       - https://dl.google.com/dl/android/maven2/com/klarna/mobile/sdk/2.0.16/sdk-2.0.16.pom
       - https://jcenter.bintray.com/com/klarna/mobile/sdk/2.0.16/sdk-2.0.16.pom
       - https://www.jitpack.io/com/klarna/mobile/sdk/2.0.16/sdk-2.0.16.pom
     Required by:
         project :app > project :react-native-klarna-inapp-sdk

I fix this error by following this https://github.com/klarna/react-native-klarna-inapp-sdk#warning-regarding-android-integration

But after that metro server does not run. Project Builds successfully but metro server do not run .

_I followed this guide and fixed metro issue too but it is just a hack and it breaks hot refresh and debugging ._

Expected behavior It should run with metro server .

Here is the example code you can check it also for reproducing same error:- https://github.com/EndLess728/klarna-demo-

Screenshots alt text

Device and version:

EndLess728 commented 3 years ago

_I followed this guide and fixed metro issue too but it is just a hack and it breaks hot refresh and debugging ._ I need a proper fix for this SDK, please fix it asap because my project is getting delayed due to this issue.

omarbh commented 3 years ago

Hi @EndLess728, we will investigate the issue and update her once we have an ETA.

mahmoudjafarinejad commented 3 years ago

Hi @EndLess728, we tried to reproduce the issue in our repository and also using the repository you kindly shared with us. Without applying the fix you mentioned for the metro server issue and by following these steps, we could not reproduce the issue and the test application started successfully:

1- npm install 2- npx react-native run-android -> Metro server started + bundling/downloading the application. 3- Application started successfully on the emulator.

If you are still facing the same issue, please stop the running instance of the metro server and start it manually by "react-native start" command, then try to reload the application.

omarbh commented 3 years ago

We will close this issue, please reopen it if you still need assistance.

akhilsanker commented 2 years ago

@omarbh,

Still facing the same issue. My environment details is as follows:

 "react": "17.0.2",
 "react-native": "0.66.2",
  "react-native-klarna-inapp-sdk": "^2.1.0",
  Android: 12 (API 31)

Is there anything I am missing?

Thanks

NMGuner commented 2 years ago

Hi @akhilsanker, can you provide more details and logs about the issue you are having, possibly fill out the template we have for reporting issues. The issue reported here was with a version that is really old at this point and if you are facing the same thing but not able to overcome that with the solution presented here, we may have to create a new ticket with the additional information you provide in the template.