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

Android release build fails "Error: no such scale" #22601

Closed
timkuilman opened this issue Dec 11, 2018 · 2 comments
Closed

Android release build fails "Error: no such scale" #22601

timkuilman opened this issue Dec 11, 2018 · 2 comments
Labels
Bug Platform: Android Android applications. Resolution: Locked This issue was locked by the bot.

Comments

@timkuilman
Copy link

timkuilman commented Dec 11, 2018

Environment

Run react-native info in your terminal and paste its contents here.

    System:
      OS: macOS 10.14.1
      CPU: x64 Intel(R) Core(TM) i5-6267U CPU @ 2.90GHz
      Memory: 91.02 MB / 8.00 GB
      Shell: 5.3 - /bin/zsh
    Binaries:
      Node: 10.2.1 - /usr/local/bin/node
      Yarn: 1.7.0 - ~/.yarn/bin/yarn
      npm: 5.6.0 - /usr/local/bin/npm
      Watchman: 4.7.0 - /usr/local/bin/watchman
    SDKs:
      iOS SDK:
        Platforms: iOS 12.1, macOS 10.14, tvOS 12.1, watchOS 5.1
      Android SDK:
        Build Tools: 23.0.1, 23.0.2, 25.0.0, 25.0.1, 25.0.2, 26.0.0, 26.0.1, 26.0.2, 26.0.3, 27.0.2, 27.0.3, 28.0.2
        API Levels: 23, 25, 26, 27, 28
    IDEs:
      Android Studio: 3.1 AI-173.4907809
      Xcode: 10.1/10B61 - /usr/bin/xcodebuild
    npmPackages:
      react: 16.6.1 => 16.6.1
      react-native: 0.57.7 => 0.57.7
    npmGlobalPackages:
      create-react-native-app: 1.0.0
      react-native-cli: 2.0.1
      react-native-contacts-wrapper: 0.2.4
      react-native-git-upgrade: 0.2.7

Description

When I try to create a release build for my app via the terminal, the process quits with an exception.

JS server already running.
Building and installing the app on the device (cd android && ./gradlew installRelease)...

> Configure project :app
WARNING: Configuration 'compile' is obsolete and has been replaced with '
<img width="335" alt="screenshot 2018-12-11 at 10 14 05" src="https://user-images.githubusercontent.com/23400302/49790032-95992f00-fd2d-11e8-9bc6-08a181303f32.png">
implementation' and 'api'.
It will be removed at the end of 2018. For more information see: http://d.android.com/r/tools/update-dependency-configurations.html

> Configure project :rn-fetch-blob
WARNING: Configuration 'compile' is obsolete and has been replaced with 'implementation' and 'api'.
It will be removed at the end of 2018. For more information see: http://d.android.com/r/tools/update-dependency-configurations.html

> Configure project :react-native-onesignal
WARNING: Configuration 'compile' is obsolete and has been replaced with 'implementation' and 'api'.
It will be removed at the end of 2018. For more information see: http://d.android.com/r/tools/update-dependency-configurations.html
WARNING: Configuration 'testCompile' is obsolete and has been replaced with 'testImplementation' and 'testApi'.
It will be removed at the end of 2018. For more information see: http://d.android.com/r/tools/update-dependency-configurations.html
WARNING: Configuration 'testApi' is obsolete and has been replaced with 'testImplementation'.
It will be removed at the end of 2018. For more information see: http://d.android.com/r/tools/update-dependency-configurations.html

> Configure project :react-native-intercom
WARNING: Configuration 'compile' is obsolete and has been replaced with 'implementation' and 'api'.
It will be removed at the end of 2018. For more information see: http://d.android.com/r/tools/update-dependency-configurations.html
WARNING: The specified Android SDK Build Tools version (26.0.1) is ignored, as it is below the minimum supported version (27.0.3) for Android Gradle Plugin 3.1.4.
Android SDK Build Tools 27.0.3 will be used.
To suppress this warning, remove "buildToolsVersion '26.0.1'" from your build.gradle file, as each version of the Android Gradle Plugin now has a default version of the build tools.

> Configure project :react-native-audio
WARNING: Configuration 'compile' is obsolete and has been replaced with 'implementation' and 'api'.
It will be removed at the end of 2018. For more information see: http://d.android.com/r/tools/update-dependency-configurations.html

Download https://jcenter.bintray.com/com/facebook/react/react-native/0.20.1/react-native-0.20.1.aar

> Task :app:bundleReleaseJsAndAssets
warning: the transform cache was reset.
Loading dependency graph, done.
bundle: Writing bundle output to: /Users/timkuilman/brthrs/Zuidema/YouTalk/android/app/build/generated/assets/react/release/index.android.bundle
bundle: Done writing bundle output

no such scale

Error: no such scale
    at getAndroidAssetSuffix (/Users/timkuilman/brthrs/Zuidema/YouTalk/node_modules/react-native/local-cli/bundle/assetPathUtils.js:34:9)
    at Object.getAndroidResourceFolderName (/Users/timkuilman/brthrs/Zuidema/YouTalk/node_modules/react-native/local-cli/bundle/assetPathUtils.js:52:16)
    at getAssetDestPathAndroid (/Users/timkuilman/brthrs/Zuidema/YouTalk/node_modules/react-native/local-cli/bundle/getAssetDestPathAndroid.js:19:40)
    at asset.scales.forEach (/Users/timkuilman/brthrs/Zuidema/YouTalk/node_modules/react-native/local-cli/bundle/saveAssets.js:39:42)
    at Array.forEach (<anonymous>)
    at assets.forEach.asset (/Users/timkuilman/brthrs/Zuidema/YouTalk/node_modules/react-native/local-cli/bundle/saveAssets.js:34:18)
    at Array.forEach (<anonymous>)
    at saveAssets (/Users/timkuilman/brthrs/Zuidema/YouTalk/node_modules/react-native/local-cli/bundle/saveAssets.js:30:10)
    at buildBundle (/Users/timkuilman/brthrs/Zuidema/YouTalk/node_modules/react-native/local-cli/bundle/buildBundle.js:71:18)
    at process._tickCallback (internal/process/next_tick.js:68:7)



FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:bundleReleaseJsAndAssets'.
> Process 'command 'node'' finished with non-zero exit value 1

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org

BUILD FAILED in 1m 51s
26 actionable tasks: 20 executed, 6 up-to-date
Could not install the app on the device, read the error above for details.
Make sure you have an Android emulator running or a device connected and have
set up your Android development environment:
https://facebook.github.io/react-native/docs/getting-started.html

What I understand of it is that there is something wrong with the assets I'm using in the native Android part of the app. I generated the icons with Android Studio. When I was following an alternative route I used yo rn:toolbox to generate the icons. This leads to the same error.

@Titozzz
Copy link
Collaborator

Titozzz commented Mar 19, 2019

Hello there 👋 this issue doesn't have a repro (which means, a react-native init-ed project with the minimal changes that leads to creating the same issue you are reporting). Unfortunately, I have no way of helping you in a meaningful way – there is no easy way for me to recreate the situation and check that the issue reported is still there when changing the code.

Because of this, we are going to close this issue - but if a repro is shared, we are happy to reopen it 🤗

@Titozzz Titozzz closed this as completed Mar 19, 2019
@possiblytyler
Copy link

possiblytyler commented Apr 23, 2019

I had a similar issue. After adding some additional debug I got :
error no such scale, scale : 3.5

I had an image asset that wasn't scaled to a react-native supported scale. Any image file ending in @3.5x I down-sampled to by 3/3.5 and renamed to @3x. This resolved the issue for me. That said image quality may slightly suffer on larger geometry devices.

For screen density guide see https://material.io/tools/devices

@facebook facebook locked as resolved and limited conversation to collaborators Mar 19, 2020
@react-native-bot react-native-bot added the Resolution: Locked This issue was locked by the bot. label Mar 19, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Bug Platform: Android Android applications. Resolution: Locked This issue was locked by the bot.
Projects
None yet
Development

No branches or pull requests

5 participants