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

Index out of range: no indices are valid: 0 #25

Closed
JCKodel opened this issue Oct 11, 2019 · 4 comments
Closed

Index out of range: no indices are valid: 0 #25

JCKodel opened this issue Oct 11, 2019 · 4 comments
Labels
bug Something isn't working

Comments

@JCKodel
Copy link

JCKodel commented Oct 11, 2019

Unhandled exception:
RangeError (index): Index out of range: no indices are valid: 0
#0 Iterable.elementAt (dart:core/iterable.dart:648:5)
#1 _getMainActivityJavaPath (package:flutter_native_splash/android.dart:335:27)

#2 _javaOrKotlin (package:flutter_native_splash/android.dart:307:36)

#3 _applyMainActivityUpdate (package:flutter_native_splash/android.dart:288:33)

#4 createSplash (package:flutter_native_splash/android.dart:39:9)

#5 createSplash (package:flutter_native_splash/flutter_native_splash.dart:20:11)

#6 main (file:///C:/Flutter/.pub-cache/hosted/pub.dartlang.org/flutter_native_splash-0.1.8+3/bin/create.dart:5:3)
#7 _startIsolate. (dart:isolate-patch/isolate_patch.dart:303:32)
#8 _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:172:12)
pub finished with exit code 255

App is Kotlin.

@JCKodel
Copy link
Author

JCKodel commented Oct 11, 2019

AndroidManifest.xml:

<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="br.art.code.meucronogramacapilar"
    xmlns:tools="http://schemas.android.com/tools">
    <application tools:replace="android:label,android:icon" android:name="io.flutter.app.FlutterApplication"
        android:label="Meu Cronograma Capilar" android:icon="@mipmap/ic_launcher" android:roundIcon="@mipmap/ic_launcher_round"
        android:fullBackupContent="@xml/backup_rules">
        <receiver android:name="com.dexterous.flutterlocalnotifications.ScheduledNotificationBootReceiver">
            <intent-filter>
                <action android:name="android.intent.action.BOOT_COMPLETED"></action>
            </intent-filter>
        </receiver>

        <receiver android:name="com.dexterous.flutterlocalnotifications.ScheduledNotificationReceiver" />

        <meta-data android:name="com.facebook.sdk.ApplicationId" android:value="@string/facebook_app_id"/>
        <meta-data android:name="com.google.android.gms.ads.APPLICATION_ID" android:value="ca-app-pub-xxxxxx"/>

        <activity android:name="com.yalantis.ucrop.UCropActivity" android:screenOrientation="portrait"
            android:theme="@style/Theme.AppCompat.Light.NoActionBar"/>

        <activity android:name="com.facebook.FacebookActivity" android:configChanges="keyboard|keyboardHidden|screenLayout|screenSize|orientation"
            android:label="@string/app_name" />

        <activity android:name="com.facebook.CustomTabActivity" android:exported="true">
            <intent-filter>
                <action android:name="android.intent.action.VIEW" />
                <category android:name="android.intent.category.DEFAULT" />
                <category android:name="android.intent.category.BROWSABLE" />
                <data android:scheme="@string/fb_login_protocol_scheme" />
            </intent-filter>
        </activity>

        <activity android:name=".MainActivity" android:launchMode="singleTop" android:theme="@style/LaunchTheme"
            android:configChanges="orientation|keyboardHidden|keyboard|screenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode"
            android:hardwareAccelerated="true" android:windowSoftInputMode="adjustResize">
            <meta-data android:name="io.flutter.app.android.SplashScreenUntilFirstFrame" android:value="true" />
            <intent-filter>
                <action android:name="android.intent.action.MAIN"/>
                <category android:name="android.intent.category.LAUNCHER"/>
            </intent-filter>
        </activity>
    </application>

    <uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED"/>
</manifest>

@henriquearthur
Copy link
Collaborator

Thanks for reporting!

Regex couldn't find package tag on AndroidManifest.xml because package is not the last tag as in default projects.

This is now fixed in 0.1.8+4. Please update the package and run again.

dev_dependencies:
  flutter_native_splash: ^0.1.8+4

@henriquearthur henriquearthur added android bug Something isn't working labels Oct 12, 2019
@JCKodel
Copy link
Author

JCKodel commented Oct 12, 2019

Thank you, @henriquearthur, but there is a lot of issues in this plugin that prevents me from using it =\

The most pressing issue is the image dimension's. I have a OnePlus 6 (1080x2280, 19:9, 402ppi) and a MotoG 1st Edition (720x1280, 16:9, 326ppi). In the OnePlus, my splash is too small. In MotoG, the splash barely fits on the screen.

I was hopping a plugin to automatically make my splash screen be, more or less, the same in different screen dimensions/resolutions =\

Also, would be nice to write down in the docs which size the image template must be.

@henriquearthur
Copy link
Collaborator

Indeed image sizing is something this package needs to do better and consistently. Right now it only uses dpi variants on Android and @2x @3x on iOS.

There is a issue for tracking image size and position features (#11). I will try to address it soon.

Also, would be nice to write down in the docs which size the image template must be.

That's part of the problem, there is no specific size. Android devices vary from low, medium and high resolutions and we should support all sizes.

If the given image is too large (in resolution) it will look good in high res devices and not so good in low res. If the image is too small, it will be good in low res and not so good in high res.

I need to do more tests with different screen sizes as well.

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

2 participants