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

ERROR on creation #13

Closed
b-cancel opened this issue Sep 1, 2019 · 11 comments
Closed

ERROR on creation #13

b-cancel opened this issue Sep 1, 2019 · 11 comments
Labels
bug Something isn't working

Comments

@b-cancel
Copy link

b-cancel commented Sep 1, 2019

I don't know what your error codes mean

but after running what's indicated in the tutorial I get these errors
NOTE: that for some reason the splash screen still works on my Samsung Galaxy S10

flutter pub get
flutter pub pub run flutter_native_splash:create
[Android] Creating splash images
[Android] Updating launch_background.xml with splash image path
[Android] Updating colors.xml with color for splash screen background
[Android] Updating styles.xml with full screen mode setting
Unhandled exception:
FormatException: Invalid radix-10 number (at character 1)
20 //OLD 16
^

#0      int._throwFormatException (dart:core-patch/integers_patch.dart:131:5)
#1      int._parseRadix (dart:core-patch/integers_patch.dart:142:16)
#2      int._parse (dart:core-patch/integers_patch.dart:100:12)
#3      int.parse (dart:core-patch/integers_patch.dart:63:12)
#4      _supportStatusBarCode (package:flutter_native_splash/android.dart:469:15)
<asynchronous suspension>
#5      _addMainActivitySplashLines (package:flutter_native_splash/android.dart:399:39)
<asynchronous suspension>
#6      _applyMainActivityUpdate (package:flutter_native_splash/android.dart:278:11)
<asynchronous suspension>
#7      createSplash (package:flutter_native_splash/android.dart:33:9)
<asynchronous suspension>
#8      createSplash (package:flutter_native_splash/flutter_native_splash.dart:18:11)
<asynchronous suspension>
#9      main (file:https:///E:/CinE/Users/bryan/SOFTWARE/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_native_splash-0.1.7+1/bin/create.dart:5:3)
#10     _startIsolate.<anonymous closure> (dart:isolate-patch/isolate_patch.dart:299:32)
#11     _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:172:12)
pub finished with exit code 255
@b-cancel
Copy link
Author

b-cancel commented Sep 1, 2019

@henriquearthur plz help :)

@henriquearthur
Copy link
Collaborator

henriquearthur commented Sep 1, 2019

That Exception comes from Dart actually but I can see the error happens when checking minSdkVersion:

#4      _supportStatusBarCode (package:flutter_native_splash/android.dart:469:15)
<asynchronous suspension>

Can you share your android/app/build.gradle? It doesn't have to be the entire file, just the minSdkVersion line.

@henriquearthur henriquearthur added android bug Something isn't working labels Sep 1, 2019
@b-cancel
Copy link
Author

b-cancel commented Sep 1, 2019

@henriquearthur here is the whole thing just in case

def localProperties = new Properties()
def localPropertiesFile = rootProject.file('local.properties')
if (localPropertiesFile.exists()) {
    localPropertiesFile.withReader('UTF-8') { reader ->
        localProperties.load(reader)
    }
}

def flutterRoot = localProperties.getProperty('flutter.sdk')
if (flutterRoot == null) {
    throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.")
}

def flutterVersionCode = localProperties.getProperty('flutter.versionCode')
if (flutterVersionCode == null) {
    flutterVersionCode = '1'
}

def flutterVersionName = localProperties.getProperty('flutter.versionName')
if (flutterVersionName == null) {
    flutterVersionName = '1.0'
}

apply plugin: 'com.android.application'
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"

android {
    compileSdkVersion 28

    lintOptions {
        disable 'InvalidPackage'
    }

    defaultConfig {
        // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
        applicationId "com.example.not_at_home"
        minSdkVersion 20 //OLD 16
        targetSdkVersion 28
        versionCode flutterVersionCode.toInteger()
        versionName flutterVersionName
        //OLD testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
        testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
    }

    buildTypes {
        release {
            // TODO: Add your own signing config for the release build.
            // Signing with the debug keys for now, so `flutter run --release` works.
            signingConfig signingConfigs.debug
        }
    }
}

flutter {
    source '../..'
}

dependencies {
    testImplementation 'junit:junit:4.12'
    //OLD androidTestImplementation 'com.android.support.test:runner:1.0.2'
    //OLD androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
    androidTestImplementation 'androidx.test:runner:1.1.1'
    androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.1'
}

@henriquearthur
Copy link
Collaborator

Thanks for reporting.

It was bad logic on checking minSdkVersion - the previous code did not considered comments or any character that is not space between minSdkVersion and the number.

It is now fixed on v0.1.7+2 by using regex to obtain the number.

dev_dependencies:
  flutter_native_splash: ^0.1.7+2

@b-cancel
Copy link
Author

b-cancel commented Sep 1, 2019

@henriquearthur wow thanks a ton!
I've never seen someone repair their own plugin so quickly!

@iambudi
Copy link

iambudi commented Jan 7, 2020

Hi @henriquearthur,
Using latest version it happened again. Please check this. Thank you.

android/app/build.gradle

minSdkVersion 16
targetSdkVersion 28

flutter pub run flutter_native_splash:create
[Android] Creating splash images
[Android] Updating launch_background.xml with splash image path
[Android] No colors.xml file found in your Android project
[Android] Creating colors.xml file and adding it to your Android project
[Android] Updating styles.xml with full screen mode setting
Unhandled exception:
FormatException: Invalid radix-16 number (at character 1)
re
^

#0      int._throwFormatException (dart:core-patch/integers_patch.dart:133:5)
#1      int._parseRadix (dart:core-patch/integers_patch.dart:144:16)
#2      int._parse (dart:core-patch/integers_patch.dart:102:12)
#3      int.parse (dart:core-patch/integers_patch.dart:65:12)
#4      new HexColor (package:color/hex_color.dart:21:17)
#5      _generatePrimaryColorDarkFromColor (package:flutter_native_splash/android.dart:48:45)
#6      createSplash (package:flutter_native_splash/android.dart:42:34)
<asynchronous suspension>
#7      createSplash (package:flutter_native_splash/flutter_native_splash.dart:20:11)
<asynchronous suspension>
#8      main (file:https:///Users/iambudi/app/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_native_splash-0.1.9/bin/create.dart:5:3)
#9      _startIsolate.<anonymous closure> (dart:isolate-patch/isolate_patch.dart:305:32)
#10     _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:174:12)

@henriquearthur
Copy link
Collaborator

@iambudi can you share your pubspec.yaml?

@iambudi
Copy link

iambudi commented Jan 11, 2020

@henriquearthur Here is the pubspec.yaml

name: hello
description: A new Flutter project.

# The following defines the version and build number for your application.
# A version number is three numbers separated by dots, like 1.2.43
# followed by an optional build number separated by a +.
# Both the version and the builder number may be overridden in flutter
# build by specifying --build-name and --build-number, respectively.
# In Android, build-name is used as versionName while build-number used as versionCode.
# Read more about Android versioning at https://developer.android.com/studio/publish/versioning
# In iOS, build-name is used as CFBundleShortVersionString while build-number used as CFBundleVersion.
# Read more about iOS versioning at
# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html
version: 1.0.0+1

environment:
  sdk: ">=2.1.0 <3.0.0"

dependencies:
  flutter:
    sdk: flutter

  # # The following adds the Cupertino Icons font to your application.
  # # Use with the CupertinoIcons class for iOS style icons.
  cupertino_icons: ^0.1.2
  # geolocator: ^5.1.5
  # fab_circular_menu: ^0.1.3
  # circular_check_box: ^1.0.1
  # dio: ^3.0.8 #latest version
  # permission_handler: '^4.0.0'
  # fluro: "^1.5.1"

dev_dependencies:
  flutter_test:
    sdk: flutter
  flutter_native_splash: ^0.1.9

flutter_native_splash:
  image: assets/images/splash.png
  color: "red"
  fill: true

# For information on the generic Dart part of this file, see the
# following page: https://dart.dev/tools/pub/pubspec

# The following section is specific to Flutter.
flutter:

  # The following line ensures that the Material Icons font is
  # included with your application, so that you can use the icons in
  # the material Icons class.
  uses-material-design: true

  # To add assets to your application, add an assets section, like this:
  assets:
   - assets/images/
  #  - images/a_dot_ham.jpeg

  # An image asset can refer to one or more resolution-specific "variants", see
  # https://flutter.dev/assets-and-images/#resolution-aware.

  # For details regarding adding assets from package dependencies, see
  # https://flutter.dev/assets-and-images/#from-packages

  # To add custom fonts to your application, add a fonts section here,
  # in this "flutter" section. Each entry in this list should have a
  # "family" key with the font family name, and a "fonts" key with a
  # list giving the asset and other descriptors for the font. For
  # example:
  # fonts:
  #   - family: Schyler
  #     fonts:
  #       - asset: fonts/Schyler-Regular.ttf
  #       - asset: fonts/Schyler-Italic.ttf
  #         style: italic
  #   - family: Trajan Pro
  #     fonts:
  #       - asset: fonts/TrajanPro.ttf
  #       - asset: fonts/TrajanPro_Bold.ttf
  #         weight: 700
  #
  # For details regarding fonts from package dependencies,
  # see https://flutter.dev/custom-fonts/#from-packages

@henriquearthur
Copy link
Collaborator

@iambudi

color: "red" is not supported. You need to use an hex color like color: "#ff0000"

@iambudi
Copy link

iambudi commented Jan 12, 2020

@henriquearthur Perfect! Thank you.

@edmundciego
Copy link

hi @henriquearthur
I have this same issue, whenever i click to open my slider i get an error and it does not navigate. Any help will do, thanks.
This is from my terminal:

════════ Exception caught by widgets library ═══════════════════════════════════════════════════════
The following FormatException was thrown building Builder(dirty):
Invalid radix-10 number (at character 1)
null
^

The relevant error-causing widget was:
MaterialApp file:https:///C:/Users/Edmund%20Ciego/OneDrive/Documents/Projects/StreetSide/stores/v190-1/flutter_application/lib/main.dart:42:18
When the exception was thrown, this was the stack:
#0 int._throwFormatException (dart:core-patch/integers_patch.dart:131:5)
#1 int._parseRadix (dart:core-patch/integers_patch.dart:142:16)
#2 int._parse (dart:core-patch/integers_patch.dart:100:12)
#3 int.parse (dart:core-patch/integers_patch.dart:63:12)
#4 new DetailsWidget (package:stores/src/pages/details.dart:32:26)
...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants