Flutter package for detecting NSFW images and videos using native implementation

Overview

Flutter NSFW

License

  • 1- Download, tflite modle and put it in assets folder
  • 2 - Add the path of the tfliet to pubspec.yaml
  • 3 - Read the file using path_provider plugin
  • 4 - Initialize the plugin before use as
Directory  appDocDir = await  getApplicationDocumentsDirectory();
String  appDocPath = appDocDir.path;
var  file = File(appDocPath + "/nsfw.tflite");
if (!file.existsSync()) {
var  data = await  rootBundle.load("assets/model/nsfw.tflite");
final  buffer = data.buffer;
await  file.writeAsBytes(
buffer.asUint8List(data.offsetInBytes, data.lengthInBytes));
}
await  FlutterNsfw.initNsfw(file.path);
  • 5 - get photo NSFW probability
  FlutterNsfw.getPhotoNSFWScore(photoPath);
  • 6 - Get video NSFW probability by providing video path and NSFW threshold above which to classify video as nsfw you may choose to enter optional parameters too.
FlutterNsfw.detectNSFWVideo(
videoPath: videoPath,
nsfwThreshold: 0.9,
durationPerFrame: 1000);
Comments
  • Testing on Video

    Testing on Video

    Hi, Thank you so much for your work. I have tested flutter app on images it is working fine. When I run on Videos app is crashing can you help me on solving this and what is the video size or duration limit?

    opened by vinodbukya6 14
  • No implementation found for method initNsfw on channel flutter_nsfw

    No implementation found for method initNsfw on channel flutter_nsfw

    I am trying to use this plugin for scanning images but getting this error during initialization. I have placed the file nsfw.tflite under assets as below. assets: - assets/nsfw/nsfw.tflite Also initializing the plugin inside initState() using initPlatformState().

    Still I am getting the below error. Please help. Thanks

    E/flutter (11961): [ERROR:flutter/lib/ui/ui_dart_state.cc(209)] Unhandled Exception: MissingPluginException(No implementation found for method initNsfw on channel flutter_nsfw) E/flutter (11961): #0 MethodChannel._invokeMethod (package:flutter/src/services/platform_channel.dart:165:7) E/flutter (11961):

    opened by iamarindammitra 3
  • Implement getBitmapNSFWScore

    Implement getBitmapNSFWScore

    Hi.

    I added getBitmapNSFWScore to enable passing in-memory image data to the plug-in. Thought that it can be useful for others.

    You can test it with something like:

    final values = await File(photoPath).readAsBytes(); return FlutterNsfw.getBitmapNSFWScore(values); // return FlutterNsfw.getPhotoNSFWScore(photoPath);

    Also note that I couldn't find implementation 'com.github.ahsanalidev:Frames:0.5' for build.gradle. You might want to replace this bit back.

    opened by altrr2 1
  • Unhandled Exception: MissingPluginException(No implementation found for method initNsfw on channel flutter_nsfw)

    Unhandled Exception: MissingPluginException(No implementation found for method initNsfw on channel flutter_nsfw)

    Hi! I'm trying to use the lib but when I call the function FlutterNsfw.getPhotoNSFWScore() it errors out and my app closes. I'll leave some log messages:

    E/AndroidRuntime(14521): io.github.devzwy.nsfw.NSFWException: 请调用NSFWHelper.init(...)函数后再试! E/AndroidRuntime(14521): at io.github.devzwy.nsfw.NSFWHelper.getNSFWScore(NSFWHelper.kt:246) E/AndroidRuntime(14521): at io.github.devzwy.nsfw.NSFWHelper$getNSFWScore$1.invokeSuspend(NSFWHelper.kt:173) E/AndroidRuntime(14521): at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33) E/AndroidRuntime(14521): at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:106) E/AndroidRuntime(14521): at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:571) E/AndroidRuntime(14521): at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:750) E/AndroidRuntime(14521): at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:678)

    opened by Staminax 1
  • Crash build example

    Crash build example

    └──╼ $flutter doctor -v
    [!] Flutter (Channel unknown, 3.3.1, on Pop!_OS 22.04 LTS
        5.19.0-76051900-generic, locale en_US.UTF-8)
        ! Flutter version 3.3.1 on channel unknown at
          /home/zeus/snap/flutter/common/flutter
        ! Upstream repository unknown
        • Framework revision 4f9d92fbbd (4 weeks ago), 2022-09-06 17:54:53 -0700
        • Engine revision 3efdf03e73
        • Dart version 2.18.0
        • DevTools version 2.15.0
    
    [✓] Android toolchain - develop for Android devices (Android SDK version 33.0.0)
        • Android SDK at /home/zeus/Android/Sdk
        • Platform android-33, build-tools 33.0.0
        • Java binary at: /home/zeus/android-studio/jre/bin/java
        • Java version OpenJDK Runtime Environment (build
          11.0.12+0-b1504.28-7817840)
        • All Android licenses accepted.
    
    [✓] Chrome - develop for the web
        • Chrome at google-chrome
    
    [✓] Linux toolchain - develop for Linux desktop
        • clang version 6.0.0-1ubuntu2 (tags/RELEASE_600/final)
        • cmake version 3.10.2
        • ninja version 1.8.2
        • pkg-config version 0.29.1
    
    [✓] Android Studio (version 2021.2)
        • Android Studio at /home/zeus/android-studio
        • 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.71.2)
        • VS Code at /usr/share/code
        • Flutter extension version 3.50.0
    
    [✓] Connected device (3 available)
        • sdk gphone x86 64 (mobile) • emulator-5554 • android-x64    • Android 11
          (API 30) (emulator)
        • Linux (desktop)            • linux         • linux-x64      • Pop!_OS
          22.04 LTS 5.19.0-76051900-generic
        • Chrome (web)               • chrome        • web-javascript • Google
          Chrome 105.0.5195.125
    
    [✓] HTTP Host Availability
        • All required HTTP hosts are available
    
    ! Doctor found issues in 1 category.
    
    Launching lib/main.dart on sdk gphone x86 64 in debug mode...
    Note: /home/zeus/snap/flutter/common/flutter/.pub-cache/hosted/pub.dartlang.org/path_provider_android-2.0.12/android/src/main/java/io/flutter/plugins/pathprovider/PathProviderPlugin.java uses unchecked or unsafe operations.
    Note: Recompile with -Xlint:unchecked for details.
    D8: Cannot fit requested classes in a single dex file (# methods: 65890 > 65536)
    com.android.builder.dexing.DexArchiveMergerException: Error while merging dex archives: 
    The number of method references in a .dex file cannot exceed 64K.
    Learn how to resolve this issue at https://developer.android.com/tools/building/multidex.html
    	at com.android.builder.dexing.D8DexArchiveMerger.getExceptionToRethrow(D8DexArchiveMerger.java:132)
    	at com.android.builder.dexing.D8DexArchiveMerger.mergeDexArchives(D8DexArchiveMerger.java:119)
    	at com.android.build.gradle.internal.transforms.DexMergerTransformCallable.call(DexMergerTransformCallable.java:102)
    	at com.android.build.gradle.internal.tasks.DexMergingTaskRunnable.run(DexMergingTask.kt:432)
    	at com.android.build.gradle.internal.tasks.Workers$ActionFacade.run(Workers.kt:242)
    	at org.gradle.workers.internal.AdapterWorkAction.execute(AdapterWorkAction.java:57)
    	at org.gradle.workers.internal.DefaultWorkerServer.execute(DefaultWorkerServer.java:63)
    	at org.gradle.workers.internal.NoIsolationWorkerFactory$1$1.create(NoIsolationWorkerFactory.java:67)
    	at org.gradle.workers.internal.NoIsolationWorkerFactory$1$1.create(NoIsolationWorkerFactory.java:63)
    	at org.gradle.internal.classloader.ClassLoaderUtils.executeInClassloader(ClassLoaderUtils.java:97)
    	at org.gradle.workers.internal.NoIsolationWorkerFactory$1.lambda$execute$0(NoIsolationWorkerFactory.java:63)
    	at org.gradle.workers.internal.AbstractWorker$1.call(AbstractWorker.java:44)
    	at org.gradle.workers.internal.AbstractWorker$1.call(AbstractWorker.java:41)
    	at org.gradle.internal.operations.DefaultBuildOperationRunner$CallableBuildOperationWorker.execute(DefaultBuildOperationRunner.java:200)
    	at org.gradle.internal.operations.DefaultBuildOperationRunner$CallableBuildOperationWorker.execute(DefaultBuildOperationRunner.java:195)
    	at org.gradle.internal.operations.DefaultBuildOperationRunner$3.execute(DefaultBuildOperationRunner.java:75)
    	at org.gradle.internal.operations.DefaultBuildOperationRunner$3.execute(DefaultBuildOperationRunner.java:68)
    	at org.gradle.internal.operations.DefaultBuildOperationRunner.execute(DefaultBuildOperationRunner.java:153)
    	at org.gradle.internal.operations.DefaultBuildOperationRunner.execute(DefaultBuildOperationRunner.java:68)
    	at org.gradle.internal.operations.DefaultBuildOperationRunner.call(DefaultBuildOperationRunner.java:62)
    	at org.gradle.internal.operations.DefaultBuildOperationExecutor.lambda$call$2(DefaultBuildOperationExecutor.java:76)
    	at org.gradle.internal.operations.UnmanagedBuildOperationWrapper.callWithUnmanagedSupport(UnmanagedBuildOperationWrapper.java:54)
    	at org.gradle.internal.operations.DefaultBuildOperationExecutor.call(DefaultBuildOperationExecutor.java:76)
    	at org.gradle.workers.internal.AbstractWorker.executeWrappedInBuildOperation(AbstractWorker.java:41)
    	at org.gradle.workers.internal.NoIsolationWorkerFactory$1.execute(NoIsolationWorkerFactory.java:60)
    	at org.gradle.workers.internal.DefaultWorkerExecutor.lambda$submitWork$2(DefaultWorkerExecutor.java:200)
    	at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
    	at org.gradle.internal.work.DefaultConditionalExecutionQueue$ExecutionRunner.runExecution(DefaultConditionalExecutionQueue.java:215)
    	at org.gradle.internal.work.DefaultConditionalExecutionQueue$ExecutionRunner.runBatch(DefaultConditionalExecutionQueue.java:164)
    	at org.gradle.internal.work.DefaultConditionalExecutionQueue$ExecutionRunner.run(DefaultConditionalExecutionQueue.java:131)
    	at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
    	at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
    	at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:64)
    	at org.gradle.internal.concurrent.ManagedExecutorImpl$1.run(ManagedExecutorImpl.java:48)
    	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
    	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
    	at org.gradle.internal.concurrent.ThreadFactoryImpl$ManagedThreadRunnable.run(ThreadFactoryImpl.java:56)
    	at java.base/java.lang.Thread.run(Thread.java:829)
    Caused by: com.android.tools.r8.CompilationFailedException: Compilation failed to complete, position: null
    	at Version.fakeStackEntry(Version_2.1.62.java:0)
    	at com.android.tools.r8.utils.Y.a(SourceFile:78)
    	at com.android.tools.r8.D8.run(D8.java:11)
    	at com.android.builder.dexing.D8DexArchiveMerger.mergeDexArchives(D8DexArchiveMerger.java:117)
    	... 36 more
    Caused by: com.android.tools.r8.utils.b: Cannot fit requested classes in a single dex file (# methods: 65890 > 65536)
    	at com.android.tools.r8.utils.T0.error(SourceFile:1)
    	at com.android.tools.r8.utils.T0.a(SourceFile:2)
    	at com.android.tools.r8.dex.P.a(SourceFile:740)
    	at com.android.tools.r8.dex.P$h.a(SourceFile:7)
    	at com.android.tools.r8.dex.b.a(SourceFile:14)
    	at com.android.tools.r8.dex.b.b(SourceFile:25)
    	at com.android.tools.r8.D8.d(D8.java:133)
    	at com.android.tools.r8.D8.b(D8.java:1)
    	at com.android.tools.r8.utils.Y.a(SourceFile:36)
    	... 38 more
    
    FAILURE: Build failed with an exception.
    
    * What went wrong:
    Execution failed for task ':app:mergeDexDebug'.
    > A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$ActionFacade
       > com.android.builder.dexing.DexArchiveMergerException: Error while merging dex archives: 
         The number of method references in a .dex file cannot exceed 64K.
         Learn how to resolve this issue at https://developer.android.com/tools/building/multidex.html
    
    * Try:
    Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
    
    * Get more help at https://help.gradle.org
    BUILD FAILED in 2m 11s
    [!] App requires Multidex support
        Multidex support is required for your android app to build since the number of methods has exceeded 64k. See https://docs.flutter.dev/deployment/android#enabling-multidex-support for more information. You may pass the --no-multidex flag to skip Flutter's multidex support to use a manual solution.
        Flutter tool can add multidex support. The following file will be added by flutter:
            android/app/src/main/java/io/flutter/app/FlutterMultiDexApplication.java
    cannot prompt without a terminal ui
    Exception: Gradle task assembleDebug failed with exit code 1
    Exited (sigterm)
    
    opened by teixeirazeus 0
  • Cannot build flutter_nsfw in ios after adding the package

    Cannot build flutter_nsfw in ios after adding the package

    ios % flutter run Changing current working directory to: /Users/ Launching lib/main.dart on iPhone 13 Pro in debug mode... Running pod install... 1,033ms CocoaPods' output: ↳ Preparing

    Analyzing dependencies
    
    Inspecting targets to integrate
      Using `ARCHS` setting to build architectures of target `Pods-Runner`: (``)
    
    Finding Podfile changes
      A flutter_nsfw
      - Flutter
      - cloud_firestore
      - cloud_functions
      - connectivity_plus
      - device_info_plus
      - firebase_analytics
      - firebase_auth
      - firebase_core
      - firebase_crashlytics
      - firebase_messaging
      - firebase_storage
      - flutter_braintree
      - flutter_email_sender
      - flutter_facebook_auth
      - flutter_keyboard_visibility
      - flutter_local_notifications
      - flutter_native_image
      - geocoding
      - geolocator_apple
      - google_sign_in_ios
      - image_cropper
      - image_picker_ios
      - path_provider_ios
      - rate_my_app
      - shared_preferences_ios
      - sign_in_with_apple
      - sqflite
    
    Fetching external sources
    -> Fetching podspec for `Flutter` from `Flutter`
    -> Fetching podspec for `cloud_firestore` from `.symlinks/plugins/cloud_firestore/ios`
    cloud_firestore: Using Firebase SDK version '8.15.0' defined in 'firebase_core'
    -> Fetching podspec for `cloud_functions` from `.symlinks/plugins/cloud_functions/ios`
    cloud_functions: Using Firebase SDK version '8.15.0' defined in 'firebase_core'
    -> Fetching podspec for `connectivity_plus` from `.symlinks/plugins/connectivity_plus/ios`
    -> Fetching podspec for `device_info_plus` from `.symlinks/plugins/device_info_plus/ios`
    -> Fetching podspec for `firebase_analytics` from `.symlinks/plugins/firebase_analytics/ios`
    firebase_analytics: Using Firebase SDK version '8.15.0' defined in 'firebase_core'
    -> Fetching podspec for `firebase_auth` from `.symlinks/plugins/firebase_auth/ios`
    firebase_auth: Using Firebase SDK version '8.15.0' defined in 'firebase_core'
    -> Fetching podspec for `firebase_core` from `.symlinks/plugins/firebase_core/ios`
    firebase_core: Using Firebase SDK version '8.15.0' defined in 'firebase_core'
    -> Fetching podspec for `firebase_crashlytics` from `.symlinks/plugins/firebase_crashlytics/ios`
    Warning: firebase_app_id_file.json file does not exist. This may cause issues in upload-symbols. If this error is unexpected, try running flutterfire configure
    again.
    firebase_crashlytics: Using Firebase SDK version '8.15.0' defined in 'firebase_core'
    -> Fetching podspec for `firebase_messaging` from `.symlinks/plugins/firebase_messaging/ios`
    firebase_messaging: Using Firebase SDK version '8.15.0' defined in 'firebase_core'
    -> Fetching podspec for `firebase_storage` from `.symlinks/plugins/firebase_storage/ios`
    firebase_storage: Using Firebase SDK version '8.15.0' defined in 'firebase_core'
    -> Fetching podspec for `flutter_braintree` from `.symlinks/plugins/flutter_braintree/ios`
    -> Fetching podspec for `flutter_email_sender` from `.symlinks/plugins/flutter_email_sender/ios`
    -> Fetching podspec for `flutter_facebook_auth` from `.symlinks/plugins/flutter_facebook_auth/ios`
    -> Fetching podspec for `flutter_keyboard_visibility` from `.symlinks/plugins/flutter_keyboard_visibility/ios`
    -> Fetching podspec for `flutter_local_notifications` from `.symlinks/plugins/flutter_local_notifications/ios`
    -> Fetching podspec for `flutter_native_image` from `.symlinks/plugins/flutter_native_image/ios`
    -> Fetching podspec for `flutter_nsfw` from `.symlinks/plugins/flutter_nsfw/ios`
    -> Fetching podspec for `geocoding` from `.symlinks/plugins/geocoding/ios`
    -> Fetching podspec for `geolocator_apple` from `.symlinks/plugins/geolocator_apple/ios`
    -> Fetching podspec for `google_sign_in_ios` from `.symlinks/plugins/google_sign_in_ios/ios`
    -> Fetching podspec for `image_cropper` from `.symlinks/plugins/image_cropper/ios`
    -> Fetching podspec for `image_picker_ios` from `.symlinks/plugins/image_picker_ios/ios`
    -> Fetching podspec for `path_provider_ios` from `.symlinks/plugins/path_provider_ios/ios`
    -> Fetching podspec for `rate_my_app` from `.symlinks/plugins/rate_my_app/ios`
    -> Fetching podspec for `shared_preferences_ios` from `.symlinks/plugins/shared_preferences_ios/ios`
    -> Fetching podspec for `sign_in_with_apple` from `.symlinks/plugins/sign_in_with_apple/ios`
    -> Fetching podspec for `sqflite` from `.symlinks/plugins/sqflite/ios`
    
    Resolving dependencies of `Podfile`
      CDN: trunk Relative path: CocoaPods-version.yml exists! Returning local because checking is only performed in repo update
      CDN: trunk Relative path: all_pods_versions_f_4_e.txt exists! Returning local because checking is only performed in repo update
      CDN: trunk Relative path: Specs/f/4/e/FMDB/2.7.5/FMDB.podspec.json exists! Returning local because checking is only performed in repo update
      CDN: trunk Relative path: all_pods_versions_0_3_5.txt exists! Returning local because checking is only performed in repo update
      CDN: trunk Relative path: Specs/0/3/5/Firebase/9.0.0/Firebase.podspec.json exists! Returning local because checking is only performed in repo update
      CDN: trunk Relative path: Specs/0/3/5/Firebase/8.15.0/Firebase.podspec.json exists! Returning local because checking is only performed in repo update
      CDN: trunk Relative path: Specs/0/3/5/Firebase/8.15.0/Firebase.podspec.json exists! Returning local because checking is only performed in repo update
      CDN: trunk Relative path: all_pods_versions_d_d_6.txt exists! Returning local because checking is only performed in repo update
      CDN: trunk Relative path: Specs/d/d/6/ReachabilitySwift/5.0.0/ReachabilitySwift.podspec.json exists! Returning local because checking is only performed in repo
      update
      CDN: trunk Relative path: Specs/0/3/5/Firebase/8.15.0/Firebase.podspec.json exists! Returning local because checking is only performed in repo update
      CDN: trunk Relative path: Specs/0/3/5/Firebase/8.15.0/Firebase.podspec.json exists! Returning local because checking is only performed in repo update
      CDN: trunk Relative path: Specs/0/3/5/Firebase/8.15.0/Firebase.podspec.json exists! Returning local because checking is only performed in repo update
      CDN: trunk Relative path: Specs/0/3/5/Firebase/8.15.0/Firebase.podspec.json exists! Returning local because checking is only performed in repo update
      CDN: trunk Relative path: all_pods_versions_6_4_f.txt exists! Returning local because checking is only performed in repo update
      CDN: trunk Relative path: Specs/6/4/f/BraintreeDropIn/9.5.0/BraintreeDropIn.podspec.json exists! Returning local because checking is only performed in repo update
      CDN: trunk Relative path: all_pods_versions_d_a_5.txt exists! Returning local because checking is only performed in repo update
      CDN: trunk Relative path: Specs/d/a/5/Braintree/5.9.0/Braintree.podspec.json exists! Returning local because checking is only performed in repo update
      CDN: trunk Relative path: Specs/d/a/5/Braintree/5.6.3/Braintree.podspec.json exists! Returning local because checking is only performed in repo update
      CDN: trunk Relative path: Specs/d/a/5/Braintree/5.6.3/Braintree.podspec.json exists! Returning local because checking is only performed in repo update
      CDN: trunk Relative path: all_pods_versions_9_b_5.txt exists! Returning local because checking is only performed in repo update
      CDN: trunk Relative path: Specs/9/b/5/FBSDKCoreKit/13.2.0/FBSDKCoreKit.podspec.json exists! Returning local because checking is only performed in repo update
      CDN: trunk Relative path: all_pods_versions_b_3_c.txt exists! Returning local because checking is only performed in repo update
      CDN: trunk Relative path: Specs/b/3/c/FBSDKLoginKit/13.2.0/FBSDKLoginKit.podspec.json exists! Returning local because checking is only performed in repo update
      CDN: trunk Relative path: all_pods_versions_3_7_4.txt exists! Returning local because checking is only performed in repo update
      CDN: trunk Relative path: Specs/3/7/4/TOCropViewController/2.6.1/TOCropViewController.podspec.json exists! Returning local because checking is only performed in
      repo update
      CDN: trunk Relative path: Specs/0/3/5/Firebase/8.15.0/Firebase.podspec.json exists! Returning local because checking is only performed in repo update
      CDN: trunk Relative path: all_pods_versions_d_4_0.txt exists! Returning local because checking is only performed in repo update
      CDN: trunk Relative path: Specs/d/4/0/GoogleSignIn/6.2.1/GoogleSignIn.podspec.json exists! Returning local because checking is only performed in repo update
      CDN: trunk Relative path: CocoaPods-version.yml exists! Returning local because checking is only performed in repo update
    
    ――― MARKDOWN TEMPLATE ―――――――――――――――――――――――――――――――――――――――――――――――――――――――――――
    
    ### Command
    
    ```
    /usr/local/bin/pod install --verbose
    ```
    
    ### Report
    
    * What did you do?
    
    * What did you expect to happen?
    
    * What happened instead?
    
    
    ### Stack
    
    ```
       CocoaPods : 1.11.2
            Ruby : ruby 2.6.8p205 (2021-07-07 revision 67951) [universal.arm64e-darwin21]
        RubyGems : 3.0.3.1
            Host : macOS 12.4 (21F79)
           Xcode : 13.4.1 (13F100)
             Git : git version 2.32.1 (Apple Git-133)
    Ruby lib dir : /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib
    Repositories : trunk - CDN - https://cdn.cocoapods.org/
    ```
    
    ### Plugins
    
    ```
    cocoapods-clean       : 0.0.1
    cocoapods-deintegrate : 1.0.4
    cocoapods-plugins     : 1.0.0
    cocoapods-search      : 1.0.0
    cocoapods-stats       : 1.1.0
    cocoapods-trunk       : 1.5.0
    cocoapods-try         : 1.2.0
    ```
    
    ### Podfile
    
    ```ruby
    # Uncomment this line to define a global platform for your project
    # platform :ios, '9.0'
    # platform :ios, '13.0'
    
    $FirebaseAnalyticsWithoutAdIdSupport = true
    
    # CocoaPods analytics sends network stats synchronously affecting flutter build latency.
    ENV['COCOAPODS_DISABLE_STATS'] = 'true'
    
    project 'Runner', {
      'Debug' => :debug,
      'Profile' => :release,
      'Release' => :release,
    }
    
    def flutter_root
      generated_xcode_build_settings_path = File.expand_path(File.join('..', 'Flutter', 'Generated.xcconfig'), __FILE__)
      unless File.exist?(generated_xcode_build_settings_path)
        raise "#{generated_xcode_build_settings_path} must exist. If you're running pod install manually, make sure flutter pub get is executed first"
      end
    
      File.foreach(generated_xcode_build_settings_path) do |line|
        matches = line.match(/FLUTTER_ROOT\=(.*)/)
        return matches[1].strip if matches
      end
      raise "FLUTTER_ROOT not found in #{generated_xcode_build_settings_path}. Try deleting Generated.xcconfig, then run flutter pub get"
    end
    
    require File.expand_path(File.join('packages', 'flutter_tools', 'bin', 'podhelper'), flutter_root)
    
    flutter_ios_podfile_setup
    
    target 'Runner' do
      use_frameworks!
      use_modular_headers!
    
      flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__))
    end
    
    post_install do |installer|
      installer.pods_project.targets.each do |target|
        flutter_additional_ios_build_settings(target)
      end
    end
    ```
    
    ### Error
    
    ```
    LoadError - dlopen(/Library/Ruby/Gems/2.6.0/gems/ffi-1.15.5/lib/ffi_c.bundle, 0x0009): tried: '/Library/Ruby/Gems/2.6.0/gems/ffi-1.15.5/lib/ffi_c.bundle' (mach-o
    file, but is an incompatible architecture (have 'x86_64', need 'arm64e')) - /Library/Ruby/Gems/2.6.0/gems/ffi-1.15.5/lib/ffi_c.bundle
    /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require'
    /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require'
    /Library/Ruby/Gems/2.6.0/gems/ffi-1.15.5/lib/ffi.rb:5:in `rescue in <top (required)>'
    /Library/Ruby/Gems/2.6.0/gems/ffi-1.15.5/lib/ffi.rb:2:in `<top (required)>'
    /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require'
    /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require'
    /Library/Ruby/Gems/2.6.0/gems/ethon-0.12.0/lib/ethon.rb:2:in `<top (required)>'
    /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require'
    /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require'
    /Library/Ruby/Gems/2.6.0/gems/typhoeus-1.4.0/lib/typhoeus.rb:2:in `<top (required)>'
    /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require'
    /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require'
    /Library/Ruby/Gems/2.6.0/gems/cocoapods-core-1.11.2/lib/cocoapods-core/cdn_source.rb:440:in `download_typhoeus_impl_async'
    /Library/Ruby/Gems/2.6.0/gems/cocoapods-core-1.11.2/lib/cocoapods-core/cdn_source.rb:372:in `download_and_save_with_retries_async'
    /Library/Ruby/Gems/2.6.0/gems/cocoapods-core-1.11.2/lib/cocoapods-core/cdn_source.rb:365:in `download_file_async'
    /Library/Ruby/Gems/2.6.0/gems/cocoapods-core-1.11.2/lib/cocoapods-core/cdn_source.rb:338:in `download_file'
    /Library/Ruby/Gems/2.6.0/gems/cocoapods-core-1.11.2/lib/cocoapods-core/cdn_source.rb:284:in `ensure_versions_file_loaded'
    /Library/Ruby/Gems/2.6.0/gems/cocoapods-core-1.11.2/lib/cocoapods-core/cdn_source.rb:208:in `search'
    /Library/Ruby/Gems/2.6.0/gems/cocoapods-core-1.11.2/lib/cocoapods-core/source/aggregate.rb:83:in `block in search'
    /Library/Ruby/Gems/2.6.0/gems/cocoapods-core-1.11.2/lib/cocoapods-core/source/aggregate.rb:83:in `select'
    /Library/Ruby/Gems/2.6.0/gems/cocoapods-core-1.11.2/lib/cocoapods-core/source/aggregate.rb:83:in `search'
    /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.11.2/lib/cocoapods/resolver.rb:416:in `create_set_from_sources'
    /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.11.2/lib/cocoapods/resolver.rb:385:in `find_cached_set'
    /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.11.2/lib/cocoapods/resolver.rb:360:in `specifications_for_dependency'
    /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.11.2/lib/cocoapods/resolver.rb:165:in `search_for'
    /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.11.2/lib/cocoapods/resolver.rb:274:in `block in sort_dependencies'
    /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.11.2/lib/cocoapods/resolver.rb:267:in `each'
    /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.11.2/lib/cocoapods/resolver.rb:267:in `sort_by'
    /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.11.2/lib/cocoapods/resolver.rb:267:in `sort_by!'
    /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.11.2/lib/cocoapods/resolver.rb:267:in `sort_dependencies'
    /Library/Ruby/Gems/2.6.0/gems/molinillo-0.8.0/lib/molinillo/delegates/specification_provider.rb:60:in `block in sort_dependencies'
    /Library/Ruby/Gems/2.6.0/gems/molinillo-0.8.0/lib/molinillo/delegates/specification_provider.rb:77:in `with_no_such_dependency_error_handling'
    /Library/Ruby/Gems/2.6.0/gems/molinillo-0.8.0/lib/molinillo/delegates/specification_provider.rb:59:in `sort_dependencies'
    /Library/Ruby/Gems/2.6.0/gems/molinillo-0.8.0/lib/molinillo/resolution.rb:754:in `push_state_for_requirements'
    /Library/Ruby/Gems/2.6.0/gems/molinillo-0.8.0/lib/molinillo/resolution.rb:744:in `require_nested_dependencies_for'
    /Library/Ruby/Gems/2.6.0/gems/molinillo-0.8.0/lib/molinillo/resolution.rb:727:in `activate_new_spec'
    /Library/Ruby/Gems/2.6.0/gems/molinillo-0.8.0/lib/molinillo/resolution.rb:684:in `attempt_to_activate'
    /Library/Ruby/Gems/2.6.0/gems/molinillo-0.8.0/lib/molinillo/resolution.rb:254:in `process_topmost_state'
    /Library/Ruby/Gems/2.6.0/gems/molinillo-0.8.0/lib/molinillo/resolution.rb:182:in `resolve'
    /Library/Ruby/Gems/2.6.0/gems/molinillo-0.8.0/lib/molinillo/resolver.rb:43:in `resolve'
    /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.11.2/lib/cocoapods/resolver.rb:94:in `resolve'
    /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.11.2/lib/cocoapods/installer/analyzer.rb:1078:in `block in resolve_dependencies'
    /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.11.2/lib/cocoapods/user_interface.rb:64:in `section'
    /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.11.2/lib/cocoapods/installer/analyzer.rb:1076:in `resolve_dependencies'
    /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.11.2/lib/cocoapods/installer/analyzer.rb:124:in `analyze'
    /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.11.2/lib/cocoapods/installer.rb:416:in `analyze'
    /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.11.2/lib/cocoapods/installer.rb:241:in `block in resolve_dependencies'
    /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.11.2/lib/cocoapods/user_interface.rb:64:in `section'
    /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.11.2/lib/cocoapods/installer.rb:240:in `resolve_dependencies'
    /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.11.2/lib/cocoapods/installer.rb:161:in `install!'
    /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.11.2/lib/cocoapods/command/install.rb:52:in `run'
    /Library/Ruby/Gems/2.6.0/gems/claide-1.0.3/lib/claide/command.rb:334:in `run'
    /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.11.2/lib/cocoapods/command.rb:52:in `run'
    /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.11.2/bin/pod:55:in `<top (required)>'
    /usr/local/bin/pod:23:in `load'
    /usr/local/bin/pod:23:in `<main>'
    ```
    
    ――― TEMPLATE END ――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――
    
    [!] Oh no, an error occurred.
    
    Search for existing GitHub issues similar to yours:
    https://github.com/CocoaPods/CocoaPods/search?q=dlopen%28%2FLibrary%2FRuby%2FGems%2F2.6.0%2Fgems%2Fffi-1.15.5%2Flib%2Fffi_c.bundle%2C+0x0009%29%3A+tried%3A+%27%2FLi
    brary%2FRuby%2FGems%2F2.6.0%2Fgems%2Fffi-1.15.5%2Flib%2Fffi_c.bundle%27+%28mach-o+file%2C+but+is+an+incompatible+architecture+%28have+%27x86_64%27%2C+need+%27arm64e
    %27%29%29+-+%2FLibrary%2FRuby%2FGems%2F2.6.0%2Fgems%2Fffi-1.15.5%2Flib%2Fffi_c.bundle&type=Issues
    
    If none exists, create a ticket, with the template displayed above, on:
    https://github.com/CocoaPods/CocoaPods/issues/new
    
    Be sure to first read the contributing guide for details on how to properly submit a ticket:
    https://github.com/CocoaPods/CocoaPods/blob/master/CONTRIBUTING.md
    
    Don't forget to anonymize any private data!
    
    Looking for related issues on cocoapods/cocoapods...
    

    Error output from CocoaPods: ↳ Searching for inspections failed: undefined method `map' for nil:NilClass

    [!] Automatically assigning platform `iOS` with version `12.0` on target `Runner` because no platform was specified. Please specify a platform for this target in
    your Podfile. See `https://guides.cocoapods.org/syntax/podfile.html#platform`.
    

    Error running pod install Error launching application on iPhone 13 Pro.

    <---------------FLUTTER DOCTOR--------------->

    [✓] Flutter (Channel stable, 3.0.2, on macOS 12.4 21F79 darwin-arm, locale en-AU) • Flutter version 3.0.2 at /Users/Developer/flutter • Upstream repository https://github.com/flutter/flutter.git • Framework revision cd41fdd495 (9 days ago), 2022-06-08 09:52:13 -0700 • Engine revision f15f824b57 • Dart version 2.17.3 • DevTools version 2.12.2

    [✓] Android toolchain - develop for Android devices (Android SDK version 31.0.0-rc5) • Android SDK at /Users/victormaisnam/Library/Android/sdk • Platform android-31, build-tools 31.0.0-rc5 • Java binary at: /Applications/Android Studio.app/Contents/jre/Contents/Home/bin/java • Java version OpenJDK Runtime Environment (build 11.0.11+0-b60-7772763) • All Android licenses accepted.

    [✓] Xcode - develop for iOS and macOS (Xcode 13.4.1) • Xcode at /Applications/Xcode.app/Contents/Developer • CocoaPods version 1.11.2

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

    [✓] Android Studio (version 2021.1) • 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.11+0-b60-7772763)

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

    [✓] Connected device (3 available) • iPhone 13 Pro (mobile) • 45FEC930-41F2-4FBB-A6DD-30D13610B9A9 • ios • com.apple.CoreSimulator.SimRuntime.iOS-15-5 (simulator) • macOS (desktop) • macos • darwin-arm64 • macOS 12.4 21F79 darwin-arm • Chrome (web) • chrome • web-javascript • Google Chrome 102.0.5005.115

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

    • No issues found!

    opened by gitHubAdminUser 9
  • Crashing

    Crashing

    D/TAG (12566): onMethodCall: initNsfw I/tflite (12566): Created TensorFlow Lite delegate for GPU. D/io.github.devzwy.nsfw.NSFWHelper(12566): 尝试从传入的模型路径读取模型 I/tflite (12566): Initialized TensorFlow Lite runtime. D/io.github.devzwy.nsfw.NSFWHelper(12566): 模型加载成功! D/io.github.devzwy.nsfw.NSFWHelper(12566): NSFWHelper初始化成功!GPU加速已成功开启 D/TAG (12566): onMethodCall: getPhotoNSFWScore E/AndroidRuntime(12566): FATAL EXCEPTION: DefaultDispatcher-worker-1 E/AndroidRuntime(12566): Process: com.strapps.closer, PID: 12566 E/AndroidRuntime(12566): java.lang.IllegalArgumentException: Cannot convert between a TensorFlowLite buffer with 150528 bytes and a Java Buffer with 602112 bytes. E/AndroidRuntime(12566): at org.tensorflow.lite.Tensor.throwIfShapeIsIncompatible(Tensor.java:332) E/AndroidRuntime(12566): at org.tensorflow.lite.Tensor.throwIfDataIsIncompatible(Tensor.java:305) E/AndroidRuntime(12566): at org.tensorflow.lite.Tensor.setTo(Tensor.java:123) E/AndroidRuntime(12566): at org.tensorflow.lite.NativeInterpreterWrapper.run(NativeInterpreterWrapper.java:150) E/AndroidRuntime(12566): at org.tensorflow.lite.Interpreter.runForMultipleInputsOutputs(Interpreter.java:311) E/AndroidRuntime(12566): at org.tensorflow.lite.Interpreter.run(Interpreter.java:272) E/AndroidRuntime(12566): at io.github.devzwy.nsfw.NSFWHelper.getNSFWScore(NSFWHelper.kt:227) E/AndroidRuntime(12566): at io.github.devzwy.nsfw.NSFWHelper$getNSFWScore$1.invokeSuspend(NSFWHelper.kt:173) E/AndroidRuntime(12566): at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33) E/AndroidRuntime(12566): at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:106) E/AndroidRuntime(12566): at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:571) E/AndroidRuntime(12566): at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:750) E/AndroidRuntime(12566): at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:678) E/AndroidRuntime(12566): at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:665) I/Process (12566): Sending signal. PID: 12566 SIG: 9 Lost connection to device.

    opened by aliosmnoz 7
Owner
Syed Ahsan Ali
Flutter Firebase Developer | ASP.NET Core Lover | Electrical Engineer | IOT Hobbyist
Syed Ahsan Ali
An example implementation of using a native iOS Notification Service Extension (to display images in remote push notification) in Titanium.

Titanium iOS Notification Service Extension An example implementation of using a native iOS Notification Service Extension (to display images in remot

Hans Knöchel 8 Nov 21, 2022
Near Procedure Call between flutter and native.

npcx A new flutter plugin project. Getting Started This project is a starting point for a Flutter plug-in package, a specialized package that includes

null 0 Jun 17, 2022
Docker images for Swift on Raspberry Pi and other ARM devices from balena's base images.

Swift on Balena Welcome to Swift on Balena – a set of Docker images for Swift on Raspberry Pi and other ARM devices. These images are based on balena'

Will Lisac 173 Dec 5, 2022
An alternative to using the native UIAlertController, with a thoughtful design and simple implementation.

HPAlertController An alternative to using the native UIAlertController, with a thoughtful design and simple implementation. Requirements iOS 15.0 and

Hugo Pivaral 8 Nov 13, 2022
A Swift package that provides convenient Lorem Ipsum text, images, colors and other placeholders for rapidly prototyping, building and testing your iOS applications.

Lorem Introducing Lorem, a placeholder generator library for iOS to help you rapidly prototype, build and test your iOS applications. By leveraging Sw

Thirdfort Limited 10 Dec 5, 2022
React Native library that implements PayPal Checkout flow using purely native code (swift).

react-native-paypal-swift React Native library that implements PayPal Checkout flow using purely native code (swift). Installation npm install react-n

Tibb 6 Nov 28, 2022
Flutter & flutter_boost开发iOS混合开发项目问题记录;iOS远程依赖Flutter Module组件代码;

[TOC] 这个仓库主要有2部分,整理了如何在iOS项目导入FlutterModule组件代码,以及整理开发过程中遇到的一些问题和对应的解决方案。 在iOS项目依赖FlutterModule组件代码 依赖Flutter组件代码的分为本地依赖、远程依赖2种。下面介绍的前3种是本地依赖,同时也是官方推荐

溪枫狼 18 Nov 18, 2022
A apple search ads attribution plugin for flutter

A apple search ads attribution plugin for flutter

liam 0 Oct 27, 2021
Mi Card App for Android & IOS in Flutter

Mi Card Our Goal Now that you've seen how to create a Flutter app entirely from scratch, we're going to go further and learn more about how to design

Ruksar Ahmed 0 Nov 6, 2021
Magic 8Ball App for Android & IOS in Flutter

Magic 8 Ball ?? Our Goal The objective of this challenge is to solidify what you've learn't in the Dicee tutorial. This app will guide you through the

Ruksar Ahmed 0 Nov 6, 2021
Example of a Flutter app in the status bar.

flutter_in_status_bar Example of a Flutter app in the status bar. This is the default counter app from Flutter but instead of running in a NSWindow it

Jochum van der Ploeg 40 Nov 29, 2022
React Native package for interacting with HomeKit devices

React Native package for interacting with HomeKit devices

Ibrahim Berat Kaya 4 Dec 24, 2021
Vahesaroyan-react-native-bubble-select - React native bubble picker

@vahesaroyan/react-native-bubble-select React native bubble picker Installation

Vahe Saroyan 0 Jan 30, 2022
React Native utility library around image and video files for getting metadata like MIME type, timestamp, duration, and dimensions. Works on iOS and Android using Java and Obj-C, instead of Node 🚀.

Qeepsake React Native File Utils Extracts information from image and video files including MIME type, duration (video), dimensions, and timestamp. The

Qeepsake 12 Oct 19, 2022
Kushal Shingote 1 Feb 2, 2022
Yummies is my first attempt at building a native iOS app using Swift and SwiftUI

Yummies is my first attempt at building a native iOS app using Swift and SwiftUI. A recipe browser where you can pin your favorite ones. Powered by Edamam Recipe Search API.

Yavor Radulov 2 Aug 27, 2022
A react native interface for integrating payments using Braintree

A react native interface for integrating payments using Braintree

eKreative 17 Dec 30, 2022
A property finder application written using React Native

React Native PropertyFinder App This repository accompanies the tutorial I published on Ray Wenderlich's website, which describes the process of build

Colin Eberhardt 276 Aug 14, 2022
Create an easy to peek SwiftUI View to showcase your own data, catalog, images, or anything you'd like.

Create an easy to peek SwiftUI View to showcase your own data, catalog, images, or anything you'd like.

Peter Larson 17 Jun 27, 2022