flutter / website

Flutter documentation web site
https://docs.flutter.dev
Other
2.81k stars 3.21k forks source link

Explain how to package native and Flutter dependencies #7758

Closed TimmyRB closed 1 year ago

TimmyRB commented 3 years ago

Steps to Reproduce

  1. Add SnapKit SDK as a Dependancy in build.gradle.
  2. Run flutter build apk

Expected results: The plugin builds and runs the example application

Actual results:

/Users/jnbra/Projects/snapkit/example/android/app/src/main/java/io/flutter/plugins/GeneratedPluginRegistrant.java:17: error: cannot access LoginStateController
    flutterEngine.getPlugins().add(new com.jacobbrasil.snapkit.SnapkitPlugin());
                          ^
class file for com.snapchat.kit.sdk.core.controller.LoginStateController not found
1 error

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:compileDebugJavaWithJavac'.
> Compilation failed; see the compiler error output for details.

The class is accessible and downloaded and I can view the source code for it in Android Studio. I've tried changing SDK versions, clearing my Gradle cache, invalidating and restarting, then rebuilding in Android Studio and a few others but any help would be greatly appreciated, thanks!

Logs ``` jnbra@Jacobs-MacBook-Pro example % flutter build apk -v [ +147 ms] executing: sysctl hw.optional.arm64 [ +34 ms] Exit code 0 from: sysctl hw.optional.arm64 [ +3 ms] hw.optional.arm64: 1 [ +8 ms] executing: [/Users/jnbra/Flutter/] git -c log.showSignature=false log -n 1 --pretty=format:%H [ +28 ms] Exit code 0 from: git -c log.showSignature=false log -n 1 --pretty=format:%H [ +1 ms] 02c026b03cd31dd3f867e5faeb7e104cce174c5f [ +1 ms] executing: [/Users/jnbra/Flutter/] git tag --points-at 02c026b03cd31dd3f867e5faeb7e104cce174c5f [ +27 ms] Exit code 0 from: git tag --points-at 02c026b03cd31dd3f867e5faeb7e104cce174c5f [ ] 2.2.1 [ +6 ms] executing: [/Users/jnbra/Flutter/] git rev-parse --abbrev-ref --symbolic @{u} [ +20 ms] Exit code 0 from: git rev-parse --abbrev-ref --symbolic @{u} [ ] origin/stable [ ] executing: [/Users/jnbra/Flutter/] git ls-remote --get-url origin [ +19 ms] Exit code 0 from: git ls-remote --get-url origin [ ] https://github.com/flutter/flutter.git [ +140 ms] executing: [/Users/jnbra/Flutter/] git rev-parse --abbrev-ref HEAD [ +29 ms] Exit code 0 from: git rev-parse --abbrev-ref HEAD [ ] stable [ +8 ms] executing: sw_vers -productName [ +18 ms] Exit code 0 from: sw_vers -productName [ ] macOS [ ] executing: sw_vers -productVersion [ +20 ms] Exit code 0 from: sw_vers -productVersion [ ] 11.5 [ ] executing: sw_vers -buildVersion [ +19 ms] Exit code 0 from: sw_vers -buildVersion [ ] 20G5033c [ +74 ms] Artifact Instance of 'AndroidGenSnapshotArtifacts' is not required, skipping update. [ ] Artifact Instance of 'AndroidInternalBuildArtifacts' is not required, skipping update. [ ] Artifact Instance of 'IOSEngineArtifacts' is not required, skipping update. [ ] Artifact Instance of 'FlutterWebSdk' is not required, skipping update. [ +2 ms] Artifact Instance of 'WindowsEngineArtifacts' is not required, skipping update. [ ] Artifact Instance of 'MacOSEngineArtifacts' is not required, skipping update. [ ] Artifact Instance of 'LinuxEngineArtifacts' is not required, skipping update. [ ] Artifact Instance of 'LinuxFuchsiaSDKArtifacts' is not required, skipping update. [ ] Artifact Instance of 'MacOSFuchsiaSDKArtifacts' is not required, skipping update. [ ] Artifact Instance of 'FlutterRunnerSDKArtifacts' is not required, skipping update. [ ] Artifact Instance of 'FlutterRunnerDebugSymbols' is not required, skipping update. [ +46 ms] Artifact Instance of 'MaterialFonts' is not required, skipping update. [ ] Artifact Instance of 'GradleWrapper' is not required, skipping update. [ +2 ms] Artifact Instance of 'AndroidInternalBuildArtifacts' is not required, skipping update. [ ] Artifact Instance of 'IOSEngineArtifacts' is not required, skipping update. [ ] Artifact Instance of 'FlutterWebSdk' is not required, skipping update. [ ] Artifact Instance of 'FlutterSdk' is not required, skipping update. [ ] Artifact Instance of 'WindowsEngineArtifacts' is not required, skipping update. [ ] Artifact Instance of 'MacOSEngineArtifacts' is not required, skipping update. [ ] Artifact Instance of 'LinuxEngineArtifacts' is not required, skipping update. [ ] Artifact Instance of 'LinuxFuchsiaSDKArtifacts' is not required, skipping update. [ ] Artifact Instance of 'MacOSFuchsiaSDKArtifacts' is not required, skipping update. [ ] Artifact Instance of 'FlutterRunnerSDKArtifacts' is not required, skipping update. [ ] Artifact Instance of 'FlutterRunnerDebugSymbols' is not required, skipping update. [ ] Artifact Instance of 'IosUsbArtifacts' is not required, skipping update. [ ] Artifact Instance of 'IosUsbArtifacts' is not required, skipping update. [ ] Artifact Instance of 'IosUsbArtifacts' is not required, skipping update. [ ] Artifact Instance of 'IosUsbArtifacts' is not required, skipping update. [ ] Artifact Instance of 'IosUsbArtifacts' is not required, skipping update. [ ] Artifact Instance of 'FontSubsetArtifacts' is not required, skipping update. [ ] Artifact Instance of 'PubDependencies' is not required, skipping update. [ +70 ms] Skipping pub get: version match. [ +51 ms] Found plugin path_provider at /Users/jnbra/Flutter/.pub-cache/hosted/pub.dartlang.org/path_provider-2.0.2/ [ +6 ms] Found plugin path_provider_linux at /Users/jnbra/Flutter/.pub-cache/hosted/pub.dartlang.org/path_provider_linux-2.0. 0/ [ +2 ms] Found plugin path_provider_macos at /Users/jnbra/Flutter/.pub-cache/hosted/pub.dartlang.org/path_provider_macos-2.0. 0/ [ +3 ms] Found plugin path_provider_windows at /Users/jnbra/Flutter/.pub-cache/hosted/pub.dartlang.org/path_provider_windows-2. 0.1/ [ +14 ms] Found plugin snapkit at /Users/jnbra/Projects/snapkit/ [ +109 ms] Found plugin path_provider at /Users/jnbra/Flutter/.pub-cache/hosted/pub.dartlang.org/path_provider-2.0.2/ [ +1 ms] Found plugin path_provider_linux at /Users/jnbra/Flutter/.pub-cache/hosted/pub.dartlang.org/path_provider_linux-2.0. 0/ [ +2 ms] Found plugin path_provider_macos at /Users/jnbra/Flutter/.pub-cache/hosted/pub.dartlang.org/path_provider_macos-2.0. 0/ [ +1 ms] Found plugin path_provider_windows at /Users/jnbra/Flutter/.pub-cache/hosted/pub.dartlang.org/path_provider_windows-2. 0.1/ [ +12 ms] Found plugin snapkit at /Users/jnbra/Projects/snapkit/ [ +12 ms] Generating /Users/jnbra/Projects/snapkit/example/android/app/src/main/java/io/flutter/plugi ns/GeneratedPluginRegistrant.java [ +47 ms] executing: sysctl hw.optional.arm64 [ +12 ms] Exit code 0 from: sysctl hw.optional.arm64 [ ] hw.optional.arm64: 1 [ ] executing: /usr/bin/arch -arm64e xcrun xcodebuild -version [ +666 ms] Exit code 0 from: /usr/bin/arch -arm64e xcrun xcodebuild -version [ +1 ms] Xcode 12.5.1 Build version 12E507 [ +73 ms] Building without sound null safety [ ] For more information see https://dart.dev/null-safety/unsound-null-safety [ +27 ms] Running Gradle task 'assembleRelease'... [ +4 ms] Using gradle from /Users/jnbra/Projects/snapkit/example/android/gradlew. [ +639 ms] executing: /usr/bin/plutil -convert json -o - /Applications/Android Studio.app/Contents/Info.plist [ +31 ms] Exit code 0 from: /usr/bin/plutil -convert json -o - /Applications/Android Studio.app/Contents/Info.plist [ ] {"CFBundleName":"Android Studio","JVMOptions":{"ClassPath":"$APP_PACKAGE\/Contents\/lib\/bootstrap.jar:$A PP_PACKAGE\/Contents\/lib\/extensions.jar:$APP_PACKAGE\/Contents\/lib\/util.jar: $APP_PACKAGE\/Contents\/lib\/jdom.jar:$APP_PACKAGE\/Contents\/lib\/log4j.jar:$AP P_PACKAGE\/Contents\/lib\/trove4j.jar:$APP_PACKAGE\/Contents\/lib\/jna.jar","JVM Version":"1.8*,1.8+","MainClass":"com.intellij.idea.Main","Properties":{"idea.pa ths.selector":"AndroidStudio4.1","idea.executable":"studio","idea.platform.prefi x":"AndroidStudio","idea.vendor.name":"Google","idea.home.path":"$APP_PACKAGE\/C ontents"}},"NSDesktopFolderUsageDescription":"An application in Android Studio requests access to the user's Desktop folder.","LSArchitecturePriority":["x86_64"],"CFBundleVersion":"AI-201.8743.12.4 1.7199119","CFBundleDevelopmentRegion":"English","NSCameraUsageDescription":"An application in Android Studio requests access to the device's camera.","CFBundleDocumentTypes":[{"CFBundleTypeName":"Android Studio Project File","CFBundleTypeExtensions":["ipr"],"CFBundleTypeRole":"Editor","CFBundleType IconFile":"studio.icns"},{"CFBundleTypeName":"All documents","CFBundleTypeExtensions":["*"],"CFBundleTypeOSTypes":["****"],"CFBund leTypeRole":"Editor","LSTypeIsPackage":false}],"NSSupportsAutomaticGraphicsSwitc hing":true,"CFBundlePackageType":"APPL","CFBundleIconFile":"studio.icns","NSHigh ResolutionCapable":true,"CFBundleShortVersionString":"4.1","NSMicrophoneUsageDes cription":"An application in Android Studio requests access to the device's microphone.","CFBundleInfoDictionaryVersion":"6.0","CFBundleExecutable":"studio" ,"NSLocationUsageDescription":"An application in Android Studio requests access to the user's location information.","LSRequiresNativeExecution":"YES","CFBundleURLTypes":[{"CFBundleTy peRole":"Editor","CFBundleURLName":"Stacktrace","CFBundleURLSchemes":["idea"]}], "CFBundleIdentifier":"com.google.android.studio","LSApplicationCategoryType":"pu blic.app-category.developer-tools","CFBundleSignature":"????","LSMinimumSystemVe rsion":"10.8","NSDocumentsFolderUsageDescription":"An application in Android Studio requests access to the user's Documents folder.","NSDownloadsFolderUsageDescription":"An application in Android Studio requests access to the user's Downloads folder.","NSNetworkVolumesUsageDescription":"An application in Android Studio requests access to files on a network volume.","CFBundleGetInfoString":"Android Studio 4.1, build AI-201.8743.12.41.7199119. Copyright JetBrains s.r.o., (c) 2000-2021","NSRemovableVolumesUsageDescription":"An application in Android Studio requests access to files on a removable volume."} [ +8 ms] executing: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java -version [ +90 ms] Exit code 0 from: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java -version [ +1 ms] openjdk version "1.8.0_242-release" OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b3-6915495) OpenJDK 64-Bit Server VM (build 25.242-b3-6915495, mixed mode) [ +2 ms] executing: [/Users/jnbra/Projects/snapkit/example/android/] /Users/jnbra/Projects/snapkit/example/android/gradlew -Pverbose=true -Ptarget-platform=android-arm,android-arm64,android-x64 -Ptarget=lib/main.dart -Pdart-obfuscation=false -Ptrack-widget-creation=true -Ptree-shake-icons=true assembleRelease [+19564 ms] > Task :app:compileFlutterBuildRelease [ +14 ms] [ +187 ms] executing: sysctl hw.optional.arm64 [ ] [ +57 ms] Exit code 0 from: sysctl hw.optional.arm64 [ ] [ +5 ms] hw.optional.arm64: 1 [ ] [ +15 ms] executing: [/Users/jnbra/Flutter/] git -c log.showSignature=false log -n 1 --pretty=format:%H [ +4 ms] [ +31 ms] Exit code 0 from: git -c log.showSignature=false log -n 1 --pretty=format:%H [ ] [ ] 02c026b03cd31dd3f867e5faeb7e104cce174c5f [ ] [ +1 ms] executing: [/Users/jnbra/Flutter/] git tag --points-at 02c026b03cd31dd3f867e5faeb7e104cce174c5f [ ] [ +54 ms] Exit code 0 from: git tag --points-at 02c026b03cd31dd3f867e5faeb7e104cce174c5f [ ] [ ] 2.2.1 [ +2 ms] [ +8 ms] executing: [/Users/jnbra/Flutter/] git rev-parse --abbrev-ref --symbolic @{u} [ ] [ +28 ms] Exit code 0 from: git rev-parse --abbrev-ref --symbolic @{u} [ ] [ ] origin/stable [ ] [ ] executing: [/Users/jnbra/Flutter/] git ls-remote --get-url origin [ ] [ +20 ms] Exit code 0 from: git ls-remote --get-url origin [ ] [ ] https://github.com/flutter/flutter.git [ ] [ +87 ms] executing: [/Users/jnbra/Flutter/] git rev-parse --abbrev-ref HEAD [ ] [ +39 ms] Exit code 0 from: git rev-parse --abbrev-ref HEAD [ ] [ ] stable [ ] [ +7 ms] executing: sw_vers -productName [ ] [ +17 ms] Exit code 0 from: sw_vers -productName [ ] [ ] macOS [ ] [ ] executing: sw_vers -productVersion [ ] [ +16 ms] Exit code 0 from: sw_vers -productVersion [ ] [ ] 11.5 [ ] [ ] executing: sw_vers -buildVersion [ ] [ +16 ms] Exit code 0 from: sw_vers -buildVersion [ ] [ ] 20G5033c [ ] [ +70 ms] Artifact Instance of 'AndroidGenSnapshotArtifacts' is not required, skipping update. [ ] [ ] Artifact Instance of 'AndroidInternalBuildArtifacts' is not required, skipping update. [ ] [ ] Artifact Instance of 'IOSEngineArtifacts' is not required, skipping update. [ ] [ ] Artifact Instance of 'FlutterWebSdk' is not required, skipping update. [ ] [ +3 ms] Artifact Instance of 'WindowsEngineArtifacts' is not required, skipping update. [ ] [ ] Artifact Instance of 'MacOSEngineArtifacts' is not required, skipping update. [ ] [ ] Artifact Instance of 'LinuxEngineArtifacts' is not required, skipping update. [ ] [ ] Artifact Instance of 'LinuxFuchsiaSDKArtifacts' is not required, skipping update. [ ] [ ] Artifact Instance of 'MacOSFuchsiaSDKArtifacts' is not required, skipping update. [ ] [ ] Artifact Instance of 'FlutterRunnerSDKArtifacts' is not required, skipping update. [ ] [ ] Artifact Instance of 'FlutterRunnerDebugSymbols' is not required, skipping update. [ ] [ +128 ms] Artifact Instance of 'MaterialFonts' is not required, skipping update. [ ] [ ] Artifact Instance of 'GradleWrapper' is not required, skipping update. [ ] [ +2 ms] Artifact Instance of 'AndroidInternalBuildArtifacts' is not required, skipping update. [ ] [ ] Artifact Instance of 'IOSEngineArtifacts' is not required, skipping update. [ ] [ ] Artifact Instance of 'FlutterWebSdk' is not required, skipping update. [ ] [ ] Artifact Instance of 'FlutterSdk' is not required, skipping update. [ ] [ ] Artifact Instance of 'WindowsEngineArtifacts' is not required, skipping update. [ ] [ ] Artifact Instance of 'MacOSEngineArtifacts' is not required, skipping update. [ ] [ ] Artifact Instance of 'LinuxEngineArtifacts' is not required, skipping update. [ ] [ ] Artifact Instance of 'LinuxFuchsiaSDKArtifacts' is not required, skipping update. [ ] [ ] Artifact Instance of 'MacOSFuchsiaSDKArtifacts' is not required, skipping update. [ ] [ ] Artifact Instance of 'FlutterRunnerSDKArtifacts' is not required, skipping update. [ ] [ ] Artifact Instance of 'FlutterRunnerDebugSymbols' is not required, skipping update. [ ] [ ] Artifact Instance of 'IosUsbArtifacts' is not required, skipping update. [ ] [ ] Artifact Instance of 'IosUsbArtifacts' is not required, skipping update. [ ] [ ] Artifact Instance of 'IosUsbArtifacts' is not required, skipping update. [ ] [ ] Artifact Instance of 'IosUsbArtifacts' is not required, skipping update. [ ] [ ] Artifact Instance of 'IosUsbArtifacts' is not required, skipping update. [ ] [ ] Artifact Instance of 'FontSubsetArtifacts' is not required, skipping update. [ ] [ ] Artifact Instance of 'PubDependencies' is not required, skipping update. [ ] [ +42 ms] Initializing file store [ ] [ +45 ms] Skipping target: gen_localizations [ ] [ +8 ms] kernel_snapshot: Starting due to {} [ ] [ +18 ms] /Users/jnbra/Flutter/bin/cache/dart-sdk/bin/dart --disable-dart-dev /Users/jnbra/Flutter/bin/cache/artifacts/engine/darwin-x64/frontend_server.dart. snapshot --sdk-root /Users/jnbra/Flutter/bin/cache/artifacts/engine/common/flutter_patched_sdk_produ ct/ --target=flutter --no-print-incremental-dependencies -Ddart.vm.profile=false -Ddart.vm.product=true --aot --tfa --packages /Users/jnbra/Projects/snapkit/example/.dart_tool/package_config.json --output-dill /Users/jnbra/Projects/snapkit/example/.dart_tool/flutter_build/aef22c7a7cbeaf4f7 2eec55ef3eb653d/app.dill --depfile /Users/jnbra/Projects/snapkit/example/.dart_tool/flutter_build/aef22c7a7cbeaf4f7 2eec55ef3eb653d/kernel_snapshot.d package:snapkit_example/main.dart [+10148 ms] [+10891 ms] kernel_snapshot: Complete [ +483 ms] [ +439 ms] android_aot_release_android-arm: Starting due to {} [ +6 ms] [ +14 ms] executing: /Users/jnbra/Flutter/bin/cache/artifacts/engine/android-arm-release/darwin-x64/g en_snapshot --deterministic --snapshot_kind=app-aot-elf --elf=/Users/jnbra/Projects/snapkit/example/.dart_tool/flutter_build/aef22c7a7cb eaf4f72eec55ef3eb653d/armeabi-v7a/app.so --strip --no-sim-use-hardfp --no-use-integer-division /Users/jnbra/Projects/snapkit/example/.dart_tool/flutter_build/aef22c7a7cbeaf4f7 2eec55ef3eb653d/app.dill [ +2 ms] [ +5 ms] aot_android_asset_bundle: Starting due to {} [ ] [ +28 ms] android_aot_release_android-arm64: Starting due to {} [ ] [ +2 ms] executing: /Users/jnbra/Flutter/bin/cache/artifacts/engine/android-arm64-release/darwin-x64 /gen_snapshot --deterministic --snapshot_kind=app-aot-elf --elf=/Users/jnbra/Projects/snapkit/example/.dart_tool/flutter_build/aef22c7a7cb eaf4f72eec55ef3eb653d/arm64-v8a/app.so --strip /Users/jnbra/Projects/snapkit/example/.dart_tool/flutter_build/aef22c7a7cbeaf4f7 2eec55ef3eb653d/app.dill [ ] [ ] android_aot_release_android-x64: Starting due to {} [ ] [ ] executing: /Users/jnbra/Flutter/bin/cache/artifacts/engine/android-x64-release/darwin-x64/g en_snapshot --deterministic --snapshot_kind=app-aot-elf --elf=/Users/jnbra/Projects/snapkit/example/.dart_tool/flutter_build/aef22c7a7cb eaf4f72eec55ef3eb653d/x86_64/app.so --strip /Users/jnbra/Projects/snapkit/example/.dart_tool/flutter_build/aef22c7a7cbeaf4f7 2eec55ef3eb653d/app.dill [ +189 ms] [ +199 ms] Running command: /Users/jnbra/Flutter/bin/cache/dart-sdk/bin/dart --disable-dart-dev /Users/jnbra/Flutter/bin/cache/artifacts/engine/darwin-x64/const_finder.dart.sna pshot --kernel-file /Users/jnbra/Projects/snapkit/example/.dart_tool/flutter_build/aef22c7a7cbeaf4f7 2eec55ef3eb653d/app.dill --class-library-uri package:flutter/src/widgets/icon_data.dart --class-name IconData [+1398 ms] [+1382 ms] Running font-subset: /Users/jnbra/Flutter/bin/cache/artifacts/engine/darwin-x64/font-subset /Users/jnbra/Projects/snapkit/example/build/app/intermediates/flutter/release/fl utter_assets/fonts/MaterialIcons-Regular.otf /Users/jnbra/Flutter/bin/cache/artifacts/material_fonts/MaterialIcons-Regular.ot f, using codepoints 58727 58332 57490 57491 57706 57647 [ +96 ms] [ +75 ms] aot_android_asset_bundle: Complete [+4706 ms] [+4691 ms] android_aot_release_android-x64: Complete [ +93 ms] [ +169 ms] android_aot_bundle_release_android-x64: Starting due to {} [ ] [ +5 ms] android_aot_bundle_release_android-x64: Complete [ +98 ms] [ +46 ms] android_aot_release_android-arm: Complete [ +102 ms] [ +158 ms] android_aot_bundle_release_android-arm: Starting due to {} [ ] [ +2 ms] android_aot_bundle_release_android-arm: Complete [ +98 ms] [ +45 ms] android_aot_release_android-arm64: Complete [ +99 ms] [ +156 ms] android_aot_bundle_release_android-arm64: Starting due to {} [ ] [ +2 ms] android_aot_bundle_release_android-arm64: Complete [ +100 ms] [ +46 ms] _composite: Starting due to {} [ ] [ ] _composite: Complete [ ] [ ] Persisting file store [ ] [ +8 ms] Done persisting file store [ ] [ +7 ms] build succeeded. [ ] [ +16 ms] "flutter assemble" took 18,670ms. [ +298 ms] [ +267 ms] ensureAnalyticsSent: 253ms [ ] [ +2 ms] Running shutdown hooks [ ] [ ] Shutdown hooks complete [ ] [ ] exiting with code 0 [ +801 ms] > Task :app:packLibsflutterBuildRelease [ ] > Task :app:preBuild UP-TO-DATE [ ] > Task :app:extractProguardFiles [ ] > Task :app:preReleaseBuild [ ] > Task :path_provider:preBuild UP-TO-DATE [ ] > Task :path_provider:preReleaseBuild UP-TO-DATE [ ] > Task :path_provider:compileReleaseAidl NO-SOURCE [ ] > Task :snapkit:preBuild UP-TO-DATE [ ] > Task :snapkit:preReleaseBuild UP-TO-DATE [ ] > Task :snapkit:compileReleaseAidl NO-SOURCE [ ] > Task :app:compileReleaseAidl NO-SOURCE [ +95 ms] > Task :path_provider:packageReleaseRenderscript NO-SOURCE [ ] > Task :snapkit:packageReleaseRenderscript NO-SOURCE [ +1 ms] > Task :app:compileReleaseRenderscript NO-SOURCE [ ] > Task :app:generateReleaseBuildConfig [ ] > Task :path_provider:writeReleaseAarMetadata [ ] > Task :snapkit:writeReleaseAarMetadata [ ] > Task :app:cleanMergeReleaseAssets UP-TO-DATE [ ] > Task :app:javaPreCompileRelease [ +96 ms] > Task :app:mergeReleaseShaders [ ] > Task :app:compileReleaseShaders NO-SOURCE [ ] > Task :app:generateReleaseAssets UP-TO-DATE [ ] > Task :path_provider:mergeReleaseShaders [ ] > Task :path_provider:compileReleaseShaders NO-SOURCE [ ] > Task :path_provider:generateReleaseAssets UP-TO-DATE [ ] > Task :path_provider:packageReleaseAssets [ ] > Task :snapkit:mergeReleaseShaders [ ] > Task :snapkit:compileReleaseShaders NO-SOURCE [ ] > Task :snapkit:generateReleaseAssets UP-TO-DATE [ ] > Task :snapkit:packageReleaseAssets [ +99 ms] > Task :app:mergeReleaseAssets [ +2 ms] > Task :app:copyFlutterAssetsRelease [ +2 ms] > Task :app:generateReleaseResValues [ +2 ms] > Task :app:generateReleaseResources [ ] > Task :path_provider:compileReleaseRenderscript NO-SOURCE [ ] > Task :path_provider:generateReleaseResValues [ ] > Task :path_provider:generateReleaseResources [ ] > Task :path_provider:packageReleaseResources [ ] > Task :snapkit:compileReleaseRenderscript NO-SOURCE [ ] > Task :snapkit:generateReleaseResValues [ ] > Task :snapkit:generateReleaseResources [ ] > Task :snapkit:packageReleaseResources [+1492 ms] > Task :app:createReleaseCompatibleScreenManifests [ +96 ms] > Task :app:checkReleaseAarMetadata [ ] > Task :app:extractDeepLinksRelease [ ] > Task :path_provider:extractDeepLinksRelease [ +102 ms] > Task :snapkit:extractDeepLinksRelease [ +99 ms] > Task :path_provider:parseReleaseLocalResources [ ] > Task :snapkit:parseReleaseLocalResources [ ] > Task :path_provider:generateReleaseBuildConfig [ +99 ms] > Task :snapkit:generateReleaseBuildConfig [ ] > Task :path_provider:javaPreCompileRelease [ ] > Task :snapkit:processReleaseManifest [ ] > Task :path_provider:processReleaseManifest [ ] > Task :snapkit:javaPreCompileRelease [ +100 ms] > Task :app:mergeReleaseResources [ ] > Task :app:processReleaseMainManifest [ +94 ms] > Task :app:processReleaseManifest [ +105 ms] > Task :path_provider:prepareLintJarForPublish UP-TO-DATE [ ] > Task :snapkit:prepareLintJarForPublish UP-TO-DATE [ ] > Task :app:mergeReleaseNativeDebugMetadata NO-SOURCE [ +95 ms] > Task :app:compressReleaseAssets [ +98 ms] > Task :path_provider:generateReleaseRFile [ +600 ms] > Task :app:processReleaseJavaRes NO-SOURCE [ ] > Task :app:checkReleaseDuplicateClasses [ ] > Task :path_provider:processReleaseJavaRes NO-SOURCE [ ] > Task :path_provider:bundleLibResRelease NO-SOURCE [ ] > Task :snapkit:processReleaseJavaRes NO-SOURCE [ ] > Task :snapkit:bundleLibResRelease NO-SOURCE [ ] > Task :app:processReleaseManifestForPackage [ +501 ms] > Task :app:collectReleaseDependencies [ +99 ms] > Task :app:mergeReleaseJavaResource [ +102 ms] > Task :app:sdkReleaseDependencyData [ ] > Task :app:mergeReleaseJniLibFolders [ ] > Task :path_provider:mergeReleaseJniLibFolders [ ] > Task :path_provider:mergeReleaseNativeLibs NO-SOURCE [ ] > Task :path_provider:stripReleaseDebugSymbols NO-SOURCE [ ] > Task :path_provider:copyReleaseJniLibsProjectOnly [ ] > Task :snapkit:mergeReleaseJniLibFolders [ ] > Task :snapkit:mergeReleaseNativeLibs NO-SOURCE [ ] > Task :snapkit:stripReleaseDebugSymbols NO-SOURCE [ ] > Task :snapkit:copyReleaseJniLibsProjectOnly [ +97 ms] > Task :app:validateSigningRelease [ ] > Task :path_provider:copyReleaseJniLibsProjectAndLocalJars [ +96 ms] > Task :path_provider:mergeReleaseJavaResource [ +301 ms] > Task :path_provider:mergeReleaseResources [ +298 ms] > Task :snapkit:copyReleaseJniLibsProjectAndLocalJars [ +100 ms] > Task :path_provider:compileReleaseLibraryResources [ ] > Task :snapkit:mergeReleaseJavaResource [ +200 ms] > Task :app:mergeReleaseNativeLibs [ +98 ms] > Task :path_provider:verifyReleaseResources [ +700 ms] > Task :snapkit:mergeReleaseResources [ +297 ms] > Task :app:stripReleaseDebugSymbols [ ] Unable to strip the following libraries, packaging them as they are: libapp.so, libflutter.so, libpruneau.so. [ +499 ms] > Task :snapkit:generateReleaseRFile [ +400 ms] > Task :snapkit:verifyReleaseResources [ +703 ms] > Task :path_provider:compileReleaseJavaWithJavac [ ] > Task :path_provider:mergeReleaseGeneratedProguardFiles UP-TO-DATE [ ] > Task :path_provider:exportReleaseConsumerProguardFiles UP-TO-DATE [ +96 ms] > Task :path_provider:bundleLibCompileToJarRelease [ ] > Task :path_provider:bundleLibRuntimeToJarRelease [ +99 ms] > Task :path_provider:extractReleaseAnnotations [ +100 ms] > Task :path_provider:mergeReleaseConsumerProguardFiles [ +7 ms] > Task :path_provider:syncReleaseLibJars [ ] > Task :path_provider:bundleReleaseAar [ ] > Task :path_provider:compileReleaseSources [ ] > Task :path_provider:assembleRelease [ +693 ms] > Task :app:processReleaseResources [ +296 ms] > Task :snapkit:compileReleaseJavaWithJavac [ +102 ms] > Task :snapkit:mergeReleaseGeneratedProguardFiles UP-TO-DATE [ ] > Task :snapkit:exportReleaseConsumerProguardFiles UP-TO-DATE [ ] > Task :snapkit:bundleLibCompileToJarRelease [ ] > Task :snapkit:bundleLibRuntimeToJarRelease [ +98 ms] > Task :snapkit:extractReleaseAnnotations [ +400 ms] > Task :app:compileReleaseJavaWithJavac FAILED [ +4 ms] /Users/jnbra/Projects/snapkit/example/android/app/src/main/java/io/flutter/plugi ns/GeneratedPluginRegistrant.java:17: error: cannot access LoginStateController [ +20 ms] flutterEngine.getPlugins().add(new com.jacobbrasil.snapkit.SnapkitPlugin()); [ +1 ms] ^ [ ] class file for com.snapchat.kit.sdk.core.controller.LoginStateController not found [ ] 1 error [ ] FAILURE: Build failed with an exception. [ ] * What went wrong: [ ] Execution failed for task ':app:compileReleaseJavaWithJavac'. [ ] > Compilation failed; see the compiler error output for details. [ ] * 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 [ +72 ms] Deprecated Gradle features were used in this build, making it incompatible with Gradle 7.0. [ ] Use '--warning-mode all' to show the individual deprecation warnings. [ ] See https://docs.gradle.org/6.7/userguide/command_line_interface.html#sec:command_li ne_warnings [ ] 80 actionable tasks: 73 executed, 7 up-to-date [ ] BUILD FAILED in 47s [ +517 ms] Running Gradle task 'assembleRelease'... (completed in 49.4s) [ +21 ms] "flutter apk" took 50,655ms. [ +7 ms] Gradle task assembleRelease failed with exit code 1 [ +1 ms] #0 throwToolExit (package:flutter_tools/src/base/common.dart:10:3) flutter/flutter#1 AndroidGradleBuilder.buildGradleApp (package:flutter_tools/src/android/gradle.dart:464:9) flutter/flutter#2 AndroidGradleBuilder.buildApk (package:flutter_tools/src/android/gradle.dart:231:5) flutter/flutter#3 BuildApkCommand.runCommand (package:flutter_tools/src/commands/build_apk.dart:105:5) flutter/flutter#4 FlutterCommand.run. (package:flutter_tools/src/runner/flutter_command.dart:1043:27) flutter/flutter#5 AppContext.run. (package:flutter_tools/src/base/context.dart:150:19) flutter/flutter#6 CommandRunner.runCommand (package:args/command_runner.dart:196:13) flutter/flutter#7 FlutterCommandRunner.runCommand. (package:flutter_tools/src/runner/flutter_command_runner.dart:284:9) flutter/flutter#8 AppContext.run. (package:flutter_tools/src/base/context.dart:150:19) flutter/flutter#9 FlutterCommandRunner.runCommand (package:flutter_tools/src/runner/flutter_command_runner.dart:232:5) flutter/flutter#10 run.. (package:flutter_tools/runner.dart:62:9) flutter/flutter#11 AppContext.run. (package:flutter_tools/src/base/context.dart:150:19) flutter/flutter#12 main (package:flutter_tools/executable.dart:91:3) [ +261 ms] ensureAnalyticsSent: 256ms [ +2 ms] Running shutdown hooks [ ] Shutdown hooks complete [ ] exiting with code 1 ``` ``` jnbra@Jacobs-MacBook-Pro snapkit % flutter analyze Analyzing snapkit... No issues found! (ran in 4.1s) jnbra@Jacobs-MacBook-Pro snapkit % cd example jnbra@Jacobs-MacBook-Pro example % flutter analyze Analyzing example... No issues found! (ran in 2.4s) ``` ``` jnbra@Jacobs-MacBook-Pro snapkit % flutter doctor -v [✓] Flutter (Channel stable, 2.2.1, on macOS 11.5 20G5033c darwin-arm, locale en-CA) • Flutter version 2.2.1 at /Users/jnbra/Flutter • Framework revision 02c026b03c (4 weeks ago), 2021-05-27 12:24:44 -0700 • Engine revision 0fdb562ac8 • Dart version 2.13.1 [✓] Android toolchain - develop for Android devices (Android SDK version 30.0.3) • Android SDK at /Users/jnbra/Library/Android/sdk • Platform android-30, build-tools 30.0.3 • 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 at /Applications/Xcode.app/Contents/Developer • Xcode 12.5.1, Build version 12E507 • CocoaPods version 1.10.1 [✓] Chrome - develop for the web • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome [✓] Android Studio (version 4.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 1.8.0_242-release-1644-b3-6915495) [✓] VS Code (version 1.57.1) • VS Code at /Applications/Visual Studio Code.app/Contents • Flutter extension version 3.23.0 [✓] Connected device (3 available) • Pixel 2 XL (mobile) • adb-711KPUU0780246-E8J7Ms._adb-tls-connect._tcp. • android-arm64 • Android 11 (API 30) • macOS (desktop) • macos • darwin-arm64 • macOS 11.5 20G5033c darwin-arm • Chrome (web) • chrome • web-javascript • Google Chrome 91.0.4472.114 ! Error: Touchy Touchy is not connected. Xcode will continue when Touchy Touchy is connected. (code -13) • No issues found! ```
TahaTesser commented 3 years ago

Hi @TimmyRB Can you please provide a link to the SnapKit for Gradle and please provide clear steps to reproduce. Are you creating the flutter plugin and then adding SnapKit in the example's grade? Doing the same in a regular project has no issue? Please explain the issue in detail

TimmyRB commented 3 years ago

Yes I am developing a Flutter Plugin, this in my Gradle file that includes the SnapKit Android SDK, it is located in plugin/android not plugin/example/android

Unless Flutter changed something relating to this, this used to work without me having to also include the SDK in the example project, I've tried older versions of the SDK but am still experiencing the same problem

group 'com.jacobbrasil.snapkit'
version '1.0'

buildscript {
    repositories {
        google()
        jcenter()
    }

    dependencies {
        classpath 'com.android.tools.build:gradle:4.1.0'
    }
}

rootProject.allprojects {
    repositories {
        google()
        jcenter()
        maven {
            url "https://storage.googleapis.com/snap-kit-build/maven"
        }
    }
}

apply plugin: 'com.android.library'

android {
    compileSdkVersion 30

    defaultConfig {
        minSdkVersion 19
    }
}

dependencies {
    implementation([
            'com.snapchat.kit.sdk:creative:1.10.0',
            'com.snapchat.kit.sdk:login:1.10.0',
            'com.snapchat.kit.sdk:bitmoji:1.10.0',
            'com.snapchat.kit.sdk:core:1.10.0'
    ])
}
TahaTesser commented 3 years ago

HI @TimmyRB Following the steps, I tried to reproduce the issue

  1. Created new plugin flutter create --org com.example --template=plugin --platforms=android,ios -a kotlin hello
  2. Snapkit dependencies and repository link to plugin/android
  3. Bump min SDK to 19 in both plugin/android & plugin/example/android (based https://github.com/flutter/website/issues/7758)
  4. Run plugin/example/ with flutter run -v

The app runs with no issues on the latest Flutter stable

Complete sample project hello.zip

flutter doctor -v ```console [✓] Flutter (Channel stable, 2.2.2, on Linux, locale en_US.UTF-8) • Flutter version 2.2.2 at /home/taha/Code/flutter_stable • Framework revision d79295af24 (2 weeks ago), 2021-06-11 08:56:01 -0700 • Engine revision 91c9fc8fe0 • Dart version 2.13.3 [✓] Android toolchain - develop for Android devices (Android SDK version 30.0.3) • Android SDK at /home/taha/Code/SDK • Platform android-30, build-tools 30.0.3 • ANDROID_HOME = /home/taha/Code/SDK • Java binary at: /home/taha/Code/android-studio/jre/bin/java • Java version OpenJDK Runtime Environment (build 11.0.8+0-b944-P17168821) • All Android licenses accepted. [✓] Chrome - develop for the web • Chrome at google-chrome [✓] Linux toolchain - develop for Linux desktop • Ubuntu clang version 12.0.0-1ubuntu1 • cmake version 3.18.4 • ninja version 1.8.2 • pkg-config version 0.29.2 [✓] Android Studio (version 4.2) • Android Studio at /home/taha/Code/android-studio • Flutter plugin version 57.0.2 • Dart plugin version 202.8531 • Java version OpenJDK Runtime Environment (build 11.0.8+0-b944-P17168821) [✓] VS Code (version 1.57.1) • VS Code at /usr/share/code • Flutter extension version 3.23.0 [✓] Connected device (3 available) • sdk gphone x86 arm (mobile) • emulator-5554 • android-x86 • Android 11 (API 30) (emulator) • Linux (desktop) • linux • linux-x64 • Linux • Chrome (web) • chrome • web-javascript • Google Chrome 91.0.4472.114 • No issues found! ```
TimmyRB commented 3 years ago

The issue doesn't lie with just having the SDK included, it happens when using the LoginStateController class in the Plugin file which when CMD + Clicked on shows the decompiled class in Android Studio, however upon running the project, there is an error thrown that to class could not be found

TahaTesser commented 3 years ago

@TimmyRB After adding listener, I can reproduce the issur however adding dependencies in the example/android solves the issue. I have come across similar scenario,

Unless Flutter changed something relating to this, this used to work without me having to also include the SDK in the example project, I've tried older versions of the SDK but am still experiencing the same problem

I don't think it was ever working without adding to example in the older version, you also tried older version, did any previous has different behaviour? let me know the version, thanks

This is probably working as intended, there is no documentation for adding native dependencies in a plugin, at least I couldn't find. In fact there is no documentaton on how to work with platform class in a flutter plugin for iOS or Android so I am labelling ths for documentation and I might work on this documentation myself soon

atsansone commented 1 year ago

This is fixed on this page. Closing this issue.