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

CantFindAppDelegatePath error, when running the flutter pub run flutter_native_splash:create command #125

Closed
idevChandra6 opened this issue Feb 3, 2021 · 10 comments
Labels
waiting response Further information is requested

Comments

@idevChandra6
Copy link

Describe the bug
When running the flutter pub run flutter_native_splash:create, CantFindAppDelegatePath error gets printed.

To Reproduce
Steps to reproduce the behavior:

  1. Add flutter_native_splash: ^0.2.9 to pubspec.yaml
  2. Add below lines in pubspec.yaml
flutter_native_splash:
  color: "#42a5f5"
  image: assets/images/splash_inset.png
  android: true
  ios: true

  1. Run flutter pub get command
  2. Run flutter pub run flutter_native_splash:create

You should see mentioned error.

Expected behavior
The flutter pub run flutter_native_splash:create should run with out error, creating the launch images.

Screenshots

# flutter pub run flutter_native_splash:create
[Android] Creating splash images
[Android] Updating android/app/src/main/res/drawable/launch_background.xml with splash image path
[Android] Updating android/app/src/main/res/values/colors.xml with color for splash screen background
[Android] Updating styles.xml with full screen mode setting
[iOS] Creating splash images
[iOS] Updating LaunchScreen.storyboard with width, and height
Unhandled exception:
*** ERROR [flutter_native_splash] ***
CantFindAppDelegatePath
Not able to determinate AppDelegate path.
#0      _objectiveCOrSwift (package:flutter_native_splash/ios.dart:320:5)
#1      _applyAppDelegate (package:flutter_native_splash/ios.dart:295:27)
#2      _createiOSSplash (package:flutter_native_splash/ios.dart:49:9)
<asynchronous suspension>
#3      tryCreateSplashByConfig (package:flutter_native_splash/supported_platform.dart:52:11)
<asynchronous suspension>
#4      tryCreateSplash (package:flutter_native_splash/supported_platform.dart:26:9)
<asynchronous suspension>
#5      createSplash (package:flutter_native_splash/flutter_native_splash.dart:17:9)
#6      main (file:///Users/myuser/.pub-cache/hosted/pub.dartlang.org/flutter_native_splash-0.2.9/bin/create.dart:5:3)
#7      _startIsolate.<anonymous closure> (dart:isolate-patch/isolate_patch.dart:299:32)
#8      _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:168:12)
pub finished with exit code 255

Device (please complete the following information):

  • Device: iPhone 11 Simulator, iPhone 12 mini Physical Device
  • OS: iOS 14.0

Flutter doctor

Flutter Doctor report these two issues. But I do have them. I get these errors everytime.

    ✗ Flutter plugin not installed; this adds Flutter specific functionality.
    ✗ Dart plugin not installed; this adds Dart specific functionality.

[✓] Flutter (Channel stable, 1.22.4, on Mac OS X 10.15.7 19H2 darwin-x64, locale en-US)
    • Flutter version 1.22.4 at /Users/cpoleped/development/flutter
    • Framework revision 1aafb3a8b9 (3 months ago), 2020-11-13 09:59:28 -0800
    • Engine revision 2c956a31c0
    • Dart version 2.10.4

 
[✓] Android toolchain - develop for Android devices (Android SDK version 30.0.2)
    • Android SDK at /Users/cpoleped/Library/Android/sdk
    • Platform android-30, build-tools 30.0.2
    • Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b3-6915495)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 12.0)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Xcode 12.0, Build version 12A7209
    • CocoaPods version 1.10.0

[!] Android Studio (version 4.1)
    • Android Studio at /Applications/Android Studio.app/Contents
    ✗ Flutter plugin not installed; this adds Flutter specific functionality.
    ✗ Dart plugin not installed; this adds Dart specific functionality.
    • Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b3-6915495)

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

[✓] Connected device (1 available)
    • iPhone 11 (mobile) • 645554E2-32AE-4876-9613-9FE4F7B62773 • ios • com.apple.CoreSimulator.SimRuntime.iOS-14-0 (simulator)

! Doctor found issues in 2 categories.

Additional context
Not any!

@YangLuYang
Copy link

same issue, Is there any solution ?

@jonbhanson
Copy link
Owner

I created a new Flutter project with the steps you outlined, but unfortunately I was not able to reproduce the problem. That exception is triggered when the package is not able to locate 'ios/Runner/AppDelegate.m' or 'ios/Runner/AppDelegate.swift' depending if iOS app is built on Objective-C or Swift, respectively. Was this file moved or renamed?

@jonbhanson jonbhanson added the waiting response Further information is requested label Feb 4, 2021
@YangLuYang
Copy link

I make flutter project as module, my workspace folder like this. aiplay is my iOS project
image

@jonbhanson
Copy link
Owner

jonbhanson commented Feb 4, 2021

OK, @YangLuYang, I have not used Flutter modules yet, so you may have to help me understand. As I understand you have a native iOS app aiplay that has flutter_module integrated in it. Is this correct? If this is the case, I think the LaunchScreen.storyboard for your final app resides in the aiplay native app. The flutter_module will have a .ios/Runner/Base.lproj/LaunchScreen.storyboard, but the .ios folder exists to run a standalone version of the module. As the docs state, " Add custom iOS code to your own existing application’s project or to a plugin, not to the module’s .ios/ directory. Changes made in your module’s .ios/ directory do not appear in your existing iOS project using the module, and may be overwritten by Flutter." So even if the flutter_native_splash package modified the splash screen in the module, it would not appear in the final app. Thoughts?

@YangLuYang
Copy link

@jonbhanson Yes, I think your are correct, native will present flutter after a ViewController invoke viewWillLayoutSubviews method when native app has flutter_module integrated in. So the LaunchScreen.storyboard should in the aiplay native app.

@jonbhanson
Copy link
Owner

@idevChandra6 are you using a Flutter module in a native app?

@jonbhanson
Copy link
Owner

This has been fixed in the latest update.

@zeeshan-rsys
Copy link

xcode 13.4

development target version 12.0

Screenshot 2022-10-25 at 8 39 37 PM

Logs
❯ flutter doctor -v
[✓] Flutter (Channel stable, 3.3.5, on macOS 12.5 21G72 darwin-arm, locale en-IN)
    • Flutter version 3.3.5 on channel stable at /Users/radiansys/flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision d9111f6402 (6 days ago), 2022-10-19 12:27:13 -0700
    • Engine revision 3ad69d7be3
    • Dart version 2.18.2
    • DevTools version 2.15.0

[✓] Android toolchain - develop for Android devices (Android SDK version 32.1.0-rc1)
    • Android SDK at /Users/radiansys/Library/Android/sdk
    • Platform android-33, build-tools 32.1.0-rc1
    • Java binary at: /Applications/Android Studio.app/Contents/jre/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 11.0.12+0-b1504.28-7817840)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 13.4)
    • Xcode at /Users/radiansys/Downloads/Xcode.app/Contents/Developer
    • Build 13F17a
    • CocoaPods version 1.11.3

[✓] Chrome - develop for the web
    • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[✓] Android Studio (version 2021.2)
    • Android Studio at /Applications/Android Studio.app/Contents
    • Flutter plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/6351-dart
    • Java version OpenJDK Runtime Environment (build 11.0.12+0-b1504.28-7817840)

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

[✓] Connected device (3 available)
    • iPhone 12 Pro Max (mobile) • 3D524B95-EE05-45B1-8269-9C87F3A95CD9 • ios            •
      com.apple.CoreSimulator.SimRuntime.iOS-15-5 (simulator)
    • macOS (desktop)            • macos                                • darwin-arm64   • macOS 12.5 21G72
      darwin-arm
    • Chrome (web)               • chrome                               • web-javascript • Google Chrome
      106.0.5249.119

[✓] HTTP Host Availability
    • All required HTTP hosts are available

• No issues found!

Screenshot 2022-10-26 at 9 29 57 PM

Screenshot 2022-10-26 at 9 30 14 PM

@boris1690
Copy link

Hi Guys,

I have the same error when run in xcode

Screenshot 2022-10-26 at 16 53 58

@jonbhanson
Copy link
Owner

@zeeshan-rsys @boris1690 your problem is not related to this ticket. Please open a new ticket with all the requested information in the report template.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
waiting response Further information is requested
Projects
None yet
Development

No branches or pull requests

5 participants