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

Unable to flutter run -d all #4

Closed
ilyakam opened this issue Jul 10, 2019 · 4 comments
Closed

Unable to flutter run -d all #4

ilyakam opened this issue Jul 10, 2019 · 4 comments

Comments

@ilyakam
Copy link

ilyakam commented Jul 10, 2019

Today is my first day with Flutter. I got the "Hello World" app to work on both the virtual iPhone Xs and Pixel 3 after running a basic flutter create advertising_id_demo.

I then followed the installation instructions for this package. After adding advertising_id: ^0.9.1 as a dependency to the project's pubspec.yaml file and running flutter pub get, the "Hello World" app fails to build with the following error / stack trace:

$ flutter run -d all
Using hardware rendering with device Android SDK built for x86. If you get graphics artifacts, consider enabling
software rendering with "--enable-software-rendering".
Launching lib/main.dart on Android SDK built for x86 in debug mode...
Initializing gradle...                                              0.8s
Resolving dependencies...                                           1.2s
Running Gradle task 'assembleDebug'...
Running Gradle task 'assembleDebug'... Done                        10.1s
Built build/app/outputs/apk/debug/app-debug.apk.
Installing build/app/outputs/apk/app.apk...                         2.6s
Launching lib/main.dart on iPhone Xs in debug mode...
Running pod install...                                              0.7s
CocoaPods' output:

      Preparing

    Analyzing dependencies

    Inspecting targets to integrate
      Using `ARCHS` setting to build architectures of target `Pods-Runner`: (``)

    Fetching external sources
    -> Fetching podspec for `Flutter` from `.symlinks/flutter/ios`
    -> Fetching podspec for `advertising_id` from `.symlinks/plugins/advertising_id/ios`

    Resolving dependencies of `Podfile`

    Comparing resolved specification to the sandbox manifest
      A Flutter
      A advertising_id

    Downloading dependencies

    -> Installing Flutter (1.0.0)

    -> Installing advertising_id (0.0.1)
      - Running pre install hooks
    [!] Unable to determine Swift version for the following pods:

    - `advertising_id` does not specify a Swift version and none of the targets (`Runner`) integrating it have the
    `SWIFT_VERSION` attribute set. Please contact the author or set the `SWIFT_VERSION` attribute in at least one of
    the targets that integrate this pod.

    /Users/ilya/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/cocoapods-1.7.4/lib/cocoapods/installer/xcode/target_
    validator.rb:122:in `verify_swift_pods_swift_version'
    /Users/ilya/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/cocoapods-1.7.4/lib/cocoapods/installer/xcode/target_
    validator.rb:37:in `validate!'
    /Users/ilya/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/cocoapods-1.7.4/lib/cocoapods/installer.rb:578:in
    `validate_targets'
    /Users/ilya/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/cocoapods-1.7.4/lib/cocoapods/installer.rb:158:in
    `install!'
    /Users/ilya/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/cocoapods-1.7.4/lib/cocoapods/command/install.rb:51:i
    n `run'
    /Users/ilya/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/claide-1.0.2/lib/claide/command.rb:334:in `run'
    /Users/ilya/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/cocoapods-1.7.4/lib/cocoapods/command.rb:52:in `run'
    /Users/ilya/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/cocoapods-1.7.4/bin/pod:55:in `<top (required)>'
    /Users/ilya/.rbenv/versions/2.2.3/bin/pod:23:in `load'
    /Users/ilya/.rbenv/versions/2.2.3/bin/pod:23:in `<main>'

I've created a demo repo that you can clone to help with debugging:
https://github.com/ilyakam/advertising_id_demo

Here's some info about my setup:

  • macOS version 10.14.5
  • Xcode version 10.2.1
  • Android Studio version 3.4
  • Flutter version 1.7.8+hotfix.2
  • Cocoapods version 1.7.4
  • Simulator version 10.2.1 running iPhone Xs on iOS 12.2
  • Emulator running Pixel 3 on Android 9.0 (API 28 x86)

Could you please help? It's possible that I'm doing something wrong, I just don't know what.

@ilyakam
Copy link
Author

ilyakam commented Jul 11, 2019

I was able to make some more progress with this today, by:

  1. Changing the configuration in ./ios/Runner.xcodeproj/project.pbxproj as described in this comment
  2. Creating a new ./ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings file via Xcode with the following contents (as described in this comment):
    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
    <plist version="1.0">
    <dict>
      <key>BuildSystemType</key>
      <string>Original</string>
    </dict>
    </plist>

However, here is the main error I'm seeing now:

Failed to build iOS app
Error output from Xcode build:
↳
    ** BUILD FAILED **


Xcode's output:

    /Users/ilya/Programs/flutter/.pub-cache/hosted/pub.dartlang.org/advertising_id-0.9.
    1/ios/Classes/AdvertisingIdPlugin.m:2:9: fatal error:
    'advertising_id/advertising_id-Swift.h' file not found
    #import <advertising_id/advertising_id-Swift.h>
            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    1 error generated.

I suspect that the problem is with this line:

#import <advertising_id/advertising_id-Swift.h>

I looked all over this project for advertising_id-Swift.h and couldn't find one.


I've also noticed a few other of things…

  1. This plugin's .podspec file has not been updated from the original Flutter template
  2. Your avatar is Tux inside of Bugdriod (meaning, Linux and Android specific)
  3. When filtering all 200 of your repos by language, neither Swift nor Objective-C appear even once

…which unfortunately begs the question: did you have a chance to test this plugin on iOS? And if so, how did you set it up on your end?

@hectorvillag
Copy link

I have the same problem, could you solve it? @ilyakam

@ilyakam
Copy link
Author

ilyakam commented Mar 20, 2020

No, I gave up on Flutter because I found the ecosystem lacking (e.g., this thread) and switched to React Native instead, where I was able to make ample progress.

@operando operando closed this as completed Jun 7, 2020
@ilyakam
Copy link
Author

ilyakam commented Jun 7, 2020

Were you able to fix the issue, @operando?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants