Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Failed to run android on React Native 0.71 #2418

Closed
ajaxjiang96 opened this issue Jan 13, 2023 · 49 comments
Closed

Failed to run android on React Native 0.71 #2418

ajaxjiang96 opened this issue Jan 13, 2023 · 49 comments

Comments

@ajaxjiang96
Copy link

Steps to Reproduce

  1. Upgrade react native version to 0.71 following the upgrade helper
  2. Install dependencies
  3. Run yarn android

Expected Behavior

App builds and runs under debug mode

Actual Behavior

After upgraded to React Native 0.71, the android build fails with the following message:

* What went wrong:
Could not determine the dependencies of task ':app:generateBundledResourcesHashDebug'.
> Task with path 'bundleDebugJsAndAssets' not found in project ':app'.

Environment

  • react-native-code-push version: 7.0.5
  • react-native version: 0.71.0
  • iOS/Android/Windows version: Android 11
  • Does this reproduce on a debug build or release build? debug
  • Does this reproduce on a simulator, or only on a physical device? simulator

Other Attempts

After removing the following lines from android/build.gradle the build seems to work fine (w/o codepush of course)

apply from: "../../node_modules/react-native-code-push/android/codepush.gradle"
@johnf
Copy link
Contributor

johnf commented Jan 13, 2023

I have the start of a fix here #2419

You can use patch-package with

iff --git a/node_modules/react-native-code-push/android/codepush.gradle b/node_modules/react-native-code-push/android/codepush.gradle
index 22be273..8eff668 100644
--- a/node_modules/react-native-code-push/android/codepush.gradle
+++ b/node_modules/react-native-code-push/android/codepush.gradle
@@ -25,6 +25,11 @@ gradle.projectsEvaluated {
     }
     
     android.applicationVariants.all { variant ->
+        // skip debug build variant
+        if (variant.buildType.name == "debug") {
+            return;
+        }
+
         def nodeModulesPath;
         if (config.root) {
             nodeModulesPath = Paths.get(config.root, "/node_modules");
@@ -48,10 +53,10 @@ gradle.projectsEvaluated {
         // Make this task run right after the bundle task
         def generateBundledResourcesHash;
 
-        if (variant.hasProperty("bundleJsAndAssets")) {
-            def reactBundleTask = variant.bundleJsAndAssets
-            jsBundleDir = reactBundleTask.generatedAssetsFolders[0].absolutePath
-            resourcesDir = reactBundleTask.generatedResFolders[0].absolutePath
+        def reactBundleTask = tasks.findByName("createBundle${targetName}JsAndAssets")
+        if (reactBundleTask) {
+            jsBundleDir = reactBundleTask.property('jsBundleDir').asFile.get()
+            resourcesDir = reactBundleTask.property('resourcesDir').asFile.get()
             jsBundleFile = file("$jsBundleDir/$bundleAssetName")
 
             generateBundledResourcesHash = tasks.create(
@@ -107,7 +112,7 @@ gradle.projectsEvaluated {
             generateBundledResourcesHash.dependsOn("recordFilesBeforeBundleCommand${targetName}")
         }
 
-        generateBundledResourcesHash.dependsOn("bundle${targetName}JsAndAssets")
+        generateBundledResourcesHash.dependsOn("createBundle${targetName}JsAndAssets")
         runBefore("processArmeabi-v7a${targetName}Resources", generateBundledResourcesHash)
         runBefore("processX86${targetName}Resources", generateBundledResourcesHash)
         runBefore("processUniversal${targetName}Resources", generateBundledResourcesHash)

@hengkx
Copy link

hengkx commented Jan 17, 2023

same error

1 similar comment
@lifeoasis-chudee
Copy link

same error

@arlovip
Copy link

arlovip commented Jan 17, 2023

The same issue.

@DmitriyKirakosyan
Copy link
Contributor

@johnf Thank you for your contribution! Please add the link to this issue in your PR.

johnf added a commit to johnf/react-native-code-push that referenced this issue Jan 17, 2023
React native now uses react-native-gradle-plugin, which works a bit
differently.
@tindn
Copy link

tindn commented Jan 18, 2023

having the same issue, your suggested patch works @johnf, thank you for the help.

johnf added a commit to johnf/react-native-code-push that referenced this issue Jan 19, 2023
React native now uses react-native-gradle-plugin, which works a bit
differently.
bishalfan pushed a commit to ds-fancode/react-native-code-push that referenced this issue Jan 20, 2023
React native now uses react-native-gradle-plugin, which works a bit
differently.
@clovisrodriguez
Copy link

clovisrodriguez commented Jan 24, 2023

I started a new project, on react-native 0.71.1, but when I ran the patch it threw me an error saying it couldn't be applied

yarn install v1.22.19
[1/4] 🔍  Resolving packages...
success Already up-to-date.
$ patch-package
patch-package 6.5.1
Applying patches...

**ERROR** Failed to apply patch for package react-native at path
  
    node_modules/react-native

  This error was caused because patch-package cannot apply the following patch file:

    patches/react-native+0.71.1.patch

  Try removing node_modules and trying again. If that doesn't work, maybe there was
  an accidental change made to the patch file? Try recreating it by manually
  editing the appropriate files and running:
  
    patch-package react-native
  
  If that doesn't work, then it's a bug in patch-package, so please submit a bug
  report. Thanks!

    https://github.com/ds300/patch-package/issues
    

---

@johnf
Copy link
Contributor

johnf commented Jan 24, 2023

The patch needs an update since the last release. Check the PR here #2419

@clovisrodriguez
Copy link

Thanks, I applied the newest patch using the PR above, but I'm getting a message with the flavour used during the build time

* What went wrong:
Could not determine the dependencies of task ':app:generateBundledResourcesHashQaDebug'.
> Task with path 'bundleQaDebugJsAndAssets' not found in project ':app'.

I applied the patch react-native-code-push.patch

From c89c1d806bb035d06e5866f6caff8dcbbe2e9075 Mon Sep 17 00:00:00 2001
From: John Ferlito <johnf@inodes.org>
Date: Fri, 13 Jan 2023 19:14:43 +1100
Subject: [PATCH] Support RN 0.71.0 (Closes #2418)

React native now uses react-native-gradle-plugin, which works a bit
differently.
---
 README.md               |  3 ++-
 android/codepush.gradle | 46 ++++++++++++++++++++++++-----------------
 2 files changed, 29 insertions(+), 20 deletions(-)

diff --git a/README.md b/README.md
index 8e8b25026..6fadc5e90 100644
--- a/README.md
+++ b/README.md
@@ -75,7 +75,8 @@ We try our best to maintain backwards compatibility of our plugin with previous
 | v0.59                   | v5.6+ *(RN refactored js bundle loader code)*         |
 | v0.60-v0.61             | v6.0+ *(RN migrated to Autolinking)*                  |
 | v0.62-v0.64             | v6.2+ *(RN removed LiveReload)*                       |
-| v0.65-v0.69             | v7.2+ *(RN updated iPhone-target-version)*            |
+| v0.65-v0.69             | v7.0+ *(RN updated iPhone-target-version)*            |
+| v0.71                   | v7.2+ *(RN moved to react-native-gradle-plugin)*      |
 
 *NOTE: `react-native-code-push` versions lower than **[v5.7.0](https://github.com/microsoft/react-native-code-push/releases/tag/v5.7.0)** will stop working in the near future. You can find more information in our [documentation](https://github.com/microsoft/code-push/blob/master/migration-notice.md).*
 
diff --git a/android/codepush.gradle b/android/codepush.gradle
index 78134d358..bc44ee199 100644
--- a/android/codepush.gradle
+++ b/android/codepush.gradle
@@ -2,8 +2,8 @@
 
 import java.nio.file.Paths;
 
-def config = project.hasProperty("react") ? project.react : [];
-def bundleAssetName = config.bundleAssetName ?: "index.android.bundle"
+def config = project.extensions.findByName("react") ?: []
+def bundleAssetName = config.bundleAssetName.get() ?: "index.android.bundle"
 
 // because elvis operator
 def elvisFile(thing) {
@@ -23,11 +23,20 @@ android.buildTypes.each { buildType ->
     buildType.resValue 'string', "CODE_PUSH_APK_BUILD_TIME", String.format("\"%d\"", System.currentTimeMillis())
 }
 
-gradle.projectsEvaluated { 
+
+gradle.projectsEvaluated {
+
+    def debuggableVariants = config.debuggableVariants.get() ?: ['debug']
+
     android.applicationVariants.all { variant ->
+        // No code push for debuggable variants
+        if (debuggableVariants.contains(variant.name)) {
+            return;
+        }
+
         def nodeModulesPath;
         if (config.root) {
-            nodeModulesPath = Paths.get(config.root, "/node_modules");
+            nodeModulesPath = Paths.get(config.root.asFile.get().absolutePath, "/node_modules");
         } else if (project.hasProperty('nodeModulesPath')) {
             nodeModulesPath = project.nodeModulesPath
         } else {
@@ -42,16 +51,16 @@ gradle.projectsEvaluated {
         def jsBundleFile;
 
         // Additional node commandline arguments
-        def nodeExecutableAndArgs = config.nodeExecutableAndArgs ?: ["node"]
-        def extraPackagerArgs = config.extraPackagerArgs ?: []
+        def nodeExecutableAndArgs = config.nodeExecutableAndArgs.get() ?: ["node"]
+        def extraPackagerArgs = config.extraPackagerArgs.get() ?: []
 
         // Make this task run right after the bundle task
         def generateBundledResourcesHash;
 
-        if (variant.hasProperty("bundleJsAndAssets")) {
-            def reactBundleTask = variant.bundleJsAndAssets
-            jsBundleDir = reactBundleTask.generatedAssetsFolders[0].absolutePath
-            resourcesDir = reactBundleTask.generatedResFolders[0].absolutePath
+        def reactBundleTask = tasks.findByName("createBundle${targetName}JsAndAssets")
+        if (reactBundleTask) {
+            jsBundleDir = reactBundleTask.property('jsBundleDir').asFile.get()
+            resourcesDir = reactBundleTask.property('resourcesDir').asFile.get()
             jsBundleFile = file("$jsBundleDir/$bundleAssetName")
 
             generateBundledResourcesHash = tasks.create(
@@ -59,23 +68,21 @@ gradle.projectsEvaluated {
                     type: Exec) {
                 commandLine (*nodeExecutableAndArgs, "${nodeModulesPath}/react-native-code-push/scripts/generateBundledResourcesHash.js", resourcesDir, jsBundleFile, jsBundleDir)
 
-                enabled config."bundleIn${targetName}" ||
-                config."bundleIn${variant.buildType.name.capitalize()}" ?:
-                targetName.toLowerCase().contains("release")
+                enabled !debuggableVariants.contains(variant.name) ?: targetName.toLowerCase().contains("release")
             }
-            
+
             runBefore("merge${targetName}Resources", generateBundledResourcesHash)
-            runBefore("merge${targetName}Assets", generateBundledResourcesHash)   
+            runBefore("merge${targetName}Assets", generateBundledResourcesHash)
         } else {
             def jsBundleDirConfigName = "jsBundleDir${targetName}"
-            jsBundleDir = elvisFile(config."$jsBundleDirConfigName") ?:
+            jsBundleDir = elvisFile(config."$jsBundleDirConfigName").get() ?:
                     file("$buildDir/intermediates/assets/${targetPath}")
 
             def resourcesDirConfigName = "resourcesDir${targetName}"
-            resourcesDir = elvisFile(config."${resourcesDirConfigName}") ?:
+            resourcesDir = elvisFile(config."${resourcesDirConfigName}").get() ?:
                     file("$buildDir/intermediates/res/merged/${targetPath}")
 
-            // In case version of 'Android Plugin for Gradle'' is lower than 1.3.0 
+            // In case version of 'Android Plugin for Gradle'' is lower than 1.3.0
             // '$buildDir' has slightly different structure - 'merged' folder
             // does not exists so '${targetPath}' folder contains directly in 'res' folder.
             if (!resourcesDir.exists() && file("$buildDir/intermediates/res/${targetPath}").exists()) {
@@ -107,7 +114,8 @@ gradle.projectsEvaluated {
             generateBundledResourcesHash.dependsOn("recordFilesBeforeBundleCommand${targetName}")
         }
 
-        generateBundledResourcesHash.dependsOn("bundle${targetName}JsAndAssets")
+        generateBundledResourcesHash.dependsOn("createBundle${targetName}JsAndAssets")
+
         runBefore("processArmeabi-v7a${targetName}Resources", generateBundledResourcesHash)
         runBefore("processX86${targetName}Resources", generateBundledResourcesHash)
         runBefore("processUniversal${targetName}Resources", generateBundledResourcesHash)

@johnf
Copy link
Contributor

johnf commented Jan 25, 2023

Thanks, I applied the newest patch using the PR above, but I'm getting a message with the flavour used during the build time

* What went wrong:
Could not determine the dependencies of task ':app:generateBundledResourcesHashQaDebug'.
> Task with path 'bundleQaDebugJsAndAssets' not found in project ':app'.

Can you share the section of your android/app/build.grade where qa is defined.

I assume you are using flavours where as I am using variants, might need some changes to support that

@clovisrodriguez
Copy link

Sure, here you go:

apply plugin: "com.android.application"
apply plugin: "com.facebook.react"
apply from: "../../node_modules/react-native-code-push/android/codepush.gradle"

import com.android.build.OutputFile

/**
 * This is the configuration block to customize your React Native Android app.
 * By default you don't need to apply any configuration, just uncomment the lines you need.
 */
react {
    /* Folders */
    //   The root of your project, i.e. where "package.json" lives. Default is '..'
    // root = file("../")
    //   The folder where the react-native NPM package is. Default is ../node_modules/react-native
    // reactNativeDir = file("../node_modules/react-native")
    //   The folder where the react-native Codegen package is. Default is ../node_modules/react-native-codegen
    // codegenDir = file("../node_modules/react-native-codegen")
    //   The cli.js file which is the React Native CLI entrypoint. Default is ../node_modules/react-native/cli.js
    // cliFile = file("../node_modules/react-native/cli.js")

    /* Variants */
    //   The list of variants to that are debuggable. For those we're going to
    //   skip the bundling of the JS bundle and the assets. By default is just 'debug'.
    //   If you add flavors like lite, prod, etc. you'll have to list your debuggableVariants.
    // debuggableVariants = ["liteDebug", "prodDebug"]

    /* Bundling */
    //   A list containing the node command and its flags. Default is just 'node'.
    // nodeExecutableAndArgs = ["node"]
    //
    //   The command to run when bundling. By default is 'bundle'
    // bundleCommand = "ram-bundle"
    //
    //   The path to the CLI configuration file. Default is empty.
    // bundleConfig = file(../rn-cli.config.js)
    //
    //   The name of the generated asset file containing your JS bundle
    // bundleAssetName = "MyApplication.android.bundle"
    //
    //   The entry file for bundle generation. Default is 'index.android.js' or 'index.js'
    // entryFile = file("../js/MyApplication.android.js")
    //
    //   A list of extra flags to pass to the 'bundle' commands.
    //   See https://github.com/react-native-community/cli/blob/main/docs/commands.md#bundle
    // extraPackagerArgs = []

    /* Hermes Commands */
    //   The hermes compiler command to run. By default it is 'hermesc'
    // hermesCommand = "$rootDir/my-custom-hermesc/bin/hermesc"
    //
    //   The list of flags to pass to the Hermes compiler. By default is "-O", "-output-source-map"
    // hermesFlags = ["-O", "-output-source-map"]
}

/**
 * Set this to true to create four separate APKs instead of one,
 * one for each native architecture. This is useful if you don't
 * use App Bundles (https://developer.android.com/guide/app-bundle/)
 * and want to have separate APKs to upload to the Play Store.
 */
def enableSeparateBuildPerCPUArchitecture = false

/**
 * Set this to true to Run Proguard on Release builds to minify the Java bytecode.
 */
def enableProguardInReleaseBuilds = false

/**
 * The preferred build flavor of JavaScriptCore (JSC)
 *
 * For example, to use the international variant, you can use:
 * `def jscFlavor = 'org.webkit:android-jsc-intl:+'`
 *
 * The international variant includes ICU i18n library and necessary data
 * allowing to use e.g. `Date.toLocaleString` and `String.localeCompare` that
 * give correct results when using with locales other than en-US. Note that
 * this variant is about 6MiB larger per architecture than default.
 */
def jscFlavor = 'org.webkit:android-jsc:+'

/**
 * Private function to get the list of Native Architectures you want to build.
 * This reads the value from reactNativeArchitectures in your gradle.properties
 * file and works together with the --active-arch-only flag of react-native run-android.
 */
def reactNativeArchitectures() {
    def value = project.getProperties().get("reactNativeArchitectures")
    return value ? value.split(",") : ["armeabi-v7a", "x86", "x86_64", "arm64-v8a"]
}

android {
    ndkVersion rootProject.ext.ndkVersion

    compileSdkVersion rootProject.ext.compileSdkVersion

    namespace "com.tbitmobile"
    defaultConfig {
        applicationId "com.tbitmobile"
        minSdkVersion rootProject.ext.minSdkVersion
        targetSdkVersion rootProject.ext.targetSdkVersion
        versionCode 1
        versionName "1.0"
    }

    flavorDimensions "default"

    productFlavors {
        qa {
            minSdkVersion rootProject.ext.minSdkVersion
            applicationIdSuffix ".qa"
            targetSdkVersion rootProject.ext.targetSdkVersion
            resValue "string", "app_name", "T-BIT QA"
            resValue "string", "CodePushDeploymentKey", (CODEPUSH_KEY)
            manifestPlaceholders = [...]
        }
        pr {
            minSdkVersion rootProject.ext.minSdkVersion
            applicationIdSuffix ".prod"
            targetSdkVersion rootProject.ext.targetSdkVersion
            resValue "string", "app_name", "T-BIT"
            resValue "string", "CodePushDeploymentKey", (CODEPUSH_KEY)
            manifestPlaceholders = [...]
        }
    }

    splits {
        abi {
            reset()
            enable enableSeparateBuildPerCPUArchitecture
            universalApk false  // If true, also generate a universal APK
            include (*reactNativeArchitectures())
        }
    }
    signingConfigs {
        debug {
            storeFile file('debug.keystore')
            storePassword 'android'
            keyAlias 'androiddebugkey'
            keyPassword 'android'
        }
    }
    buildTypes {
        debug {
            signingConfig signingConfigs.debug
        }
        release {
            // Caution! In production, you need to generate your own keystore file.
            // see https://reactnative.dev/docs/signed-apk-android.
            signingConfig signingConfigs.debug
            minifyEnabled enableProguardInReleaseBuilds
            proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro"
        }
    }

    // applicationVariants are e.g. debug, release
    applicationVariants.all { variant ->
        variant.outputs.each { output ->
            // For each separate APK per architecture, set a unique version code as described here:
            // https://developer.android.com/studio/build/configure-apk-splits.html
            // Example: versionCode 1 will generate 1001 for armeabi-v7a, 1002 for x86, etc.
            def versionCodes = ["armeabi-v7a": 1, "x86": 2, "arm64-v8a": 3, "x86_64": 4]
            def abi = output.getFilter(OutputFile.ABI)
            if (abi != null) {  // null for the universal-debug, universal-release variants
                output.versionCodeOverride =
                        defaultConfig.versionCode * 1000 + versionCodes.get(abi)
            }

        }
    }
}

dependencies {
    // The version of react-native is set by the React Native Gradle Plugin
    implementation("com.facebook.react:react-android")

    implementation("androidx.swiperefreshlayout:swiperefreshlayout:1.0.0")

    debugImplementation("com.facebook.flipper:flipper:${FLIPPER_VERSION}")
    debugImplementation("com.facebook.flipper:flipper-network-plugin:${FLIPPER_VERSION}") {
        exclude group:'com.squareup.okhttp3', module:'okhttp'
    }

    debugImplementation("com.facebook.flipper:flipper-fresco-plugin:${FLIPPER_VERSION}")
    if (hermesEnabled.toBoolean()) {
        implementation("com.facebook.react:hermes-android")
    } else {
        implementation jscFlavor
    }
}

apply from: file("../../node_modules/@react-native-community/cli-platform-android/native_modules.gradle"); applyNativeModulesAppBuildGradle(project)

@ko-devHong
Copy link

ko-devHong commented Jan 27, 2023

If you run the patch in the way of @johnf, it builds normally, but it doesn't actually reflect it.

스크린샷 2023-01-27 오후 7 28 49

@johnf
Copy link
Contributor

johnf commented Jan 28, 2023

@clovisrodriguez I can't reproduce this. Can you send me the output of cd android && ./gradlew tasks --all | grep JsAndAssets

@johnf
Copy link
Contributor

johnf commented Jan 28, 2023

@ko-devHong Do you have adb log output you could share? It is working for me
image

@clovisrodriguez
Copy link

Hey John this was the output for the command

 cd android && ./gradlew tasks --all | grep JsAndAssets
app:bundlePrDebugJsAndAssets - bundle JS and assets for PrDebug.
app:bundlePrReleaseJsAndAssets - bundle JS and assets for PrRelease.
app:bundleQaDebugJsAndAssets - bundle JS and assets for QaDebug.
app:bundleQaReleaseJsAndAssets - bundle JS and assets for QaRelease.

@johnf
Copy link
Contributor

johnf commented Jan 30, 2023

That doesn't make a lot of sense. Below it's complaining that bundleQaDebugJsAndAssets doesn't exist

* What went wrong:
Could not determine the dependencies of task ':app:generateBundledResourcesHashQaDebug'.
> Task with path 'bundleQaDebugJsAndAssets' not found in project ':app'.

But then below it exists

 cd android && ./gradlew tasks --all | grep JsAndAssets
app:bundlePrDebugJsAndAssets - bundle JS and assets for PrDebug.
app:bundlePrReleaseJsAndAssets - bundle JS and assets for PrRelease.
app:bundleQaDebugJsAndAssets - bundle JS and assets for QaDebug.
app:bundleQaReleaseJsAndAssets - bundle JS and assets for QaRelease.

How are you kicking off the build?

@ys-sherzad
Copy link

@johnf Hi there, thank you for your awesome job. Just one question, is it safe to apply the patch? or should I wait to see what happens with the PR (#2419)

@clovisrodriguez
Copy link

@johnf I'm using react-native run-android --mode=qaDebug

@johnf
Copy link
Contributor

johnf commented Jan 30, 2023

@clovisrodriguez hmm I can't seem to replicate the issue. Can you share a minimal example repo that exhibits the problem?

@johnf
Copy link
Contributor

johnf commented Jan 30, 2023

@ys-sherzad I'm using it in dev at the moment, and it's working well. Only reason it's not in production is we haven't done a prod release yet, but that won't hold me back. Make sure you use the PR diff for your patch

@ko-devHong
Copy link

ko-devHong commented Feb 1, 2023

@johnf this is my adb log

  • env : firebase apptester bundle and GooglePlayStore Beta bundle
  • NOTE : i'm not use apply from: "../../node_modules/react-native/react.gradle" in app/build.gralde. This line has been removed from the upgrade helper for react-native 0.71.1 and has been deleted.

screenShot
스크린샷 2023-02-01 오후 3 18 09
스크린샷 2023-02-01 오후 3 18 47

  • ADBLog
2023-02-01 15:12:16.072  1618-1713  WindowManager           system_server                        E  win=Window{d39a263 u0 Splash Screen com.example EXITING} destroySurfaces: appStopped=false cleanupOnResume=false win.mWindowRemovalAllowed=true win.mRemoveOnExit=true win.mViewVisibility=0 caller=com.android.server.wm.WindowState.onExitAnimationDone:5917 com.android.server.wm.WindowStateAnimator.onAnimationFinished:220 com.android.server.wm.WindowState.onAnimationFinished:6142 com.android.server.wm.WindowContainer$$ExternalSyntheticLambda4.onAnimationFinished:2 com.android.server.wm.SurfaceAnimator.lambda$getFinishedCallback$0:140 com.android.server.wm.SurfaceAnimator.$r8$lambda$lRxTVOJy8fX752UbrFno9INW9hE:0 com.android.server.wm.SurfaceAnimator$$ExternalSyntheticLambda1.run:8 
2023-02-01 15:12:16.775 24820-25019 TrafficStats            com.example                    D  tagSocket(269) with statsTag=0xffffffff, statsUid=-1
2023-02-01 15:12:17.498 24820-24984 SensorManager           com.example                    D  registerListener :: 17, Game Rotation Vector, 16666, 0, 
2023-02-01 15:12:17.530 24820-24972 SensorManager           com.example                    D  unregisterListener
2023-02-01 15:12:17.585 24820-24820 DecorView               com.example                    I  notifyKeepScreenOnChanged: keepScreenOn=false
2023-02-01 15:12:17.589 24820-24820 ViewRootIm...nActivity] com.example                    D  performTraversals params={(0,0)(fillxfill) sim={adjust=resize} layoutInDisplayCutoutMode=shortEdges ty=BASE_APPLICATION wanim=0x1030309
                                                                                                      fl=81810500
                                                                                                      pfl=16020040
                                                                                                      apr=LIGHT_STATUS_BARS
                                                                                                      bhv=SHOW_TRANSIENT_BARS_BY_SWIPE
                                                                                                      fitSides= naviIconColor=0
                                                                                                      sfl=100000}
2023-02-01 15:12:17.590 24820-24820 ViewRootIm...nActivity] com.example                    D  performTraversals mFirst=false windowShouldResize=false viewVisibilityChanged=false mForceNextWindowRelayout=false params={(0,0)(fillxfill) sim={adjust=resize} layoutInDisplayCutoutMode=shortEdges ty=BASE_APPLICATION wanim=0x1030309
                                                                                                      fl=81810500
                                                                                                      pfl=16020040
                                                                                                      apr=LIGHT_STATUS_BARS
                                                                                                      bhv=SHOW_TRANSIENT_BARS_BY_SWIPE
                                                                                                      fitSides= naviIconColor=0
                                                                                                      sfl=100000}
2023-02-01 15:12:17.598 24820-24820 BLASTBufferQueue        com.example                    D  update, w= 1080 h= 2400 mNativeObject= 0xb400007a26415d10 sc.mNativeObject= 0xb4000079b64da860 format= -1 caller= android.view.ViewRootImpl.updateBlastSurfaceIfNeeded:2778 android.view.ViewRootImpl.relayoutWindow:9635 android.view.ViewRootImpl.performTraversals:3759 android.view.ViewRootImpl.doTraversal:2991 android.view.ViewRootImpl$TraversalRunnable.run:10665 android.view.Choreographer$CallbackRecord.run:1301 
2023-02-01 15:12:17.598 24820-24820 ViewRootIm...nActivity] com.example                    I  Relayout returned: old=(0,0,1080,2400) new=(0,0,1080,2400) req=(1080,2400)0 dur=8 res=0x0 s={true 0xb400007ab644bdf0} ch=false seqId=0
2023-02-01 15:12:17.638 24820-24820 DecorView               com.example                    I  notifyKeepScreenOnChanged: keepScreenOn=false
2023-02-01 15:12:17.641 24820-24820 ViewRootIm...nActivity] com.example                    D  performTraversals params={(0,0)(fillxfill) sim={adjust=resize} layoutInDisplayCutoutMode=shortEdges ty=BASE_APPLICATION wanim=0x1030309
                                                                                                      fl=81810500
                                                                                                      pfl=16020040
                                                                                                      apr=LIGHT_STATUS_BARS
                                                                                                      bhv=SHOW_TRANSIENT_BARS_BY_SWIPE
                                                                                                      fitSides= naviIconColor=0
                                                                                                      sfl=100000}
2023-02-01 15:12:17.641 24820-24820 ViewRootIm...nActivity] com.example                    D  performTraversals mFirst=false windowShouldResize=false viewVisibilityChanged=false mForceNextWindowRelayout=false params={(0,0)(fillxfill) sim={adjust=resize} layoutInDisplayCutoutMode=shortEdges ty=BASE_APPLICATION wanim=0x1030309
                                                                                                      fl=81810500
                                                                                                      pfl=16020040
                                                                                                      apr=LIGHT_STATUS_BARS
                                                                                                      bhv=SHOW_TRANSIENT_BARS_BY_SWIPE
                                                                                                      fitSides= naviIconColor=0
                                                                                                      sfl=100000}
2023-02-01 15:12:17.648 24820-24820 BLASTBufferQueue        com.example                    D  update, w= 1080 h= 2400 mNativeObject= 0xb400007a26415d10 sc.mNativeObject= 0xb4000079b64be400 format= -1 caller= android.view.ViewRootImpl.updateBlastSurfaceIfNeeded:2778 android.view.ViewRootImpl.relayoutWindow:9635 android.view.ViewRootImpl.performTraversals:3759 android.view.ViewRootImpl.doTraversal:2991 android.view.ViewRootImpl$TraversalRunnable.run:10665 android.view.Choreographer$CallbackRecord.run:1301 
2023-02-01 15:12:17.648 24820-24820 ViewRootIm...nActivity] com.example                    I  Relayout returned: old=(0,0,1080,2400) new=(0,0,1080,2400) req=(1080,2400)0 dur=7 res=0x0 s={true 0xb400007ab644bdf0} ch=false seqId=0
2023-02-01 15:12:17.681 24820-24820 DecorView               com.example                    I  notifyKeepScreenOnChanged: keepScreenOn=false
2023-02-01 15:12:17.690 24820-24820 ViewRootIm...nActivity] com.example                    D  performTraversals params={(0,0)(fillxfill) sim={adjust=resize} layoutInDisplayCutoutMode=shortEdges ty=BASE_APPLICATION wanim=0x1030309
                                                                                                      fl=81810500
                                                                                                      pfl=16020040
                                                                                                      apr=LIGHT_STATUS_BARS
                                                                                                      bhv=SHOW_TRANSIENT_BARS_BY_SWIPE
                                                                                                      fitSides= naviIconColor=0
                                                                                                      sfl=100000}
2023-02-01 15:12:17.690 24820-24820 ViewRootIm...nActivity] com.example                    D  performTraversals mFirst=false windowShouldResize=false viewVisibilityChanged=false mForceNextWindowRelayout=false params={(0,0)(fillxfill) sim={adjust=resize} layoutInDisplayCutoutMode=shortEdges ty=BASE_APPLICATION wanim=0x1030309
                                                                                                      fl=81810500
                                                                                                      pfl=16020040
                                                                                                      apr=LIGHT_STATUS_BARS
                                                                                                      bhv=SHOW_TRANSIENT_BARS_BY_SWIPE
                                                                                                      fitSides= naviIconColor=0
                                                                                                      sfl=100000}
2023-02-01 15:12:17.690 24820-24914 ChannelIO ...nect(126): com.example                    E  SocketManager.disconnect()
2023-02-01 15:12:17.691 24820-24914 ChannelIO ...cket(317): com.example                    E  SocketManager.releaseSocket()
2023-02-01 15:12:17.691 24820-24914 ChannelIO ...nect(126): com.example                    E  SocketManager.disconnect()
2023-02-01 15:12:17.691 24820-24914 ChannelIO ...cket(317): com.example                    E  SocketManager.releaseSocket()
2023-02-01 15:12:17.694 24820-25229 TrafficStats            com.example                    D  tagSocket(269) with statsTag=0xffffffff, statsUid=-1
2023-02-01 15:12:17.695 24820-24820 BLASTBufferQueue        com.example                    D  update, w= 1080 h= 2400 mNativeObject= 0xb400007a26415d10 sc.mNativeObject= 0xb4000079b64dd720 format= -1 caller= android.view.ViewRootImpl.updateBlastSurfaceIfNeeded:2778 android.view.ViewRootImpl.relayoutWindow:9635 android.view.ViewRootImpl.performTraversals:3759 android.view.ViewRootImpl.doTraversal:2991 android.view.ViewRootImpl$TraversalRunnable.run:10665 android.view.Choreographer$CallbackRecord.run:1301 
2023-02-01 15:12:17.695 24820-24820 ViewRootIm...nActivity] com.example                    I  Relayout returned: old=(0,0,1080,2400) new=(0,0,1080,2400) req=(1080,2400)0 dur=5 res=0x0 s={true 0xb400007ab644bdf0} ch=false seqId=0
2023-02-01 15:12:17.696 24820-25232 TrafficStats            com.example                    D  tagSocket(310) with statsTag=0xffffffff, statsUid=-1
2023-02-01 15:12:17.707 24820-25226 TrafficStats            com.example                    D  tagSocket(317) with statsTag=0xffffffff, statsUid=-1
2023-02-01 15:12:17.789 24820-25232 TrafficStats            com.example                    D  tagSocket(316) with statsTag=0xffffffff, statsUid=-1
2023-02-01 15:12:17.920 24820-24820 ChannelIO ...nnect(53): com.example                    E  SocketManager.connect(), Check connection: null
2023-02-01 15:12:17.920 24820-24820 ChannelIO ...cket(317): com.example                    E  SocketManager.releaseSocket()
2023-02-01 15:12:17.928 24820-25232 TrafficStats            com.example                    D  tagSocket(320) with statsTag=0xffffffff, statsUid=-1
2023-02-01 15:12:18.046 24820-24820 ChannelIO ....call(75): com.example                    E  SocketManager.connect(), Url received: https://0.front-ws.channel.io/front-v5
2023-02-01 15:12:18.046 24820-24820 ChannelIO ...call(102): com.example                    E  SocketManager.connect(), connect
2023-02-01 15:12:18.055 24820-25266 TrafficStats            com.example                    D  tagSocket(302) with statsTag=0xffffffff, statsUid=-1
2023-02-01 15:12:18.101 24820-24820 DecorView               com.example                    I  notifyKeepScreenOnChanged: keepScreenOn=false
2023-02-01 15:12:18.107 24820-24820 ViewRootIm...nActivity] com.example                    D  performTraversals params={(0,0)(fillxfill) sim={adjust=resize} layoutInDisplayCutoutMode=shortEdges ty=BASE_APPLICATION wanim=0x1030309
                                                                                                      fl=81810500
                                                                                                      pfl=16020040
                                                                                                      apr=LIGHT_STATUS_BARS
                                                                                                      bhv=SHOW_TRANSIENT_BARS_BY_SWIPE
                                                                                                      fitSides= naviIconColor=0
                                                                                                      sfl=100000}
2023-02-01 15:12:18.107 24820-24820 ViewRootIm...nActivity] com.example                    D  performTraversals mFirst=false windowShouldResize=false viewVisibilityChanged=false mForceNextWindowRelayout=false params={(0,0)(fillxfill) sim={adjust=resize} layoutInDisplayCutoutMode=shortEdges ty=BASE_APPLICATION wanim=0x1030309
                                                                                                      fl=81810500
                                                                                                      pfl=16020040
                                                                                                      apr=LIGHT_STATUS_BARS
                                                                                                      bhv=SHOW_TRANSIENT_BARS_BY_SWIPE
                                                                                                      fitSides= naviIconColor=0
                                                                                                      sfl=100000}
2023-02-01 15:12:18.110 24820-24820 BLASTBufferQueue        com.example                    D  update, w= 1080 h= 2400 mNativeObject= 0xb400007a26415d10 sc.mNativeObject= 0xb4000079b64ebed0 format= -1 caller= android.view.ViewRootImpl.updateBlastSurfaceIfNeeded:2778 android.view.ViewRootImpl.relayoutWindow:9635 android.view.ViewRootImpl.performTraversals:3759 android.view.ViewRootImpl.doTraversal:2991 android.view.ViewRootImpl$TraversalRunnable.run:10665 android.view.Choreographer$CallbackRecord.run:1301 
2023-02-01 15:12:18.111 24820-24820 ViewRootIm...nActivity] com.example                    I  Relayout returned: old=(0,0,1080,2400) new=(0,0,1080,2400) req=(1080,2400)0 dur=3 res=0x0 s={true 0xb400007ab644bdf0} ch=false seqId=0
2023-02-01 15:12:18.117 24820-25275 ChannelIO ...call(193): com.example                    E  SocketManager.onConnect(), false
2023-02-01 15:12:18.117 24820-25275 ChannelIO ...emit(282): com.example                    E  SocketManager.emit(), authentication eyJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJzZXMiLCJrZXkiOiI5Nzg1NS02MmVhNGVmYzAxNWE5ZmY4NjRkYiIsImlhdCI6MTY3NTIzMTkzOCwiZXhwIjoxNjc3ODIzOTM4fQ.3YcULTQJmm_1GPBodfZQ4o0cXlIY4LjUyZfqcioogkk
2023-02-01 15:12:18.130 24820-25277 ChannelIO ...call(203): com.example                    E  SocketManager.onReady()
2023-02-01 15:12:18.132 24820-25278 ChannelIO ...call(211): com.example                    E  SocketManager.onReady(), heartbeat
2023-02-01 15:12:18.133 24820-25278 ChannelIO ...emit(282): com.example                    E  SocketManager.emit(), heartbeat 
2023-02-01 15:12:18.144 24820-24820 DecorView               com.example                    I  notifyKeepScreenOnChanged: keepScreenOn=false
2023-02-01 15:12:18.145 24820-24887 Braze v23.3.0 .Braze    com.example                    W  userId passed to changeUser was null or empty. The current user will remain the active user.
2023-02-01 15:12:18.149 24820-24820 ViewRootIm...nActivity] com.example                    D  performTraversals params={(0,0)(fillxfill) sim={adjust=resize} layoutInDisplayCutoutMode=shortEdges ty=BASE_APPLICATION wanim=0x1030309
                                                                                                      fl=81810500
                                                                                                      pfl=16020040
                                                                                                      apr=LIGHT_STATUS_BARS
                                                                                                      bhv=SHOW_TRANSIENT_BARS_BY_SWIPE
                                                                                                      fitSides= naviIconColor=0
                                                                                                      sfl=100000}
2023-02-01 15:12:18.149 24820-24820 ViewRootIm...nActivity] com.example                    D  performTraversals mFirst=false windowShouldResize=false viewVisibilityChanged=false mForceNextWindowRelayout=false params={(0,0)(fillxfill) sim={adjust=resize} layoutInDisplayCutoutMode=shortEdges ty=BASE_APPLICATION wanim=0x1030309
                                                                                                      fl=81810500
                                                                                                      pfl=16020040
                                                                                                      apr=LIGHT_STATUS_BARS
                                                                                                      bhv=SHOW_TRANSIENT_BARS_BY_SWIPE
                                                                                                      fitSides= naviIconColor=0
                                                                                                      sfl=100000}
2023-02-01 15:12:18.155 24820-24820 BLASTBufferQueue        com.example                    D  update, w= 1080 h= 2400 mNativeObject= 0xb400007a26415d10 sc.mNativeObject= 0xb4000079b64ec3a0 format= -1 caller= android.view.ViewRootImpl.updateBlastSurfaceIfNeeded:2778 android.view.ViewRootImpl.relayoutWindow:9635 android.view.ViewRootImpl.performTraversals:3759 android.view.ViewRootImpl.doTraversal:2991 android.view.ViewRootImpl$TraversalRunnable.run:10665 android.view.Choreographer$CallbackRecord.run:1301 
2023-02-01 15:12:18.155 24820-24820 ViewRootIm...nActivity] com.example                    I  Relayout returned: old=(0,0,1080,2400) new=(0,0,1080,2400) req=(1080,2400)0 dur=4 res=0x0 s={true 0xb400007ab644bdf0} ch=false seqId=0
2023-02-01 15:12:18.163 24820-24914 Braze v23....ssionUtils com.example                    V  Attempting to execute requestPushPermissionPrompt()
2023-02-01 15:12:18.163 24820-24914 Braze v23....ssionUtils com.example                    I  Notification permission already granted, doing nothing.
2023-02-01 15:12:18.163 24820-24914 Braze v23....ssionUtils com.example                    D  Permission prompt would not display, not attempting to request push permission prompt.
2023-02-01 15:12:18.163 24820-24914 Braze v23....ageManager com.example                    D  Custom InAppMessageManagerListener set
2023-02-01 15:12:18.201 24820-24820 DecorView               com.example                    I  notifyKeepScreenOnChanged: keepScreenOn=false
2023-02-01 15:12:18.203 24820-24820 DecorView               com.example                    I  notifyKeepScreenOnChanged: keepScreenOn=false
2023-02-01 15:12:18.203 24820-24820 DecorView               com.example                    I  notifyKeepScreenOnChanged: keepScreenOn=false
2023-02-01 15:12:18.207 24820-24820 ViewRootIm...nActivity] com.example                    D  performTraversals params={(0,0)(fillxfill) sim={adjust=resize} layoutInDisplayCutoutMode=shortEdges ty=BASE_APPLICATION wanim=0x1030309
                                                                                                      fl=81810900
                                                                                                      pfl=16020040
                                                                                                      apr=LIGHT_STATUS_BARS
                                                                                                      bhv=SHOW_TRANSIENT_BARS_BY_SWIPE
                                                                                                      fitSides= naviIconColor=0
                                                                                                      sfl=100000}
2023-02-01 15:12:18.207 24820-24820 InsetsSourceConsumer    com.example                    D  setRequestedVisible: visible=true, type=20, host=com.example/com.example.MainActivity, from=android.view.InsetsSourceConsumer.show:250 android.view.InsetsController.collectSourceControls:1303 android.view.InsetsController.controlAnimationUnchecked:1164 android.view.InsetsController.applyAnimation:1576 android.view.InsetsController.applyAnimation:1557 android.view.InsetsController.show:1063 android.view.InsetsController.show:1004 android.view.ViewRootImpl.controlInsetsForCompatibility:3217 android.view.ViewRootImpl.performTraversals:3708 android.view.ViewRootImpl.doTraversal:2991 
2023-02-01 15:12:18.207 24820-24820 InsetsController        com.example                    D  controlAnimationUnchecked: Added types=1 animType=0 host=com.example/com.example.MainActivity from=android.view.InsetsController.applyAnimation:1576 android.view.InsetsController.applyAnimation:1557 android.view.InsetsController.show:1063 
2023-02-01 15:12:18.207 24820-24820 InsetsSourceConsumer    com.example                    D  setRequestedVisible: visible=true, type=0, host=com.example/com.example.MainActivity, from=android.view.InsetsSourceConsumer.show:250 android.view.InsetsController.showDirectly:1609 android.view.InsetsController.controlAnimationUnchecked:1232 android.view.InsetsController.applyAnimation:1576 android.view.InsetsController.applyAnimation:1557 android.view.InsetsController.show:1063 android.view.InsetsController.show:1004 android.view.ViewRootImpl.controlInsetsForCompatibility:3217 android.view.ViewRootImpl.performTraversals:3708 android.view.ViewRootImpl.doTraversal:2991 
2023-02-01 15:12:18.208 24820-24820 ViewRootIm...nActivity] com.example                    D  performTraversals mFirst=false windowShouldResize=false viewVisibilityChanged=false mForceNextWindowRelayout=false params={(0,0)(fillxfill) sim={adjust=resize} layoutInDisplayCutoutMode=shortEdges ty=BASE_APPLICATION wanim=0x1030309
                                                                                                      fl=81810900
                                                                                                      pfl=16020040
                                                                                                      apr=LIGHT_STATUS_BARS
                                                                                                      bhv=DEFAULT
                                                                                                      fitSides= naviIconColor=0
                                                                                                      sfl=100000}
2023-02-01 15:12:18.211 24820-24834 ViewRootIm...nActivity] com.example                    I  Resizing android.view.ViewRootImpl@9a85871: frame = [0,0][1080,2400] reportDraw = false forceLayout = false syncSeqId = 0
2023-02-01 15:12:18.214 24820-24820 InsetsController        com.example                    D  onStateChanged: InsetsState: {mDisplayFrame=Rect(0, 0 - 1080, 2400), mDisplayCutout=DisplayCutout{insets=Rect(0, 80 - 0, 0) waterfall=Insets{left=0, top=0, right=0, bottom=0} boundingRect={Bounds=[Rect(0, 0 - 0, 0), Rect(510, 0 - 570, 80), Rect(0, 0 - 0, 0), Rect(0, 0 - 0, 0)]} cutoutPathParserInfo={CutoutPathParserInfo{displayWidth=1080 displayHeight=2400 physicalDisplayWidth=1080 physicalDisplayHeight=2400 density={3.0} cutoutSpec={M 0,0 H -10 V 26.66666666666667 H 10 V 0 H 0 Z @dp} rotation={0} scale={1.0} physicalPixelDisplaySizeRatio={1.0}}}}, mRoundedCorners=RoundedCorners{[RoundedCorner{position=TopLeft, radius=96, center=Point(96, 96)}, RoundedCorner{position=TopRight, radius=96, center=Point(984, 96)}, RoundedCorner{position=BottomRight, radius=96, center=Point(984, 2304)}, RoundedCorner{position=BottomLeft, radius=96, center=Point(96, 2304)}]}  mRoundedCornerFrame=Rect(0, 0 - 1080, 2400), mPrivacyIndicatorBounds=PrivacyIndicatorBounds {static bounds=Rect(948, 0 - 1080, 80) rotation=0}, mSources= { InsetsSource: {mType=ITYPE_STATUS_BAR, mFrame=[0,0][1080,80], mVisible=true, mInsetsRoundedCornerFrame=false}, InsetsSource: {mType=ITYPE_NAVIGATION_BAR, mFrame=[0,2256][1080,2400], mVisible=true, mInsetsRoundedCornerFrame=false}, InsetsSource: {mType=ITYPE_LEFT_GESTURES, mFrame=[0,0][0,2400], mVisible=true, mInsetsRoundedCornerFrame=false}, InsetsSource: {mType=ITYPE_RIGHT_GESTURES, mFrame=[1080,0][1080,2400], mVisible=true, mInsetsRoundedCornerFrame=false}, InsetsSource: {mType=ITYPE_TOP_MANDATORY_GESTURES, mFrame=[0,0][1080,116], mVisible=true, mInsetsRoundedCornerFrame=false}, InsetsSource: {mType=ITYPE_BOTTOM_MANDATORY_GESTURES, mFrame=[0,2256][1080,2400], mVisible=true, mInsetsRoundedCornerFrame=false}, InsetsSource: {mType=ITYPE_LEFT_DISPLAY_CUTOUT, mFrame=[0,0][-100000,2400], mVisible=true, mInsetsRoundedCornerFrame=false}, InsetsSource: {mType=ITYPE_TOP_DISPLAY_CUTOUT, mFrame=[0,0][1080,80], mVisible=true, mInsetsRoundedCornerFrame=false}, InsetsSource: {mType=ITYPE_RIGHT_DISPLAY_CUTOUT, mFrame=[100000,0][1080,2400], mVisible=true, mInsetsRoundedCornerFrame=false}, InsetsSource: {mType=ITYPE_BOTTOM_DISPLAY_CUTOUT, mFrame=[0,100000][1080,2400], mVisible=true, mInsetsRoundedCornerFrame=false}, InsetsSource: {mType=ITYPE_TOP_TAPPABLE_ELEMENT, mFrame=[0,0][1080,80], mVisible=true, mInsetsRoundedCornerFrame=false}, InsetsSource: {mType=ITYPE_BOTTOM_TAPPABLE_ELEMENT, mFrame=[0,2256][1080,2400], mVisible=true, mInsetsRoundedCornerFrame=false}, InsetsSource: {mType=ITYPE_IME, mFrame=[0,0][0,0], mVisibleFrame=[0,1506][1080,2400], mVisible=false, mInsetsRoundedCornerFrame=false} } host=com.example/com.example.MainActivity from=android.view.ViewRootImpl.relayoutWindow:9590
2023-02-01 15:12:18.215 24820-24820 DecorView               com.example                    I  onImmersiveModeChanged: isStatusBarHidden=false
2023-02-01 15:12:18.215 24820-24820 BLASTBufferQueue        com.example                    D  update, w= 1080 h= 2400 mNativeObject= 0xb400007a26415d10 sc.mNativeObject= 0xb4000079b64f1410 format= -1 caller= android.view.ViewRootImpl.updateBlastSurfaceIfNeeded:2778 android.view.ViewRootImpl.relayoutWindow:9635 android.view.ViewRootImpl.performTraversals:3759 android.view.ViewRootImpl.doTraversal:2991 android.view.ViewRootImpl$TraversalRunnable.run:10665 android.view.Choreographer$CallbackRecord.run:1301 
2023-02-01 15:12:18.215 24820-24820 ViewRootIm...nActivity] com.example                    I  Relayout returned: old=(0,0,1080,2400) new=(0,0,1080,2400) req=(1080,2400)0 dur=7 res=0x0 s={true 0xb400007ab644bdf0} ch=false seqId=0
2023-02-01 15:12:18.219 24820-24820 ViewRootIm...nActivity] com.example                    I  handleResized, msg = 4 frames=ClientWindowFrames{frame=[0,0][1080,2400] display=[0,0][1080,2400] parentFrame=[0,0][0,0] parentClippedByDisplayCutout=false} forceNextWindowRelayout=false displayId=0 resizeMode=-1 frameChanged=false displayFrameChanged=false configChanged=false displayChanged=false
2023-02-01 15:12:18.425 24820-24820 ScrollView              com.example                    D  initGoToTop
2023-02-01 15:12:18.491 24820-24820 InsetsController        com.example                    D  cancelAnimation of types: 1, animType: 0, host: com.example/com.example.MainActivity, from:android.view.InsetsController.notifyFinished:1375 android.view.InsetsAnimationThreadControlRunner$1.lambda$notifyFinished$0$android-view-InsetsAnimationThreadControlRunner$1:84 android.view.InsetsAnimationThreadControlRunner$1$$ExternalSyntheticLambda1.run:4 
2023-02-01 15:12:18.492 24820-24820 InsetsSourceConsumer    com.example                    D  ensureControlPosition: Point(0, 0) for ITYPE_STATUS_BAR on com.example/com.example.MainActivity from android.view.InsetsSourceConsumer.notifyAnimationFinished:417
2023-02-01 15:12:18.499 24820-25081 ViewRootIm...nActivity] com.example                    I  mWNT: t=0xb4000079e646c9f0 mBlastBufferQueue=0xb400007a26415d10 fn= 217 caller= android.view.SyncRtSurfaceTransactionApplier.applyTransaction:96 android.view.SyncRtSurfaceTransactionApplier.lambda$scheduleApply$0$android-view-SyncRtSurfaceTransactionApplier:69 android.view.SyncRtSurfaceTransactionApplier$$ExternalSyntheticLambda0.onFrameDraw:4 
2023-02-01 15:12:18.499 24820-25081 BLASTBufferQueue        com.example                    D  mergeWithNextTransaction, mNativeObject= 0xb400007a26415d10 t.mNativeObject= 0xb4000079e646c9f0 frameNumber= 217 caller= android.view.ViewRootImpl.mergeWithNextTransaction:12594 android.view.SyncRtSurfaceTransactionApplier.applyTransaction:96 android.view.SyncRtSurfaceTransactionApplier.lambda$scheduleApply$0$android-view-SyncRtSurfaceTransactionApplier:69 android.view.SyncRtSurfaceTransactionApplier$$ExternalSyntheticLambda0.onFrameDraw:4 android.graphics.HardwareRenderer$FrameDrawingCallback.onFrameDraw:924 android.view.ViewRootImpl$6.onFrameDraw:2053 
2023-02-01 15:12:18.571 24820-24820 ScrollView              com.example                    D  initGoToTop
2023-02-01 15:12:18.614 24820-24830 .com.example          com.example                    W  Cleared Reference was only reachable from finalizer (only reported once)
2023-02-01 15:12:18.624 24820-24832 System                  com.example                    W  A resource failed to call release. 
2023-02-01 15:12:23.089 24820-24887 Braze v23....onProvider com.example                    D  Unable to find the xml BOOLEAN configuration value with primary key 'com_braze_ephemeral_events_enabled'.Using default value 'false'.
2023-02-01 15:12:23.089 24820-24887 Braze v23....onProvider com.example                    D  Using resources value for key: 'com_braze_ephemeral_events_enabled' and value: 'false'
2023-02-01 15:12:23.089 24820-24887 Braze v23.3.0 .t        com.example                    D  Checking if this session needs to be sealed: e2aff000-023c-48a9-bc45-12eb4cd68b19
2023-02-01 15:12:23.089 24820-24887 Braze v23.3.0 .t        com.example                    D  Checking if this session needs to be sealed: e2aff000-023c-48a9-bc45-12eb4cd68b19
2023-02-01 15:12:23.089 24820-24887 Braze v23.3.0 .p        com.example                    V  Attempting to log event: {
                                                                                                      "name": "ce",
                                                                                                      "data": {
                                                                                                        "n": "view_estimation_request_all_sent"
                                                                                                      },
                                                                                                      "time": 1.675231943088E9,
                                                                                                      "user_id": "example",
                                                                                                      "session_id": "e2aff000-023c-48a9-bc45-12eb4cd68b19"
                                                                                                    }
2023-02-01 15:12:23.089 24820-24887 Braze v23.3.0 .z0       com.example                    D  bo.app.o0 fired: commandType = ADD_BRAZE_EVENT
                                                                                                    brazeEvent = {"name":"ce","data":{"n":"view_estimation_request_all_sent"},"time":1.675231943088E9,"user_id":"example","session_id":"e2aff000-023c-48a9-bc45-12eb4cd68b19"}
                                                                                                    sessionId = null
                                                                                                    brazeRequest = null
2023-02-01 15:12:23.089 24820-24887 Braze v23.3.0 .z0       com.example                    D  Triggering bo.app.o0 on 1 subscribers.
2023-02-01 15:12:23.089 24820-24887 Braze v23.....bo.app.k6 com.example                    D  In flight trigger requests is empty. Executing any pending trigger events.
2023-02-01 15:12:23.089 24820-24887 Braze v23.....bo.app.k6 com.example                    D  New incoming <custom_event>. Searching for matching triggers.
2023-02-01 15:12:23.089 24820-24887 Braze v23.....bo.app.k6 com.example                    D  Failed to match triggered action for incoming <custom_event>.
2023-02-01 15:12:23.089 24820-24887 Braze v23.3.0 .k6       com.example                    D  No action found for custom_event event, publishing NoMatchingTriggerEvent
2023-02-01 15:12:23.089 24820-24887 Braze v23.3.0 .z0       com.example                    D  com.braze.events.NoMatchingTriggerEvent fired: NoMatchingTriggerEvent(sourceEventType=custom_event)
2023-02-01 15:12:23.089 24820-24887 Braze v23.3.0 .z0       com.example                    I  Event was published, but no subscribers were found. But not saving event for publishing later. Event class: class com.braze.events.NoMatchingTriggerEvent
2023-02-01 15:12:23.089 24820-24883 Braze v23.3.0 .o5       com.example                    D  Adding event to storage with uid 3168ceef-11b0-4cf7-a1ba-bf72a5d63dfb
2023-02-01 15:12:25.637 24820-24887 Braze v23.3.0 .Braze    com.example                    I  Requesting immediate data flush to Braze.
2023-02-01 15:12:25.638 24820-24887 Braze v23.3.0 .z0       com.example                    D  bo.app.o0 fired:             commandType = ADD_REQUEST
                                                                                                                brazeEvent = null
                                                                                                                sessionId = null
                                                                                                                brazeRequest = {
                                                                                                      "respond_with": {
                                                                                                        "user_id": "example",
                                                                                                        "config": {
                                                                                                          "config_time": 1670833628
                                                                                                        }
                                                                                                      }
                                                                                                    }
2023-02-01 15:12:25.638 24820-24887 Braze v23.3.0 .z0       com.example                    D  Triggering bo.app.o0 on 1 subscribers.
2023-02-01 15:12:25.638 24820-24887 Braze v23.3.0 .q0       com.example                    V  Added request to dispatcher with parameters: 
                                                                                                    {
                                                                                                      "respond_with": {
                                                                                                        "user_id": "example",
                                                                                                        "config": {
                                                                                                          "config_time": 1670833628
                                                                                                        }
                                                                                                      }
                                                                                                    }
2023-02-01 15:12:25.642 24820-24883 Braze v23.3.0 .q0       com.example                    V  SDK Auth is disabled, not adding token to request
2023-02-01 15:12:25.645 24820-24883 Braze v23.3.0 .k0       com.example                    D  Cache locked successfully for export: bo.app.k0@bba2b14
2023-02-01 15:12:25.645 24820-24883 Braze v23.3.0 .t6       com.example                    D  Cache locked successfully for export: bo.app.t6@57cdd0a
2023-02-01 15:12:25.645 24820-24883 Braze v23.3.0 .q0       com.example                    D  Event dispatched: {"name":"ce","data":{"n":"view_estimation_request_all_sent"},"time":1.675231943088E9,"user_id":"example","session_id":"e2aff000-023c-48a9-bc45-12eb4cd68b19"} with uid: 3168ceef-11b0-4cf7-a1ba-bf72a5d63dfb
2023-02-01 15:12:25.646 24820-24883 Braze v23.3.0 .m3       com.example                    D  Making request with id => "4d7610aba493c6a4"
                                                                                                    to url: https://sdk.iad-03.braze.com/api/v3/data
                                                                                                                
                                                                                                    with headers:
                                                                                                    "Accept-Encoding" => "gzip, deflate"
                                                                                                    "Content-Type" => "application/json"
                                                                                                    "X-Braze-Api-Key" => "1c2680d7-1a42-4796-9739-65ceb1e2ff1c"
                                                                                                    
                                                                                                    and JSON :
                                                                                                    {
                                                                                                      "device_id": "cef795bd-e51c-490a-918a-00473978d0cf",
                                                                                                      "time": 1675231945,
                                                                                                      "api_key": "1c2680d7-1a42-4796-9739-65ceb1e2ff1c",
                                                                                                      "sdk_version": "23.3.0",
                                                                                                      "app_version": "3.3.4",
                                                                                                      "app_version_code": "299.0.0.0",
                                                                                                      "events": [
                                                                                                        {
                                                                                                          "name": "ce",
                                                                                                          "data": {
                                                                                                            "n": "view_estimation_request_all_sent"
                                                                                                          },
                                                                                                          "time": 1.675231943088E9,
                                                                                                          "user_id": "example",
                                                                                                          "session_id": "e2aff000-023c-48a9-bc45-12eb4cd68b19"
                                                                                                        }
                                                                                                      ],
                                                                                                      "sdk_flavor": "react",
                                                                                                      "respond_with": {
                                                                                                        "user_id": "example",
                                                                                                        "config": {
                                                                                                          "config_time": 1670833628
                                                                                                        }
                                                                                                      }
                                                                                                    }
2023-02-01 15:12:26.043 24820-24883 Braze v23.3.0 .m3       com.example                    D  Result(id = 4d7610aba493c6a4 time = 397ms)
                                                                                                    {}
2023-02-01 15:12:26.043 24820-24883 Braze v23.....bo.app.m6 com.example                    D  Triggered actions Json array was null. Not de-serializing triggered actions.
2023-02-01 15:12:26.043 24820-24883 Braze v23.....bo.app.m6 com.example                    D  Templated message Json was null. Not de-serializing templated message.
2023-02-01 15:12:26.043 24820-24883 Braze v23.3.0 .i0       com.example                    D  DataSyncRequest executed successfully.
2023-02-01 15:12:26.043 24820-24883 Braze v23.3.0 .s        com.example                    V  Processing server response payload for user with id: example
2023-02-01 15:12:26.044 24820-24883 Braze v23.3.0 .z0       com.example                    D  bo.app.u4 fired: RequestNetworkSuccessEvent(request={
                                                                                                      "device_id": "cef795bd-e51c-490a-918a-00473978d0cf",
                                                                                                      "time": 1675231945,
                                                                                                      "api_key": "1c2680d7-1a42-4796-9739-65ceb1e2ff1c",
                                                                                                      "sdk_version": "23.3.0",
                                                                                                      "app_version": "3.3.4",
                                                                                                      "app_version_code": "299.0.0.0",
                                                                                                      "events": [
                                                                                                        {
                                                                                                          "name": "ce",
                                                                                                          "data": {
                                                                                                            "n": "view_estimation_request_all_sent"
                                                                                                          },
                                                                                                          "time": 1.675231943088E9,
                                                                                                          "user_id": "example",
                                                                                                          "session_id": "e2aff000-023c-48a9-bc45-12eb4cd68b19"
                                                                                                        }
                                                                                                      ],
                                                                                                      "sdk_flavor": "react",
                                                                                                      "respond_with": {
                                                                                                        "user_id": "example",
                                                                                                        "config": {
                                                                                                          "config_time": 1670833628
                                                                                                        }
                                                                                                      }
                                                                                                    })
2023-02-01 15:12:26.044 24820-24883 Braze v23.3.0 .z0       com.example                    D  Triggering bo.app.u4 on 1 subscribers.
2023-02-01 15:12:26.044 24820-24883 Braze v23.3.0 .z0       com.example                    D  bo.app.r0 fired: DispatchSucceededEvent(request={
                                                                                                      "device_id": "cef795bd-e51c-490a-918a-00473978d0cf",
                                                                                                      "time": 1675231945,
                                                                                                      "api_key": "1c2680d7-1a42-4796-9739-65ceb1e2ff1c",
                                                                                                      "sdk_version": "23.3.0",
                                                                                                      "app_version": "3.3.4",
                                                                                                      "app_version_code": "299.0.0.0",
                                                                                                      "events": [
                                                                                                        {
                                                                                                          "name": "ce",
                                                                                                          "data": {
                                                                                                            "n": "view_estimation_request_all_sent"
                                                                                                          },
                                                                                                          "time": 1.675231943088E9,
                                                                                                          "user_id": "example",
                                                                                                          "session_id": "e2aff000-023c-48a9-bc45-12eb4cd68b19"
                                                                                                        }
                                                                                                      ],
                                                                                                      "sdk_flavor": "react",
                                                                                                      "respond_with": {
                                                                                                        "user_id": "example",
                                                                                                        "config": {
                                                                                                          "config_time": 1670833628
                                                                                                        }
                                                                                                      }
                                                                                                    })
2023-02-01 15:12:26.044 24820-24883 Braze v23.3.0 .z0       com.example                    D  Triggering bo.app.r0 on 1 subscribers.
2023-02-01 15:12:26.044 24820-24883 Braze v23.3.0 .k0       com.example                    V  Notifying confirmAndUnlock listeners for cache: bo.app.k0@bba2b14
2023-02-01 15:12:26.044 24820-24883 Braze v23.3.0 .t6       com.example                    V  Notifying confirmAndUnlock listeners for cache: bo.app.t6@57cdd0a
2023-02-01 15:12:26.045 24820-24883 Braze v23.3.0 .e5       com.example                    V  Attempting to unlock server config info.
2023-02-01 15:12:26.045 24820-24883 Braze v23.3.0 .e5       com.example                    D  Unlocking config info lock.
2023-02-01 15:12:26.045 24820-24886 Braze v23.3.0 .o5       com.example                    D  Deleting event from storage with uid 3168ceef-11b0-4cf7-a1ba-bf72a5d63dfb
2023-02-01 15:12:35.638 24820-24884 Braze v23....eCoroutine com.example                    V  Requesting data flush from automatic sync policy
2023-02-01 15:12:35.639 24820-24887 Braze v23.3.0 .Braze    com.example                    I  Requesting immediate data flush to Braze.
2023-02-01 15:12:35.640 24820-24887 Braze v23.3.0 .z0       com.example                    D  bo.app.o0 fired:             commandType = ADD_REQUEST
                                                                                                                brazeEvent = null
                                                                                                                sessionId = null
                                                                                                                brazeRequest = {
                                                                                                      "respond_with": {
                                                                                                        "user_id": "example",
                                                                                                        "config": {
                                                                                                          "config_time": 1670833628
                                                                                                        }
                                                                                                      }
                                                                                                    }
2023-02-01 15:12:35.640 24820-24887 Braze v23.3.0 .z0       com.example                    D  Triggering bo.app.o0 on 1 subscribers.
2023-02-01 15:12:35.640 24820-24887 Braze v23.3.0 .q0       com.example                    V  Added request to dispatcher with parameters: 
                                                                                                    {
                                                                                                      "respond_with": {
                                                                                                        "user_id": "example",
                                                                                                        "config": {
                                                                                                          "config_time": 1670833628
                                                                                                        }
                                                                                                      }
                                                                                                    }
2023-02-01 15:12:35.641 24820-24884 Braze v23.3.0 .q0       com.example                    V  SDK Auth is disabled, not adding token to request
2023-02-01 15:12:35.646 24820-24884 Braze v23.3.0 .k0       com.example                    D  Cache locked successfully for export: bo.app.k0@bba2b14
2023-02-01 15:12:35.646 24820-24884 Braze v23.3.0 .t6       com.example                    D  Cache locked successfully for export: bo.app.t6@57cdd0a
2023-02-01 15:12:35.646 24820-24884 Braze v23.3.0 .s0       com.example                    D  Short circuiting execution of network request and immediately marking it as succeeded.
2023-02-01 15:12:35.647 24820-24884 Braze v23.3.0 .i0       com.example                    D  DataSyncRequest executed successfully.
2023-02-01 15:12:35.647 24820-24884 Braze v23.3.0 .z0       com.example                    D  bo.app.r0 fired: DispatchSucceededEvent(request={
                                                                                                      "device_id": "cef795bd-e51c-490a-918a-00473978d0cf",
                                                                                                      "time": 1675231955,
                                                                                                      "api_key": "1c2680d7-1a42-4796-9739-65ceb1e2ff1c",
                                                                                                      "sdk_version": "23.3.0",
                                                                                                      "app_version": "3.3.4",
                                                                                                      "app_version_code": "299.0.0.0",
                                                                                                      "sdk_flavor": "react",
                                                                                                      "respond_with": {
                                                                                                        "user_id": "example",
                                                                                                        "config": {
                                                                                                          "config_time": 1670833628
                                                                                                        }
                                                                                                      }
                                                                                                    })
2023-02-01 15:12:35.647 24820-24884 Braze v23.3.0 .z0       com.example                    D  Triggering bo.app.r0 on 1 subscribers.
2023-02-01 15:12:35.647 24820-24884 Braze v23.3.0 .k0       com.example                    V  Notifying confirmAndUnlock listeners for cache: bo.app.k0@bba2b14
2023-02-01 15:12:35.647 24820-24884 Braze v23.3.0 .t6       com.example                    V  Notifying confirmAndUnlock listeners for cache: bo.app.t6@57cdd0a
2023-02-01 15:12:35.647 24820-24884 Braze v23.3.0 .e5       com.example                    V  Attempting to unlock server config info.
2023-02-01 15:12:35.647 24820-24884 Braze v23.3.0 .e5       com.example                    D  Unlocking config info lock.
2023-02-01 15:12:43.441 24820-25043 TrafficStats            com.example                    D  tagSocket(6) with statsTag=0xffffffff, statsUid=-1
2023-02-01 15:12:45.640 24820-24883 Braze v23....eCoroutine com.example                    V  Requesting data flush from automatic sync policy
2023-02-01 15:12:45.641 24820-24887 Braze v23.3.0 .Braze    com.example                    I  Requesting immediate data flush to Braze.
2023-02-01 15:12:45.641 24820-24887 Braze v23.3.0 .z0       com.example                    D  bo.app.o0 fired:             commandType = ADD_REQUEST
 

@ko-devHong
Copy link

i'm using react-native-code-push : 7.1.0(use patch) , react-native : 0.71.1

Android & Ios both not working codepush

@brantleyenglish
Copy link

brantleyenglish commented Feb 15, 2023

I ran into this issue with hermes disabled. After a while, I tested adding
apply from: "../../node_modules/react-native/react.gradle" back in above
apply from: "../../node_modules/react-native-code-push/android/codepush.gradle".

It gives a deprecated warning, but it seems to build on Android now with npx react-native run-android.

@RnbWd
Copy link

RnbWd commented Feb 17, 2023

I ran into this issue with hermes disabled. After a while, I tested adding apply from: "../../node_modules/react-native/react.gradle" back in above apply from: "../../node_modules/react-native-code-push/android/codepush.gradle".

It gives a deprecated warning, but it seems to build on Android now with npx react-native run-android.

same here, but I cannot run hermes on android

@rufat
Copy link

rufat commented Feb 19, 2023

Update: I have forked and merged these changes for the newer RN versions: npm i react-native-code-push-next

react-native-code-push-next


For React Native 0.71.2 and react-native-code-push 7.1.0 based on #2419 by @johnf

react-native-code-push+7.1.0.patch

diff --git a/node_modules/react-native-code-push/android/codepush.gradle b/node_modules/react-native-code-push/android/codepush.gradle
...

Thank you! This should be merged immediately! (RN 0.71.3)

@create-jeong
Copy link

@rufat
Thanks for your effort to apply the patch to a newer package! 👍
While I resolve this issue with your package, I found out a glitch in your repo.
Please consider to apply this fix to your package until an official fix releases!

diff --git a/node_modules/react-native-code-push-next/android/codepush.gradle b/node_modules/react-native-code-push-next/android/codepush.gradle

-                commandLine (*nodeExecutableAndArgs, "${nodeModulesPath}/react-native-code-push/scripts/generateBundledResourcesHash.js", resourcesDir, jsBundleFile, jsBundleDir)
+                commandLine (*nodeExecutableAndArgs, "${nodeModulesPath}/react-native-code-push-next/scripts/generateBundledResourcesHash.js", resourcesDir, jsBundleFile, jsBundleDir)

-                commandLine (*nodeExecutableAndArgs, "${nodeModulesPath}/react-native-code-push/scripts/generateBundledResourcesHash.js", resourcesDir, jsBundleFile, jsBundleDir, resourcesMapTempFileName)
+                commandLine (*nodeExecutableAndArgs, "${nodeModulesPath}/react-native-code-push-next/scripts/generateBundledResourcesHash.js", resourcesDir, jsBundleFile, jsBundleDir, resourcesMapTempFileName)

-                commandLine (*nodeExecutableAndArgs, "${nodeModulesPath}/react-native-code-push/scripts/recordFilesBeforeBundleCommand.js", resourcesDir, resourcesMapTempFileName)
+                commandLine (*nodeExecutableAndArgs, "${nodeModulesPath}/react-native-code-push-next/scripts/recordFilesBeforeBundleCommand.js", resourcesDir, resourcesMapTempFileName)

@rufat
Copy link

rufat commented Feb 21, 2023

@rufat Thanks for your effort to apply the patch to a newer package! 👍 While I resolve this issue with your package, I found out a glitch in your repo. Please consider to apply this fix to your package until an official fix releases!

diff --git a/node_modules/react-native-code-push-next/android/codepush.gradle b/node_modules/react-native-code-push-next/android/codepush.gradle

-                commandLine (*nodeExecutableAndArgs, "${nodeModulesPath}/react-native-code-push/scripts/generateBundledResourcesHash.js", resourcesDir, jsBundleFile, jsBundleDir)
+                commandLine (*nodeExecutableAndArgs, "${nodeModulesPath}/react-native-code-push-next/scripts/generateBundledResourcesHash.js", resourcesDir, jsBundleFile, jsBundleDir)

-                commandLine (*nodeExecutableAndArgs, "${nodeModulesPath}/react-native-code-push/scripts/generateBundledResourcesHash.js", resourcesDir, jsBundleFile, jsBundleDir, resourcesMapTempFileName)
+                commandLine (*nodeExecutableAndArgs, "${nodeModulesPath}/react-native-code-push-next/scripts/generateBundledResourcesHash.js", resourcesDir, jsBundleFile, jsBundleDir, resourcesMapTempFileName)

-                commandLine (*nodeExecutableAndArgs, "${nodeModulesPath}/react-native-code-push/scripts/recordFilesBeforeBundleCommand.js", resourcesDir, resourcesMapTempFileName)
+                commandLine (*nodeExecutableAndArgs, "${nodeModulesPath}/react-native-code-push-next/scripts/recordFilesBeforeBundleCommand.js", resourcesDir, resourcesMapTempFileName)

Thank you for letting me know. I have fixed it.

johnf added a commit to johnf/react-native-code-push that referenced this issue Feb 21, 2023
React native now uses react-native-gradle-plugin, which works a bit
differently.
@RnbWd
Copy link

RnbWd commented Mar 1, 2023

Is there any fix for this error? apply from: "../../node_modules/react-native/react.gradle" (Using react.gradle in your project is deprecated). This might be preventing me from using Hermes in my app.

Is anyone using 0.71 with hermes enabled and codepush working?

@arlovip
Copy link

arlovip commented Mar 1, 2023

@RnbWd I'm using RN 0.71.1, now it works with @johnf's fix above. But I'm waiting for the official fix on a new release.

@arnaud9145
Copy link

arnaud9145 commented Mar 2, 2023

I'm having that problem too. I am using custom build variant. I'm using RN 0.71.3 and codepush 7.1.0.

When I try to build for variant "uatRelease", the android build fails on "mergeUatReleaseResources" because of duplicate assets. Those assets are from @react-navigation/elements (the android back arrow here), but everything is fine when building without codepush and this line in app/build.gradle:

apply from: "../../node_modules/react-native/react.gradle"

I investigated a bit, and it seems during the build that assets are copied to android/app/build/generated/res/react/uat/release/ and to android/app/build/generated/res/react/uatRelease/ too. Since the same asset is copied in two folders, it causes duplicate assets

It happened after applying this patch (inspired by @rufat) :

react-native-code-push+7.1.0.patch

diff --git a/node_modules/react-native-code-push/android/codepush.gradle b/node_modules/react-native-code-push/android/codepush.gradle
index 78134d3..8a2ca3e 100644
--- a/node_modules/react-native-code-push/android/codepush.gradle
+++ b/node_modules/react-native-code-push/android/codepush.gradle
@@ -2,8 +2,8 @@
 
 import java.nio.file.Paths;
 
-def config = project.hasProperty("react") ? project.react : [];
-def bundleAssetName = config.bundleAssetName ?: "index.android.bundle"
+def config = project.extensions.findByName("react") ?: []
+def bundleAssetName = config.bundleAssetName.get() ?: "index.android.bundle"
 
 // because elvis operator
 def elvisFile(thing) {
@@ -24,10 +24,15 @@ android.buildTypes.each { buildType ->
 }
 
 gradle.projectsEvaluated { 
+    def debuggableVariants = config.debuggableVariants.get() ?: ['debug']
+
     android.applicationVariants.all { variant ->
+        if (debuggableVariants.contains(variant.name)) {
+           return;
+        }
         def nodeModulesPath;
         if (config.root) {
-            nodeModulesPath = Paths.get(config.root, "/node_modules");
+            nodeModulesPath = Paths.get(config.root.asFile.get().absolutePath, "/node_modules");
         } else if (project.hasProperty('nodeModulesPath')) {
             nodeModulesPath = project.nodeModulesPath
         } else {
@@ -42,16 +47,16 @@ gradle.projectsEvaluated {
         def jsBundleFile;
 
         // Additional node commandline arguments
-        def nodeExecutableAndArgs = config.nodeExecutableAndArgs ?: ["node"]
-        def extraPackagerArgs = config.extraPackagerArgs ?: []
+        def nodeExecutableAndArgs = config.nodeExecutableAndArgs.get() ?: ["node"]
+        def extraPackagerArgs = config.extraPackagerArgs.get() ?: []
 
         // Make this task run right after the bundle task
         def generateBundledResourcesHash;
 
-        if (variant.hasProperty("bundleJsAndAssets")) {
-            def reactBundleTask = variant.bundleJsAndAssets
-            jsBundleDir = reactBundleTask.generatedAssetsFolders[0].absolutePath
-            resourcesDir = reactBundleTask.generatedResFolders[0].absolutePath
+        def reactBundleTask = tasks.findByName("createBundle${targetName}JsAndAssets")
+        if (reactBundleTask) {
+            jsBundleDir = reactBundleTask.property('jsBundleDir').asFile.get()
+            resourcesDir = reactBundleTask.property('resourcesDir').asFile.get()
             jsBundleFile = file("$jsBundleDir/$bundleAssetName")
 
             generateBundledResourcesHash = tasks.create(
@@ -59,20 +64,18 @@ gradle.projectsEvaluated {
                     type: Exec) {
                 commandLine (*nodeExecutableAndArgs, "${nodeModulesPath}/react-native-code-push/scripts/generateBundledResourcesHash.js", resourcesDir, jsBundleFile, jsBundleDir)
 
-                enabled config."bundleIn${targetName}" ||
-                config."bundleIn${variant.buildType.name.capitalize()}" ?:
-                targetName.toLowerCase().contains("release")
+                enabled !debuggableVariants.contains(variant.name) ?: targetName.toLowerCase().contains("release")
             }
             
             runBefore("merge${targetName}Resources", generateBundledResourcesHash)
             runBefore("merge${targetName}Assets", generateBundledResourcesHash)   
         } else {
             def jsBundleDirConfigName = "jsBundleDir${targetName}"
-            jsBundleDir = elvisFile(config."$jsBundleDirConfigName") ?:
+            jsBundleDir = elvisFile(config."$jsBundleDirConfigName").get() ?:
                     file("$buildDir/intermediates/assets/${targetPath}")
 
             def resourcesDirConfigName = "resourcesDir${targetName}"
-            resourcesDir = elvisFile(config."${resourcesDirConfigName}") ?:
+            resourcesDir = elvisFile(config."${resourcesDirConfigName}").get() ?:
                     file("$buildDir/intermediates/res/merged/${targetPath}")
 
             // In case version of 'Android Plugin for Gradle'' is lower than 1.3.0 
@@ -107,7 +110,8 @@ gradle.projectsEvaluated {
             generateBundledResourcesHash.dependsOn("recordFilesBeforeBundleCommand${targetName}")
         }
 
-        generateBundledResourcesHash.dependsOn("bundle${targetName}JsAndAssets")
+        generateBundledResourcesHash.dependsOn("createBundle${targetName}JsAndAssets")
+        
         runBefore("processArmeabi-v7a${targetName}Resources", generateBundledResourcesHash)
         runBefore("processX86${targetName}Resources", generateBundledResourcesHash)
         runBefore("processUniversal${targetName}Resources", generateBundledResourcesHash)

I think there is a confusion somewhere between the targetName and targetPath, but I cannot figure out where. It can come from react-native's build.gradle too I am not sure, but since this happens only when I try to add codepush I am posting it here.

Anyone has a clue of how to fix this problem ? Maybe another patch of react-native-code-push or react-native directly ?

@ArGeoph
Copy link

ArGeoph commented Mar 2, 2023

@ arnaud9145 @ aquinq. There's an open PR that should fix this issue, so you can either for a new release when this PR gets merged or create your own fork with the fix.

@arnaud9145
Copy link

@ArGeoph Actually I tested the code in the open PR. The code in it generated the patch I sent earlier. It does not fix my problem unfortunately :/
I guess my situation is an edge case the PR does not solve

@johnf
Copy link
Contributor

johnf commented Mar 4, 2023

@arnaud9145 Are you able to share a minimal reproduction using create-react-app that I could debug?

@arnaud9145
Copy link

@johnf I tried my best to reproduce it here : https://github.com/arnaud9145/DebugCodePushRn071

Tell me if you need anything else :)

I included install and launch instructions in the README. Note : I only setup android since my problem is android only. if you need it, I can setup ios too.

What should happen :

When you launch the app in android studio (work in CLI too with yarn android:uat:release), the build will fail with error "Duplicate resources" in :app:mergeUatreleaseResources step. The asset "node_modules_reactnative_libraries_newappscreen_components_logo.png" is duplicated

Why :

The asset is copied twice, once in ./android/app/build/generated/res/react/uat/release/drawable-mdpi/node_modules_reactnative_libraries_newappscreen_components_logo.png and another time in ./android/app/build/generated/res/react/uatRelease/drawable-mdpi/node_modules_reactnative_libraries_newappscreen_components_logo.png

You can check that after the build, the file should be in both folders.

Thanks for your help !

@johnf
Copy link
Contributor

johnf commented Mar 6, 2023

@arnaud9145 Thanks that helped. The problem was this line isn't needed https://github.com/arnaud9145/DebugCodePushRn071/blob/main/android/app/build.gradle#L69

I had neglected to update the README, which I've done now with the new instructions cba29a8

@arnaud9145
Copy link

@johnf That fixed my problem! Thanks a lot 😄

@stefan-schweiger
Copy link

stefan-schweiger commented Mar 15, 2023

For anyone struggling with this and expo 48, here is how I'm doing it:

I'm using this patch #2418 (comment) with patch-package and then I've written a plugin for expo to do the other code push stuff (click to expand):

plugins/expo-codepush/android/codepush.js
const { AndroidConfig, withStringsXml, withSettingsGradle, withAppBuildGradle, withMainApplication } = require('@expo/config-plugins');

const setStrings = (strings, name, value) => {
  // Helper to add string.xml JSON items or overwrite existing items with the same name.
  return AndroidConfig.Strings.setStringItem(
    [
      // XML represented as JSON
      { $: { name, translatable: 'false', moduleConfig: 'true' }, _: value },
    ],
    strings,
  );
};

const applySettings = (gradleSettings) => {
  // Make sure the project does not have the settings already
  if (!gradleSettings.includes(`include ':app', ':react-native-code-push'`)) {
    return (
      gradleSettings +
      `include ':app', ':react-native-code-push'
project(':react-native-code-push').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-code-push/android/app')`
    );
  }

  return gradleSettings;
};

const applyAppBuildGradle = (appGradleBuild) => {
  // Make sure the project does not have the settings already
  if (!appGradleBuild.includes(`codepush.gradle`)) {
    return appGradleBuild.replace(
      /applyNativeModulesAppBuildGradle\(project\)/g,
      `apply from: new File(projectRoot, "node_modules/react-native-code-push/android/codepush.gradle")
applyNativeModulesAppBuildGradle(project)`,
    );
  }

  return appGradleBuild;
};

const applyMainApplication = (mainApplication) => {
  // Make sure the project does not have the code already
  if (!mainApplication.includes(`import com.microsoft.codepush.react.CodePush;`)) {
    let app = mainApplication.replace(
      /import com\.facebook\.react\.PackageList;/g,
      `import com.microsoft.codepush.react.CodePush;

import com.facebook.react.PackageList;`,
    );

    app = app.replace(
      /new DefaultReactNativeHost\(this\) \{/g,
      `new DefaultReactNativeHost(this) {
      @Override
      protected String getJSBundleFile() {
          return CodePush.getJSBundleFile();
      }
`,
    );

    return app;
  }

  return mainApplication;
};

const withAndroidCodePush = (nativeConfig, deploymentKey) => {
  let config = withSettingsGradle(nativeConfig, (config) => {
    config.modResults.contents = applySettings(config.modResults.contents);
    return config;
  });

  config = withAppBuildGradle(config, (config) => {
    config.modResults.contents = applyAppBuildGradle(config.modResults.contents);
    return config;
  });

  config = withMainApplication(config, (config) => {
    config.modResults.contents = applyMainApplication(config.modResults.contents);
    return config;
  });

  config = withStringsXml(config, (config) => {
    config.modResults = setStrings(config.modResults, 'CodePushDeploymentKey', deploymentKey);
    return config;
  });

  return config;
};

module.exports = { withAndroidCodePush };
plugins/expo-codepush/ios/codepush.js
const { withAppDelegate, withInfoPlist } = require('@expo/config-plugins');

const applyAppDelegate = (contents) => {
  // Add import
  if (!contents.includes('#import <CodePush/CodePush.h>')) {
    contents = contents.replace(
      /#import "AppDelegate.h"/g,
      `#import "AppDelegate.h"
#import <CodePush/CodePush.h>`,
    );
  }

  // Add new bundle loading
  contents = contents.replace(
    /return \[\[NSBundle mainBundle\] URLForResource:@"main" withExtension:@"jsbundle"\];/g,
    'return [CodePush bundleURL];',
  );

  return contents;
};

const withIosCodePush = (nativeConfig, deploymentKey) => {
  let config = withAppDelegate(nativeConfig, (config) => {
    config.modResults.contents = applyAppDelegate(config.modResults.contents);
    return config;
  });

  config = withInfoPlist(config, (config) => {
    config.modResults.CodePushDeploymentKey = deploymentKey;
    return config;
  });

  return config;
};

module.exports = { withIosCodePush };
plugins/expo-codepush/index.js
const { withPlugins } = require('@expo/config-plugins');
const { withAndroidCodePush } = require('./android/codepush');
const { withIosCodePush } = require('./ios/codepush');

const withCodepush = (config, { iosDeploymentKey, androidDeploymentKey }) => {
  return withPlugins(config, [
    // iOS
    [withIosCodePush, iosDeploymentKey],
    // Android
    [withAndroidCodePush, androidDeploymentKey],
  ]);
};

module.exports = withCodepush;

and then use it like this in App.json/app.config.js:

{
  expo: {
    // ...
    plugins: [
      [
        './plugins/expo-codepush',
        {
          iosDeploymentKey: '<your-ios-deployment-key>',
          androidDeploymentKey: '<your-android-deployment-key>',
        },
      ]
    ]
  }
}

expo prebuild should now handle everything else for you and you should be able to build without error and working code push (in release mode). Just be aware that the plugin uses unsafe manipulation, meaning that you might need to change the replacement code a bit if you also have other plugins manipulating the same files and that it can break in a future version of expo/react-native.

@vjerryv
Copy link

vjerryv commented Mar 15, 2023

still waiting for the official release

@arlovip
Copy link

arlovip commented Mar 15, 2023

I've been waiting about 2 months for the official release. So when will the new version be released to fix that?

johnf added a commit to johnf/react-native-code-push that referenced this issue Mar 21, 2023
React native now uses react-native-gradle-plugin, which works a bit
differently.
@bmaluff
Copy link
Contributor

bmaluff commented Mar 28, 2023

+def config = project.extensions.findByName("react") ?: []

Hi @luizfelipelaviola, I'm new at this environment, but I think there is a typo in the line above, since it returns an ArrayList, which doesn't have the method get(), rather it has get(int).
So I think it should be fixed returning a map object like this [:], which does support get() method.

@chenop
Copy link

chenop commented Apr 11, 2023

Seems from here that only version 8.x.x supports RN 0.71.

run:

yarn upgrade react-native-code-push --latest

to get it

Also note that the following line was moved to the end of app/build.gradle:

apply from: "../../node_modules/react-native-code-push/android/codepush.gradle"

@bhavya-thrivase
Copy link

My react-native version is 0.71.5 and the react-native-code-push version is 8.0.1 (updated today). I had successfully implemented and tested the codepush functionality 2 weeks before. But suddenly today, its broken.

I was able to identify the cause of the problem being the URL of the maven repository which was initially located at: https://repo.maven.apache.org/maven2/net/minidev/json-smart/maven-metadata.xml, is inaccessible and not reachable. The package although is still trying to access from here.

I was able to figure out the updated URL for the maven-metadata.xml:
https://repo1.maven.org/maven2/net/minidev/json-smart/maven-metadata.xml.

I tried to make changes to the node_modules but was unsuccessful and thought that changes made to the node_modules would not hold for new app installs.

Can someone please resolve this issue?

Thanks in advance

@johnf
Copy link
Contributor

johnf commented Apr 20, 2023

I think maven might have been having issues, their DNS seems to be broken right now

@bhavya-thrivase
Copy link

I think maven might have been having issues, their DNS seems to be broken right now

Thanks for the reply. Then I think all we can do is be patient and wait for it to be fixed

@bhavya-thrivase
Copy link

I think maven might have been having issues, their DNS seems to be broken right now

They have fixed the URL. Will try it and let you know.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests