#App missing dev dependencies

1 messages ยท Page 1 of 1 (latest)

chilly stone
#

Hello, I'm not sure which behavior is correct, but my app suddenly stopped functioning properly. I've tried every possible combination.

  Updating Android configuration ....................................................................................................... 2.15ms DONE
  Copying Laravel source ................................................................................................................... 4s DONE
  Installing Composer dependencies ......................................................................................................... 3s DONE
  Optimizing autoloader .................................................................................................................... 2s DONE
  Creating bundle archive .................................................................................................................. 2s DONE
  Bundle size ............................................................................................................................. 15.57 MB
  Build type ................................................................................................................................. debug
  App version ................................................................................................................................ DEBUG
NATIVEPHP_APP_ID=com.dyanakiev.medicinetracker
NATIVEPHP_APP_VERSION=DEBUG
NATIVEPHP_APP_VERSION_CODE=1
NATIVEPHP_DEVELOPMENT_TEAM=x

APP_NAME="Medicine Tracker"
APP_ENV=local
APP_KEY=xx
APP_DEBUG=true
APP_URL=http://localhost:8000
#

I see in prepare build this

  $result = Process::path($tempDir)
                    ->timeout(300)
                    ->run('composer install --no-dev --no-interaction');

So its like the .env inside the app is incorrect then

#

it looks like the same env is being copied over, but even if i change to app env local and app debug false, it still complains about laravellang service provider, laravelang is in dev dep, if i remove it completely it then complains about laravel/sail etc..

#

adding

        'bootstrap/cache/packages.php',
        'bootstrap/cache/services.php',

to cleanup_exclude_files didnt help either ๐Ÿ™

#

so the build.log says a bit more

#

removing nativephp dir in the project root, and reinstalling php artisan native:install, didnt work as well still same build.log

#

looking into nativephp/android/laravel theres no such dir

#

ah this dir is created only during build time ok

untold bolt
#

please check your composer.json
on require-dev
move package laravel/boost to require
and run
composer update laravel/boost

I also got that error,
so next time if there is an error like that just do the same thing

chilly stone
#

hey @untold bolt do you see anything wrong

keen peak
#

Hi all, having the exact same issue... I even tried removing boost completely but now it's having the same issue with Laravel Pail

chilly stone
chilly stone
#

@strong steppe sorry to bother, but any thoughts?

chilly stone
chilly stone
#

but installing again composer i breaks the app

#

:/

wanton iris
#

Oh I have exactly the same issue

chilly stone
untold bolt
# chilly stone

move package like this
after move from require-dev to require
run composer update, and check again php artisan native:run

#

also for package laravel/boost move to require from require-dev

chilly stone
#

i dont want to move them to require, its working fine, its some kind of other issue, JJSanders ran my app and it worked for him

#

moving them to require will introduce larger app bundle, and afterwards these stuff are not supposed to be in require

weak bramble
#

I was running into the same issue @chilly stone and I added the packages causing issues into my composer.json as dont-discover packages. This is my composer.json file:
With this, seems like Laravel won't automatically call these packages' service providers during bootstrapping.

chilly stone
#

Thanks i will use your solution until solved

dry tide
chilly stone
#

i can have that in a min

#

@dry tide ^

dry tide
#

The laravel-lang/* packages are being removed by composer install --no-dev, but the cached package manifest still references LaravelLang\Config\ServiceProvider.
Looking at the build log:
Removals: ... laravel-lang/config ...
The packages get removed, but bootstrap/cache/packages.php (created when you had dev dependencies) still lists them.

#

Try uninstalling the app and re-installing it

chilly stone
#

ive already tried deleting of vendor, composer.lock, etc. if i try running without laravel-lang, it then complains about sail, ive deleted boostrap/cache/*.php

#

i also did test yesterday with fresh clone of the app from my github repo, which actually worked for another member here

ive tried uninstalling the app multiple times, and clearing the cache of the app before uninstalling it
i also tried different app_id

dry tide
chilly stone
#

Hey @dry tide i found out why ios build works, but android doesnt

#

This is how composer is done for ios

#

for android goes straight to --no-dev always

dry tide
#

I would say thats more of an issue with ios then actually

chilly stone
#

if i manually remove --no-dev for android all issues get resolved

dry tide
#

we should alwys do --no-dev

chilly stone
#

oh well ๐Ÿ˜„

#

Im also okay to schedule a screen share if you need me to debug things

dry tide
#

dm me your email

heady radish
#

@chilly stone if you don't mind please let me know how this goes, I am currently facing this issue and would love an official solution. Maybe you could just post the details here.

vapid orchid
#

Similar issue with me too. Let me know the details once you have it working. Thanks,

dim swan
#

Same issue for me...

chilly stone
#

@dim swan @vapid orchid @heady radish working on this, temporary solution is to remove the lines below from composer.json:

        "pre-package-uninstall": [
            "Illuminate\\Foundation\\ComposerScripts::prePackageUninstall"
        ]
earnest dagger
#

had the same issue.
I actually added all the dependencies to dont-discover in the composer.json

"extra": {
        "laravel": {
            "dont-discover": [
                "laravel/boost",
                "laravel/mcp",
                "laravel/pail",
                "laravel/roster",
                "laravel/sail",
                "nunomaduro/collision",
                "pestphp/pest-plugin-laravel"
            ]
        }
    },
pastel pendant
#

I deleted vendor directory and composer.lock then installed without dev dependencies before build .. it worked no errors after...

#

Plus apk size reduced almost in half without dev dependencies after build.. and in general Docs suggests the same ...

chilly stone
pastel pendant
strong steppe
#

This was fixed in v2.4.0 - Android now follows iOS's behaviour - make sure you upgrade

the problem is actually a complex bug introduced in Laravel core some months ago that only affects the transition from having dev dependencies installed to --no-dev - our fix in 2.4 smooths over this and doesn't require any extra workarounds