Giter Club home page Giter Club logo

Comments (14)

BytesZero avatar BytesZero commented on June 14, 2024 3

@bjon
I just encountered this problem last week, I spent 2 days to solve it, I am a new iOS, this problem appears in the Object-C and Swift plug-in hybrid project, just need to create a new in the Runner directory of the Xcode project Just a Swift file.

object-c swift swift

CMD+N

swift

swift 1

from flutter_crashlytics.

bjon avatar bjon commented on June 14, 2024 2

@bjon
I just encountered this problem last week, I spent 2 days to solve it, I am a new iOS, this problem appears in the Object-C and Swift plug-in hybrid project, just need to create a new in the Runner directory of the Xcode project Just a Swift file.

object-c swift swift

CMD+N

swift

swift 1

Now it works! Thanks alot!!

from flutter_crashlytics.

BytesZero avatar BytesZero commented on June 14, 2024 1

@jaumard

If I add use_frameworks!, there will be other errors. And I saw that it could not be solved. I am not very familiar with iOS, if you can come to an Objective-C version, thank you very much.

from flutter_crashlytics.

jaumard avatar jaumard commented on June 14, 2024

Hello @yy1300326388

Did you add use_frameworks! on your pod file of your app ? If you're under a framework, you can't use this plugin because of limitation on cocoa pods that doesn't get the transitive dependancies on nested frameworks.

from flutter_crashlytics.

pcejas avatar pcejas commented on June 14, 2024

from flutter_crashlytics.

jaumard avatar jaumard commented on June 14, 2024

I'll not have the time to transpose the plugin in ObjC, but PR are welcome if you're sure it will fix your problem.

from flutter_crashlytics.

bjon avatar bjon commented on June 14, 2024

I have the same problem with use_frameworks! (build error on ios). Its sad cause its working great on android.

from flutter_crashlytics.

jaumard avatar jaumard commented on June 14, 2024

I'm using this plugin with firebase_analytics google_sign_in and just try to add google_maps_flutter on my pub spec and I'm still able to build and launch the app... That's strange

from flutter_crashlytics.

bjon avatar bjon commented on June 14, 2024

Even with a new project with flutter_crashlytics as the only depencency, build still fails.
See build-output.

When switching to geolocator (also a swift plugin) the build succeeds.

pubspec.yml

name: ft
description: A new Flutter project.

version: 1.0.0+1

environment:
  sdk: ">=2.0.0-dev.68.0 <3.0.0"

dependencies:
  flutter:
    sdk: flutter

  flutter_crashlytics: ^0.0.6
  # geolocator: ^2.0.1

Podfile

# Uncomment this line to define a global platform for your project
# platform :ios, '9.0'

# CocoaPods analytics sends network stats synchronously affecting flutter build latency.
ENV['COCOAPODS_DISABLE_STATS'] = 'true'

def parse_KV_file(file, separator='=')
  file_abs_path = File.expand_path(file)
  if !File.exists? file_abs_path
    return [];
  end
  pods_ary = []
  skip_line_start_symbols = ["#", "/"]
  File.foreach(file_abs_path) { |line|
      next if skip_line_start_symbols.any? { |symbol| line =~ /^\s*#{symbol}/ }
      plugin = line.split(pattern=separator)
      if plugin.length == 2
        podname = plugin[0].strip()
        path = plugin[1].strip()
        podpath = File.expand_path("#{path}", file_abs_path)
        pods_ary.push({:name => podname, :path => podpath});
      else
        puts "Invalid plugin specification: #{line}"
      end
  }
  return pods_ary
end

target 'Runner' do
  use_frameworks!

  # Prepare symlinks folder. We use symlinks to avoid having Podfile.lock
  # referring to absolute paths on developers' machines.
  system('rm -rf .symlinks')
  system('mkdir -p .symlinks/plugins')

  # Flutter Pods
  generated_xcode_build_settings = parse_KV_file('./Flutter/Generated.xcconfig')
  if generated_xcode_build_settings.empty?
    puts "Generated.xcconfig must exist. If you're running pod install manually, make sure flutter packages get is executed first."
  end
  generated_xcode_build_settings.map { |p|
    if p[:name] == 'FLUTTER_FRAMEWORK_DIR'
      symlink = File.join('.symlinks', 'flutter')
      File.symlink(File.dirname(p[:path]), symlink)
      pod 'Flutter', :path => File.join(symlink, File.basename(p[:path]))
    end
  }

  # Plugin Pods
  plugin_pods = parse_KV_file('../.flutter-plugins')
  plugin_pods.map { |p|
    symlink = File.join('.symlinks', 'plugins', p[:name])
    File.symlink(p[:path], symlink)
    pod p[:name], :path => File.join(symlink, 'ios')
  }
end

post_install do |installer|
  installer.pods_project.targets.each do |target|
    target.build_configurations.each do |config|
      config.build_settings['ENABLE_BITCODE'] = 'NO'
      config.build_settings['SWIFT_VERSION'] = '4.2' # 3.0, 4.0, 4.2
    end
  end
end

from flutter_crashlytics.

jaumard avatar jaumard commented on June 14, 2024

because you miss use_frameworks! on PodFile, the use_frameworks! is mandatory for this library to works because of bundle static libraries.

from flutter_crashlytics.

jaumard avatar jaumard commented on June 14, 2024

Or create a project with Swift support from the start. Adding a swift file on existing project enable the swift support that's why it's working. But use_framework! still need to be added :)
I'm closing this issue as it works as expected on project with Swift enabled. If an objective C version is really needed PR are welcome :)

from flutter_crashlytics.

bjon avatar bjon commented on June 14, 2024

because you miss use_frameworks! on PodFile, the use_frameworks! is mandatory for this library to works because of bundle static libraries.

Its in the Podfile

target 'Runner' do
  use_frameworks!

from flutter_crashlytics.

bjon avatar bjon commented on June 14, 2024

Do you mean it has to be in the top of the file?

from flutter_crashlytics.

jaumard avatar jaumard commented on June 14, 2024

I put it at the top of the file personally

from flutter_crashlytics.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.