Flutter Plugin project :sign_in_apple not found. Please update settings.gradle - ios

Facing this issue when building the flutter project in Android 31.
ERROR:
Plugin project :sign_in_apple not found. Please update settings.gradle.
FAILURE: Build failed with an exception.
* Where:
Script '/Users/myusername/fluttersdk/flutter/packages/flutter_tools/gradle/flutter.gradle' line: 421
* What went wrong:
A problem occurred evaluating root project 'android'.
> A problem occurred configuring project ':app'.
> Cannot invoke method afterEvaluate() on null object

You can just replace this code into the
android>>settings.gradle
include ':app'
def flutterProjectRoot = rootProject.projectDir.parentFile.toPath()
def plugins = new Properties()
def pluginsFile = new File(flutterProjectRoot.toFile(), '.flutter-plugins')
if (pluginsFile.exists()) {
pluginsFile.withReader('UTF-8') { reader -> plugins.load(reader) }
}
plugins.each { name, path ->
def pluginDirectory = flutterProjectRoot.resolve(path).resolve('android').toFile()
include ":$name"
project(":$name").projectDir = pluginDirectory
}

Check out the steps for adding Apple SignIn to android.
https://pub.dev/packages/sign_in_with_apple

Have run into a similar issue and although the suggestion above works (manually changing the gradle rule to look for the .flutter-plugins file) this should be handled by the default android/settings.gradle file.
The root cause for me turned out to be that the plugin's pubspec.yaml didn't have a
flutter:
plugin:
platforms:
android: # <-- was missing
...
entry. This in return caused it not to show up in android plugins of the .flutter-plugins-dependencies file, which in turn made the flutter gradle rules not pick up the dependency
(The .flutter-plugins file is deprecated in favor of .flutter-plugins-dependencies).

Related

Error adding CocoaPods dependency in Kotlin Multiplatform

I'm trying to setup a KMM module with Couchbase Lite as a platform dependency for both Android and iOS. I'm running into errors getting this to work with CocoaPods for iOS:
Exception in thread "main" java.lang.Error: /var/folders/pv/3_5xn0dd0v5bf6sxbfcsq_wr0000gn/T/7009311365357251921.m:1:22: error: expected ';' after module name
at org.jetbrains.kotlin.native.interop.indexer.UtilsKt.ensureNoCompileErrors(Utils.kt:152)
at org.jetbrains.kotlin.native.interop.indexer.ModuleSupportKt.getModulesASTFiles(ModuleSupport.kt:68)
at org.jetbrains.kotlin.native.interop.indexer.ModuleSupportKt.getModulesInfo(ModuleSupport.kt:14)
at org.jetbrains.kotlin.native.interop.gen.jvm.MainKt.buildNativeLibrary(main.kt:507)
at org.jetbrains.kotlin.native.interop.gen.jvm.MainKt.processCLib(main.kt:265)
at org.jetbrains.kotlin.native.interop.gen.jvm.MainKt.interop(main.kt:73)
at org.jetbrains.kotlin.cli.utilities.InteropCompilerKt.invokeInterop(InteropCompiler.kt:45)
at org.jetbrains.kotlin.cli.utilities.MainKt.mainImpl(main.kt:19)
at org.jetbrains.kotlin.cli.utilities.MainKt.main(main.kt:41)
The generated 7009311365357251921.m file is not present at that path afterwards, which makes this difficult to debug.
build.gradle.kts:
plugins {
kotlin("multiplatform") version "1.4.21"
kotlin("native.cocoapods") version "1.4.21"
id("com.android.library")
}
...
kotlin {
android()
ios()
cocoapods {
summary = "TBD"
homepage = "TBD"
ios.deploymentTarget = "9.0"
pod("CouchbaseLite-Enterprise") {
version = "~> 2.8.1"
}
}
...
}
...
I get a different error if I use the non-enterprise release. Same build.gradle.kts except with pod("CouchbaseLite"). I get the error:
Exception in thread "main" java.lang.IllegalArgumentException: 'CBLQueryMeta' is going to be declared twice
at org.jetbrains.kotlin.native.interop.gen.KotlinFile.<init>(KotlinCodeModel.kt:257)
at org.jetbrains.kotlin.native.interop.gen.StubIrBridgeBuilder$kotlinFile$1.<init>(StubIrBridgeBuilder.kt:44)
at org.jetbrains.kotlin.native.interop.gen.StubIrBridgeBuilder.<init>(StubIrBridgeBuilder.kt:46)
at org.jetbrains.kotlin.native.interop.gen.StubIrDriver.run(StubIrDriver.kt:122)
at org.jetbrains.kotlin.native.interop.gen.jvm.MainKt.processCLib(main.kt:315)
at org.jetbrains.kotlin.native.interop.gen.jvm.MainKt.interop(main.kt:73)
at org.jetbrains.kotlin.cli.utilities.InteropCompilerKt.invokeInterop(InteropCompiler.kt:45)
at org.jetbrains.kotlin.cli.utilities.MainKt.mainImpl(main.kt:19)
at org.jetbrains.kotlin.cli.utilities.MainKt.main(main.kt:41)
Both these pod specs compile without problem in an Xcode project. But Kotlin native seems to run into issues with them.
Update:
The pod("CouchbaseLite") error seems to be caused by having both a CBLQueryMeta and CBLQuery interface defined. There's a YouTrack issue for this. This error will likely still be a problem with CouchbaseLite-Enterprise, if the original error could be resolved.
Update 2:
If I remove the { version = "~> 2.8.1" } or put it in the function call directly pod("CouchbaseLite-Enterprise", "~> 2.8.1") I get a different error:
Exception in thread "main" java.lang.Error: /var/folders/pv/3_5xn0dd0v5bf6sxbfcsq_wr0000gn/T/6649487835163649080.m:1:9: fatal error: module 'CouchbaseLite_Enterprise' not found
at org.jetbrains.kotlin.native.interop.indexer.UtilsKt.ensureNoCompileErrors(Utils.kt:152)
at org.jetbrains.kotlin.native.interop.indexer.ModuleSupportKt.getModulesASTFiles(ModuleSupport.kt:68)
at org.jetbrains.kotlin.native.interop.indexer.ModuleSupportKt.getModulesInfo(ModuleSupport.kt:14)
at org.jetbrains.kotlin.native.interop.gen.jvm.MainKt.buildNativeLibrary(main.kt:507)
at org.jetbrains.kotlin.native.interop.gen.jvm.MainKt.processCLib(main.kt:265)
at org.jetbrains.kotlin.native.interop.gen.jvm.MainKt.interop(main.kt:73)
at org.jetbrains.kotlin.cli.utilities.InteropCompilerKt.invokeInterop(InteropCompiler.kt:45)
at org.jetbrains.kotlin.cli.utilities.MainKt.mainImpl(main.kt:19)
at org.jetbrains.kotlin.cli.utilities.MainKt.main(main.kt:41)
Update 3:
I filed a YouTrack issue for this. It seems this might have something to do with the dash - in the CocoaPod library name. There was an issue that's been closed that had a fix for this by changing the module name to replace the dash - with an underscore _, but the fix doesn't seem to be working.
Depending on which version of the toolchain you're using, seems as if you're using the wrong syntax to specify the version. Try pod("CouchbaseLite-Enterprise", "~> 2.8.1") instead.

Error Running Gradle on Flutter with Visual Studio Code

i'm using windows 10 Visual Studio Code and i'm trying to run my code after writing them and this is what it shows me afterwards.
Launching lib\main.dart on TECNO Camon CX in debug mode...
* Error running Gradle:
ProcessException: Process "C:\Users\IB\Desktop\Android\myapp\berry_networks\Dart test\Flutter App\first_flutter_app\android\gradlew.bat" exited abnormally:
FAILURE: Build failed with an exception.
Where:
Build file 'C:\Users\IB\Desktop\Android\myapp\berry_networks\Dart test\Flutter App\first_flutter_app\android\app\build.gradle' line: 24
What went wrong:
A problem occurred evaluating project ':app'.
Failed to apply plugin [id 'com.android.application']
Illegal char <<> at index 9: C:/users//.android\analytics.settings
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 7s
Command: C:\Users\IB\Desktop\Android\myapp\berry_networks\Dart test\Flutter App\first_flutter_app\android\gradlew.bat app:properties
Please review your Gradle project setup in the android/ folder.
Exited (sigterm)
how do i fix this?
#iRuth
This is my app/build.gradle on Visual Studio Code
def localProperties = new Properties()
def localPropertiesFile = rootProject.file('local.properties')
if (localPropertiesFile.exists()) {
localPropertiesFile.withReader('UTF-8') { reader ->
localProperties.load(reader)
}
}
def flutterRoot = localProperties.getProperty('flutter.sdk')
if (flutterRoot == null) {
throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.")
}
def flutterVersionCode = localProperties.getProperty('flutter.versionCode')
if (flutterVersionCode == null) {
flutterVersionCode = '1'
}
def flutterVersionName = localProperties.getProperty('flutter.versionName')
if (flutterVersionName == null) {
flutterVersionName = '1.0'
}
apply plugin: 'com.android.application' (This is line 24)
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
android {
compileSdkVersion 28
lintOptions {
disable 'InvalidPackage'
}
defaultConfig {
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
applicationId "com.example.kkkkkkkk"
minSdkVersion 16
targetSdkVersion 28
versionCode flutterVersionCode.toInteger()
versionName flutterVersionName
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
// TODO: Add your own signing config for the release build.
// Signing with the debug keys for now, so `flutter run --release` works.
signingConfig signingConfigs.debug
}
}
}
flutter {
source '../..'
}
dependencies {
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
}
After many researches on how to fix my debugging issue with visual studio code proves abortive then i tried switching to android studio and downgrading my windows 10 to 8, but still that didn't solve it, it worsen the case.
I tried to have deep sleep and do nothing about it just to have some days off, i watch movies and making little researches.
eventually after boxing my head and loosing the tightened knot, i upgrade my system back to windows 10 and install everything one after the other:
Step 1: i install ADB
Step 2: i install Android Studio code
Step 3: i install Dart and Flutter
Step 4: i install SDK for android studio and set the environmental variables
Step 5: i install SDK platform tools and as well as setting the path in environmental variables.
Step 6: i install JDK for android studio and set the environmental variables as well
It wasn't easy for me as a beginner because i spent almost 2 month fixing this and i eventually find the answer through self taught and self motivation.
I want to thank everyone that contributed to the cause which i laid down here.
#IRuth i really appreciate your effort...
to fix all of gradle errors on vscode you need to update your gradle to last version for this first go to
android > app > src > main > click on java folder and then click on plugins then debug the plugins with F5
or install this extension https://marketplace.visualstudio.com/items?itemName=redhat.java
so after this vscode ask you to update plugins click on update and wait till it end to update your gradle project and java project so after this
flutter clean
and debuge your project it will install your build again with last version
hope this helpfull.

Flutter Picking Wrong Keystore path and giving error key.jks not found

I followed all the steps on the Flutter official site and thought I'd done everything correctly but it is failing to locate the keystore file when I build it.
This is the error message I get showing it taking wrong path instead of
D:\flutterapps\testapp\key.jks:
PS D:\flutterapps\testapp> flutter build apk
Initializing gradle... 1.3s
Resolving dependencies... 4.3s
Gradle task 'assembleRelease'...
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:validateSigningRelease'.
> Keystore file 'D:\flutterapps\testapp\android\app\ D: lutterappspublishkey.jks' not found for signing config 'release'.
* 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 4s
Gradle task 'assembleRelease'... Done 5.3s
Gradle task assembleRelease failed with exit code 1
PS D:\flutterapps\testapp>
On Windows you have to use 2 backslashes to indicate the path separation.
In your key.properties, you should have something like this:
storeFile=D:\\flutterapps\\testapp\\key.jks
You don't need to copy your key.jks file to your flutter project.
modified key.properties file with
storePassword=123456
keyPassword=123456
keyAlias=key
storeFile=key.jks
instead of this
storePassword=123456
keyPassword=123456
keyAlias=key
storeFile=D:\flutterapps\testapp\key.jks
and also moved key.jks to
D:\flutterapps\testapp\android\app\key.jks
as this path shown in error inside terminal
Thanks all.
it's wherever call it from in your build.gradle. insert this:
signingConfigs {
release {
keyAlias keystoreProperties['keyAlias']
keyPassword keystoreProperties['keyPassword']
storeFile file(keystoreProperties['storeFile'])
storePassword keystoreProperties['storePassword']
}
}
and call this in above your android{}:
def keystorePropertiesFile = rootProject.file("key.properties")
def keystoreProperties = new Properties()
keystoreProperties.load(new FileInputStream(keystorePropertiesFile))
and that key.properties file (which should be in your root android folder) should have this:
storePassword=12345
keyPassword=12345
keyAlias=key
storeFile=/Users/me/somekey.jks
Yeah, for me... I forgot to change my signingConfig to singingConfigs.release in my build.gradle file.
buildTypes {
release {
//CHANGE THIS TO RELEASE
signingConfig signingConfigs.debug
}
}
In build.gradle
Replace
def keystorePropertiesFile = rootProject.file('key.properties')
to
def keystorePropertiesFile = rootProject.file('app/key.properties')
I was having the same issue, I ended up having quotes around my path.
In key.properties, change
storeFile="D:\\mypath\\tokeystore\\key.jks"
to
storeFile=D:\\mypath\\tokeystore\\key.jks

error while reading extension file 'intellij_info_bundled.bzl'

we are trying to create a Scala project which uses Spark also but we are facing issue Encountered error while reading extension file 'intellij_info_bundled.bzl': no such package '#intellij_aspect//': No WORKSPACE file found in C:/users//_bazel_user/i45wuf6d/external/intellij_aspect. Is it has something missing in Intellij?
Scala file
package src.main.scala
object HelloWorld extends App {
def main(args: Array[String]) {
println("Hello, world!")
}
}
Build file
package(default_visibility = ["//visibility:public"])
load("#io_bazel_rules_scala//scala:scala.bzl", "scala_library", "scala_test")
scala_library(
name = "hello-world",
srcs = glob(["src/main/scala/*.scala"]),
)
scala_test(
name = "Hello_test",
srcs = glob(["src/main/scala/*.scala"]),
size = "small", # Expect this test to run quickly
)
Work Space
workspace(name = "scala_example")
rules_scala_version="7522c866450cf7810eda443e91ff44d2a2286ba1" # update this as needed
http_archive(
name = "io_bazel_rules_scala",
url = "https://github.com/bazelbuild/rules_scala/archive/%s.zip"%rules_scala_version,
type = "zip",
strip_prefix= "rules_scala-%s" % rules_scala_version
)
load("#io_bazel_rules_scala//scala:scala.bzl", "scala_repositories")
scala_repositories()`enter code here`
# register default scala toolchain
load("#io_bazel_rules_scala//scala:toolchains.bzl", "scala_register_toolchains")
scala_register_toolchains()
Command and Error from console
Command: C:\ProgramData\chocolatey\bin\bazel.exe build --tool_tag=ijwb:IDEA:community --keep_going --curses=no --color=yes --experimental_ui=no --progress_in_terminal_title=no --aspects=#intellij_aspect//:intellij_info_bundled.bzl%intellij_info_aspect --override_repository=intellij_aspect=C:\Users\ADMIN.IdeaIC2017.3\config\plugins\ijwb\aspect --output_groups=intellij-compile-java,intellij-compile-py -- //...:all
INFO: Loading complete. Analyzing...
ERROR: Encountered error while reading extension file 'intellij_info_bundled.bzl': no such package '#intellij_aspect//': No WORKSPACE file found in C:/users/admin/appdata/local/temp/_bazel_sandhya/criyrv6d/external/intellij_aspect.
INFO: Found 3 targets...
WARNING: failed to create one or more convenience symlinks for prefix 'bazel-':
cannot create symbolic link bazel-out -> C:/users/admin/appdata/local/temp/_bazel_sandhya/criyrv6d/execroot/scala_example/bazel-out: Cannot create junction (name=C:\users\admin\scalaprojects\example1\bazel-out, target=C:\users\admin\appdata\local\temp_bazel_sandhya\criyrv6d\execroot\scala_example\bazel-out): ERROR: src/main/native/windows/file-jni.cc(86): nativeCreateJunction(C:\users\admin\scalaprojects\example1\bazel-out, C:\users\admin\appdata\local\temp_bazel_sandhya\criyrv6d\execroot\scala_example\bazel-out): ERROR: src/main/native/windows/file.cc(128): CreateJunction(\?\C:\users\admin\scalaprojects\example1\bazel-out): Cannot create a file when that file already exists.
cannot create symbolic link bazel-out -> C:/users/admin/appdata/local/temp/_bazel_sandhya/criyrv6d/execroot/scala_example/bazel-out: Cannot create junction (name=C:\users\admin\scalaprojects\example1\bazel-out, target=C:\users\admin\appdata\local\temp_bazel_sandhya\criyrv6d\execroot\scala_example\bazel-out): ERROR: src/main/native/windows/file-jni.cc(86): nativeCreateJunction(C:\users\admin\scalaprojects\example1\bazel-out, C:\users\admin\appdata\local\temp_bazel_sandhya\criyrv6d\execroot\scala_example\bazel-out): ERROR: src/main/native/windows/file.cc(128): CreateJunction(\?\C:\users\admin\scalaprojects\example1\bazel-out): Cannot create a file when that file already exists.
.
INFO: Building...
ERROR: command succeeded, but not all targets were analyzed.
INFO: Elapsed time: 18.108s, Critical Path: 0.05s
Make failed
This is a sample Helloworld program only
In general, like #Ittai, I would suggest you open an issue in the intellij plugin github repo.
Unfortunately, your version of the plugin is no longer supported. I, too, previously ran into an issue with an older version of the plugin and was recommended to upgrade to the latest version. Which resolved the specific issue I was facing.
When reporting the issue make sure to include the following bits of information:
intellij build number
plugin version number
rules_scala version
operating system (it seems your using Windows, while most users use unix based systems)
bazel release number
how you have opened the intellij project (BUILD file, WORKSPACE, .blazeproject)
Additionally, to verify this is in fact an issue with the plugin, I would also suggest you try to reproduce this issue on a Unix based system. It seems you are using Intellij
compile on Windows. This may be Windows specific issue with aspects not being recognized.
When attempting to reproduce, make sure to clone your repository in a separate directory, close the intellij project, and reopen the project

Grails 3 scaffolding issue

I'm trying to port my project from Grails 2.4 to 3.0. Nothing fancy: 12 Domains, 13 Controllers and a service.
Everything works fine, except when I try to include the Scaffolding plugin. I literally follow the manual here, but the syntax must be wrong. Adding the plugin line as specified:
plugins {
…
compile ":scaffolding:2.0.0"
…
}
leads to this:
BUILD FAILED
Total time: 1.559 secs
| Error Error initializing classpath: startup failed:
build file 'E:\GrailsIdeaProjects\HcaServer\build.gradle': 17: only id(String) method calls allowed in plugins {} script block
See http://gradle.org/docs/2.3/userguide/plugins.html#sec:plugins_block for information on the plugins {} block
# line 17, column 5.
compile ":scaffolding:2.0.0"
^
1 error
(Use --stacktrace to see the full trace)
Somebody knows the right syntax to include the Scaffolding plugin in Grails 3?
EDIT: Thanks to Casey for pointing me in the right direction: Scaffolding plugin is actually already included in default build.gradle. Anyway, i still get a webpage like this on every controller:
Error: Page Not Found (404)
Path: /*controllerName*/index
I've been using the same syntax as per the manual, declaring a static scaffold = true on each controller. Why do I get a 404 page then? I do have index.gsp, error.gsp and notFound.gsp in my views folder.
It looks like that documentation hasn't been updated for Grails 3.0 yet. Your build.gradle file should have a dependencies block, where you can specify the dependency:
dependencies {
// ...
runtime "org.grails.plugins:scaffolding"
}
You can also see this by creating a new app using Grails 3.0 and checking out the default build.gradle file.
After researching for a while, turns out dynamic scaffolding hasn't made it yet into Grails 3:
https://groups.google.com/forum/m/#!topic/grails-dev-discuss/6R2YaF96Uts
Try this, It works for me.
dependencies {
compile "org.grails.plugins:scaffolding"
}
I am using grails 3.09.

Resources