Comments (11)
p6 is isTurboModule
, it comes from this gradle function:
def isNewArchitectureEnabled() {
return rootProject.hasProperty("newArchEnabled") && rootProject.getProperty("newArchEnabled") == "true"
}
I'm guessing you don't have a variable named newArchEnabled
in your <project>/android/gradle.properties
. Adding that there should fix this issue. Nevertheless, we should fix this by providing a fallback value of false
in this case.
from repack.
hey @jbroma
I got this line in my android/gradle.properties
file and it's set to false
:
newArchEnabled=false
I also searched project for this flag and found this in BuildConfig.java
:
// Field from default config.
public static final boolean IS_NEW_ARCHITECTURE_ENABLED = false;
which is used in MainApplication.java
:
@Override
protected boolean isNewArchEnabled() {
return BuildConfig.IS_NEW_ARCHITECTURE_ENABLED;
}
from repack.
@jbroma
I started snooping around in the codes and noticed something like this:
ReactModuleInfo.class
:
public ReactModuleInfo(String name, String className, boolean canOverrideExistingModule, boolean needsEagerInit, boolean hasConstants, boolean isCxxModule, boolean isTurboModule) {
this.mName = name;
this.mClassName = className;
this.mCanOverrideExistingModule = canOverrideExistingModule;
this.mNeedsEagerInit = needsEagerInit;
this.mHasConstants = hasConstants;
this.mIsCxxModule = isCxxModule;
this.mIsTurboModule = isTurboModule;
}
it has 7 params but you are passing 6 params here getReactModuleInfoProvider()
:
moduleInfos[ScriptManagerModule.NAME] = ReactModuleInfo(
ScriptManagerModule.NAME,
ScriptManagerModule.NAME,
false, // canOverrideExistingModule
true, // needsEagerInit
false, // isCxxModule
isTurboModule // isTurboModule
)
so there is an error: No value passed for parameter 'isTurboModule'
from repack.
oh yeah, absolutely right, I miscounted the first time apparently! Great find, feel free to open a PR 🎉
from repack.
@jbroma ok, but what value should be passed there as hasConstants
?
from repack.
good question, according to this it's a very rare optimisation and 99% it should be set to true. Seems like this was also deprecated, and new constructor without this hasConstants
was introduced, so it's very likely this is an issue only on 0.71 (this needs veryfing)
from repack.
@jbroma
in my case if I pass there the value "true" then the application after building immediately closes
for the value "false" it seems to work correctly
I'm going to upgrade my react native version to 0.74 to verify if this is a problem with my current 0.71 version or not and I'll let you know
I have prepared a patch for "patch-package" if anyone needs it:
@callstack+repack+4.0.0.patch
diff --git a/node_modules/@callstack/repack/android/src/main/java/com/callstack/repack/ChunkManagerPackage.kt b/node_modules/@callstack/repack/android/src/main/java/com/callstack/repack/ChunkManagerPackage.kt
index 8f65da6..480fc41 100644
--- a/node_modules/@callstack/repack/android/src/main/java/com/callstack/repack/ChunkManagerPackage.kt
+++ b/node_modules/@callstack/repack/android/src/main/java/com/callstack/repack/ChunkManagerPackage.kt
@@ -27,6 +27,7 @@ class ScriptManagerPackage : TurboReactPackage() {
/** default value is false, but we should initialize it as quick as possible*/
true, // needsEagerInit
false, // isCxxModule
+ false, // hasConstants
isTurboModule // isTurboModule
)
moduleInfos
from repack.
So the versions affected are < 0.73, 0.72 falls into that so we need to fix this.
Thanks for the investigation @krzysztofzaluski, would you like to submit a PR with this change? 🙏
from repack.
@jbroma I didn't updated RN 0.74 to verify it yet, I'm going to do that and let you know if it's the case and then I can make a PR
from repack.
I did launch new arch with 0.73 and 0.74 and it didn't seem to be affected, this param was removed so it's essentially ignored from 0.73
from repack.
Related Issues (20)
- Vendored Device class is broken when it comes to debugging HOT 3
- [Docs] Tree-shaking benchmark of RN app HOT 2
- Brotli decompression HOT 2
- RePack with rn_nodeify HOT 3
- Apk not launching HOT 5
- ERROR while setting up code signing HOT 2
- Issue with node v22.0.0 HOT 4
- Error: repack react native module was not found. Did you forget to update native dependencies? HOT 7
- TypeError: webpackContext.u is not a function (it is undefined)
- Property SentryError doesnt exist HOT 3
- ChunkLoad Error HOT 5
- bundling mini-apps cause crashes HOT 19
- How to config webpack to reuse existing dependencies from the main bundle HOT 4
- How to debug blank screen issue with no error output? HOT 24
- Question: getting the error: "File assets/images/<imageName>@3x.png for ios not found in compilation assets" HOT 5
- More control over file path and URL for remote assets HOT 11
- Module Federation host app not working [ScriptManager] failed to load script : [NetworkFailure] HOT 1
- Error: Unhandled error. ([ScriptManager] Failed to load script:) HOT 3
- Update docs related to Expo on Usage docs page HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from repack.