Skip to content

In add-to-app documentation or samples, show examples of non-trivial native code in the host app, not the module #32883

Closed

Description

@IchordeDionysos

Steps to Reproduce

  1. We added Flutter to an existing app. Don't know if this matters here.
  2. After adding Flutter to your app, change files, like app icons in the .ios folder or change files in the .android folder during migration to AndroidX
  3. Change Flutter version, run flutter packages get, build and run the app
  4. Then look into your Git and see that your changes in the .ios and .android folders where overridden.

Logs

[✓] Flutter (Channel stable, v1.5.4-hotfix.2, on Mac OS X 10.14.3 18D109, locale en-US)
    • Flutter version 1.5.4-hotfix.2 at /Users/denniskugelmann/develop/flutter
    • Framework revision 7a4c33425d (3 weeks ago), 2019-04-29 11:05:24 -0700
    • Engine revision 52c7a1e849
    • Dart version 2.3.0 (build 2.3.0-dev.0.5 a1668566e5)

 
[✓] Android toolchain - develop for Android devices (Android SDK version 28.0.3)
    • Android SDK at /Users/denniskugelmann/Library/Android/sdk
    • Android NDK location not configured (optional; useful for native profiling support)
    • Platform android-28, build-tools 28.0.3
    • Java binary at: /Users/denniskugelmann/Library/Application Support/JetBrains/Toolbox/apps/AndroidStudio/ch-0/182.5314842/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1248-b01)
    • All Android licenses accepted.

[✓] iOS toolchain - develop for iOS devices (Xcode 10.2.1)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Xcode 10.2.1, Build version 10E1001
    • ios-deploy 1.9.4
    • CocoaPods version 1.6.1

[✓] Android Studio (version 3.3)
    • Android Studio at /Users/denniskugelmann/Library/Application Support/JetBrains/Toolbox/apps/AndroidStudio/ch-0/182.5314842/Android Studio.app/Contents
    • Flutter plugin version 29.0.1
    • Dart plugin version 173.4700
    • Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1248-b01)

[✓] VS Code (version 1.33.1)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension version 3.0.2

[✓] Connected device (2 available)
    • Pixel 2 XL • 712KPPB1274592                       • android-arm64 • Android 9 (API 28)
    • iPhone Xʀ  • 417E55AD-59A0-4372-B4A3-DBAD31DDA867 • ios           • com.apple.CoreSimulator.SimRuntime.iOS-12-2 (simulator)

• No issues found!

Activity

  1. jackuhan commented on Jun 20, 2019

    @jackuhan

    +1

  2. yueshaojun commented on Jun 20, 2019

    @yueshaojun

    +10086

  3. added
    a: existing-appsIntegration with existing apps via the add-to-app flow
    on Aug 6, 2019
  4. jmagman commented on Dec 19, 2019

    @jmagman
    Member

    This is by design. The projects in .android and .ios are little helper bootstrap projects to let you quickly see your compiled dart code without needing to run your existing app. The platform code is not intended to be editable, is ephemeral, and is deleted with flutter clean. You should be changing files and app icons in your existing app, not the little module example project.

    https://flutter.dev/docs/development/add-to-app/ios/project-setup#module-organization

    Note: Add custom iOS code to your existing application or a plugin, not to the module in .ios/. Changes made in .ios/ aren’t embedded in your existing application. Regenerate the directory by running flutter clean or flutter pub get in the my_flutter directory.

    Looks like this note is missing from https://flutter.dev/docs/development/add-to-app/android/project-setup.

  5. IchordeDionysos commented on Dec 19, 2019

    @IchordeDionysos
    ContributorAuthor

    We already figured this out, so thanks @jmagman
    for also putting this in the documentation.

    I still think there is some gap in the developer experience.
    Maybe this can be solved by providing some insights in the documentation on how the add-to-app module can be developed and tested in isolation by a dedicated Flutter development team.

    We have experienced this quite some time.
    We have developers for iOS, Android and Flutter.

    When the Flutter developers build something they don't want to wait for the iOS team to build it into the app to develop and test.
    So the Flutter team has to build their own wrapper.
    I think some best practices and/or example projects on how this could be achieved would be great in the docs as it's not that trivial and there are many ways to achieve this each with their pros/cons.

  6. jmagman commented on Dec 19, 2019

    @jmagman
    Member
  7. changed the title [-]Changing Flutter version/Flutter overrides .ios and .android files[/-] [+]In add-to-app documentation or samples, show examples of non-trivial native code in the host app, not the module[/+] on Jan 17, 2020
  8. xster commented on Oct 12, 2020

    @xster
    Member

    https://flutter.dev/docs/development/add-to-app/ios/project-setup and https://flutter.dev/docs/development/add-to-app/android/project-setup both now have warnings about generally not modifying data inside the .android and .ios folders. There's a "non-trivial" Android project for add-to-app in https://github.com/flutter/samples/tree/master/add_to_app/android_books.

  9. github-actions commented on Aug 11, 2021

    @github-actions

    This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of flutter doctor -v and a minimal reproduction of the issue.

  10. locked as resolved and limited conversation to collaborators on Aug 11, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    a: existing-appsIntegration with existing apps via the add-to-app flow

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions