react-native icon indicating copy to clipboard operation
react-native copied to clipboard

Type mismatch: inferred type is ScalingUtils.ScaleType? but ScalingUtils.ScaleType was expected

Open karol-oman opened this issue 3 years ago • 5 comments

Description

Hey,

Trying to build my android project into an APK but getting this error: Type mismatch: inferred type is ScalingUtils.ScaleType? but ScalingUtils.ScaleType was expected

Version

18.0.0

Output of npx react-native info

System:
  OS: macOS 12.3.1
  CPU: (4) x64 Intel(R) Core(TM) i5-7360U CPU @ 2.30GHz
  Memory: 37.08 MB / 8.00 GB
  Shell: 5.8 - /bin/zsh
 Binaries:
  Node: 17.9.0 - /usr/local/bin/node
  Yarn: 1.22.18 - /usr/local/bin/yarn
  npm: 8.5.5 - /usr/local/bin/npm
  Watchman: 2022.03.21.00 - /usr/local/bin/watchman
 Managers:
  CocoaPods: 1.11.3 - /usr/local/bin/pod
 SDKs:
  iOS SDK:
   Platforms: DriverKit 21.4, iOS 15.4, macOS 12.3, tvOS 15.4, watchOS 8.5
  Android SDK: Not Found
 IDEs:
  Android Studio: 2021.1 AI-211.7628.21.2111.8309675
  Xcode: 13.3/13E113 - /usr/bin/xcodebuild
 Languages:
  Java: 11.0.14 - /usr/bin/javac
 npmPackages:
  @react-native-community/cli: Not Found
  react: Not Found
  react-native: Not Found
  react-native-macos: Not Found
 npmGlobalPackages:
  *react-native*: Not Found

Steps to reproduce

None so far.

Snack, code example, screenshot, or link to a repository

override fun create(options: SharedElementTransitionOptions): Animator {
        with(to as ReactImageView) {
            hierarchy.actualImageScaleType = InterpolatingScaleType(
                    getScaleType(from),
                    getScaleType(to),
                    calculateBounds(from),
                    calculateBounds(to)
            )
            return ObjectAnimator.ofObject(TypeEvaluator<Float> { fraction: Float, _: Any, _: Any ->
                hierarchy.actualImageScaleType?.let {
                    (hierarchy.actualImageScaleType as InterpolatingScaleType?)!!.value = fraction
                    to.invalidate()
                }
                null
            }, 0, 1).setDuration(options.getDuration())
        }
    }

karol-oman avatar Apr 22 '22 12:04 karol-oman

18.0.0

This is not a react-native version. Please update your issue description

cortinico avatar May 06 '22 19:05 cortinico

I also have the same problem

Please help me!!

error Failed to install the app. Make sure you have the Android development environment set up: https://reactnative.dev/docs/environment-setup. Error: Command failed: gradlew.bat app:installDebug -PreactNativeDevServerPort=8081 e: D:\dev\ReactNative\app_mobile_eu-source_new_110522\node_modules\react-native-navigation\lib\android\app\src\main\java\com\reactnativenavigation\views\element\animators\MatrixAnimator.kt: (21, 21): Type mismatch: inferred type is ScalingUtils.ScaleType? but ScalingUtils.ScaleType was expected e: D:\dev\ReactNative\app_mobile_eu-source_new_110522\node_modules\react-native-navigation\lib\android\app\src\main\java\com\reactnativenavigation\views\element\animators\MatrixAnimator.kt: (22, 21): Type mismatch: inferred type is ScalingUtils.ScaleType? but ScalingUtils.ScaleType was expected

react-native info

System: OS: Windows 10 10.0.19043 CPU: (12) x64 11th Gen Intel(R) Core(TM) i5-11400 @ 2.60GHz
Memory: 2.60 GB / 15.81 GB Binaries: Node: 17.9.0 - C:\Program Files\nodejs\node.EXE Yarn: 1.22.4 - C:\Program Files (x86)\Yarn\bin\yarn.CMD npm: 8.5.5 - C:\Program Files\nodejs\npm.CMD Watchman: Not Found SDKs: Android SDK: Not Found Windows SDK: Not Found IDEs: Android Studio: Version 2021.1.0.0 AI-211.7628.21.2111.8309675 Visual Studio: Not Found Languages: Java: 1.8.0_211 - C:\Program Files\Java\jdk1.8.0_211\bin\javac.EXE npmPackages: @react-native-community/cli: Not Found react: 16.11.0 => 16.11.0 react-native: ^0.68.2 => 0.68.2 react-native-windows: Not Found npmGlobalPackages: react-native: Not Found

Thanks!!!

suusofttruongnv avatar May 12 '22 03:05 suusofttruongnv

As a temporary workaround, you can delete the question mark at line 53 and 57 of the "node_modules/react-native-navigation/lib/android/app/src/main/java/com/reactnativenavigation/views/element/animators/ReactImageMatrixAnimator.kt"

JB712 avatar May 16 '22 07:05 JB712

Any body fix it?

trantansang avatar Nov 06 '22 02:11 trantansang

I am facing the same issue here.

mawais78 avatar Nov 07 '22 11:11 mawais78

same issue on react 0.63.3

emeagenciadigital avatar Nov 24 '22 15:11 emeagenciadigital

same issue on 0.64.1

mikepaszkiewicz avatar Dec 02 '22 02:12 mikepaszkiewicz

Hey. I've got the same issue.

Nothing changed in the project before the last successful build. After few weeks when I tried to build the app, During building I've got error that I had to change kotlinVersion. After upgrade from 1.3.72 to 1.6.21 in build.gradle I have this issue.

react-native 0.63.

dexterowy avatar Dec 06 '22 15:12 dexterowy

Okay, I found the solution for me, maybe it will also fix your issues.

The problem was related to issue fixed here https://github.com/facebook/react-native/issues/35210#issue-1436785719

Just try to install patch for your version. I reverted everything to the state I left the app when it worked and successfully build. So no changes with kotlinVersion and minSdkVersion were required with that fix.

dexterowy avatar Dec 06 '22 15:12 dexterowy

This issue is waiting for author's feedback since 24 days. Please provide the requested feedback or this will be closed in 7 days.

github-actions[bot] avatar Jan 25 '23 02:01 github-actions[bot]

This issue was closed because the author hasn't provided the requested feedback after 7 days.

github-actions[bot] avatar Feb 01 '23 02:02 github-actions[bot]