diff --git a/android/src/main/java/com/reactlibrary/RNThreadModule.java b/android/src/main/java/com/reactlibrary/RNThreadModule.java index 5ca8b1b3a5e8577ba4f794bf7d7adcda7f5fb416..b8f19eb0d2a9c7aad93df973430dd7445bbae4db 100644 --- a/android/src/main/java/com/reactlibrary/RNThreadModule.java +++ b/android/src/main/java/com/reactlibrary/RNThreadModule.java @@ -58,7 +58,11 @@ public class RNThreadModule extends ReactContextBaseJavaModule implements Lifecy public void startThread(final String jsFileName, final Promise promise) { Log.d(TAG, "Starting web thread - " + jsFileName); - String jsFileSlug = jsFileName.contains("/") ? jsFileName.replaceAll("/", "_") : jsFileName; + // When we create the absolute file path later, a "./" will break it. + // Remove the leading "./" if it exists. + String jsFileSlug = jsFileName.contains("./") + ? jsFileName.replace("./", "") + : jsFileName; JSBundleLoader bundleLoader = getDevSupportManager().getDevSupportEnabled() ? createDevBundleLoader(jsFileName, jsFileSlug) diff --git a/examples/SimpleExample/android/app/build.gradle b/examples/SimpleExample/android/app/build.gradle index cd800887a00c13c686a3bc65ee30f71fee9315ff..8e0b6b6ce66932477704f1d6fe8a201997f1ae5e 100644 --- a/examples/SimpleExample/android/app/build.gradle +++ b/examples/SimpleExample/android/app/build.gradle @@ -148,10 +148,10 @@ android { } dependencies { - compile project(':react-native-threads') compile fileTree(dir: "libs", include: ["*.jar"]) compile "com.android.support:appcompat-v7:23.0.1" compile "com.facebook.react:react-native:+" // From node_modules + compile project(':react-native-threads') } // Run this once to be able to run the application with BUCK