flutter_apple_sign_in icon indicating copy to clipboard operation
flutter_apple_sign_in copied to clipboard

Unable to build on Android after including Apple Sign In

Open OliverNarramore opened this issue 5 years ago • 22 comments

Using Flutter version 1.12.13+hotfix.5, I get this when trying to build the app on android:

A problem occurred configuring root project 'apple_sign_in'. > SDK location not found. Define location with sdk.dir in the local.properties file or with an ANDROID_HOME environment variable.

OliverNarramore avatar Jan 16 '20 10:01 OliverNarramore

  • What went wrong: A problem occurred configuring root project 'apple_sign_in'.

SDK location not found. Define location with sdk.dir in the local.properties file or with an ANDROID_HOME environment variable. Any help regarding this???

VikashIOS avatar Jan 22 '20 07:01 VikashIOS

The only solution i've found is to comment out the plugin and any references to it when building on android and then reinstate these when building on iOS. Not an ideal solution, but it works.

OliverNarramore avatar Jan 22 '20 08:01 OliverNarramore

I had the same error but it turned out to be a problem from an earlier step in the build - I had a wrong splash image filename in styles.xml.

metadoggo avatar Mar 12 '20 09:03 metadoggo

Same thing here. It used to work fine. Any breaking change recently introduced?

Viacheslav-Romanov avatar Apr 08 '20 16:04 Viacheslav-Romanov

I can't reproduce this. I created a new Flutter project, added the plugin, and it builds fine in release and debug. Need more info, logs or ideally an example project.

tomgilder avatar Apr 10 '20 16:04 tomgilder

I have the same issue when trying to build an APK, Appbunle builds fine. flutter doctor output:

[√] Flutter (Channel stable, v1.12.13+hotfix.9, on Microsoft Windows [Version 10.0.18363.778], locale en-ZA) • Flutter version 1.12.13+hotfix.9 at D:\Android\flutter • Framework revision f139b11009 (5 weeks ago), 2020-03-30 13:57:30 -0700 • Engine revision af51afceb8 • Dart version 2.7.2

[√] Android toolchain - develop for Android devices (Android SDK version 29.0.3) • Android SDK at D:\Android\sdk • Android NDK location not configured (optional; useful for native profiling support) • Platform android-29, build-tools 29.0.3 • Java binary at: C:\Program Files\Android\Android Studio\jre\bin\java • Java version OpenJDK Runtime Environment (build 1.8.0_212-release-1586-b04) • All Android licenses accepted.

[√] Android Studio (version 3.6) • Android Studio at C:\Program Files\Android\Android Studio • Flutter plugin version 45.1.1 • Dart plugin version 192.7761 • Java version OpenJDK Runtime Environment (build 1.8.0_212-release-1586-b04)

[√] VS Code (version 1.43.2) • VS Code at C:\Users\kikst\AppData\Local\Programs\Microsoft VS Code • Flutter extension version 3.9.1

[√] Connected device (1 available) • ONEPLUS A6003 • 7f30ffc • android-arm64 • Android 10 (API 29)

• No issues found!

KieranSteyn avatar May 06 '20 21:05 KieranSteyn

try flutter clean

fangmd avatar Jun 04 '20 07:06 fangmd

For me this happened when I adding the following to the android manifest.

<meta-data android:name="com.google.firebase.messaging.default_notification_channel_id" android:value="@string/default_notification_channel_id" />

I needed to add the following to the strings.xml file to resolve it.

<string name="default_notification_channel_id" translatable="false">fcm_default_channel</string>

robisaks avatar Jun 14 '20 15:06 robisaks

Try upgrading Gradle, that fixed it for me.

boyuanx avatar Jun 27 '20 21:06 boyuanx

still the problem is not solved

umairali4433 avatar Sep 21 '20 12:09 umairali4433

not solved, still

bartekpacia avatar Oct 08 '20 19:10 bartekpacia

I am having the same issue with this plug-in

taracell avatar Oct 12 '20 21:10 taracell

Same Issue. Using: Flutter Channel master, 1.23.0-19.0.pre.95 compileSdkVersion 29, distributionUrl=https://services.gradle.org/distributions/gradle-6.5-all.zip and 'com.android.tools.build:gradle:4.1.0'

offline-first avatar Oct 18 '20 15:10 offline-first

Still not resolved.

chenasraf avatar Oct 20 '20 17:10 chenasraf

I migrated to package:sign_in_with_apple, it's actively maintained and doesn't cause bizarre issues like this one.

bartekpacia avatar Oct 20 '20 19:10 bartekpacia

Hello, I migrated to https://pub.dev/packages/firebase_auth_oauth, it solved my issues with apple sign in as well as letting Android being able to sign in with apple ID. I followed https://fireship.io/lessons/apple-signin-with-firebase-tutorial/ to set up the separate services ID required to get it to work. I also set up firebase hosting to get it to work as well.

taracell avatar Oct 26 '20 20:10 taracell

I resolved this problem by update compileSdkVersion to 29, and targetSdkVersion to 30.😁

wenboLee avatar Nov 16 '20 07:11 wenboLee

I still have this problem. Did anyone solve this issue?

isrugeek avatar Dec 02 '20 17:12 isrugeek

If you are using Firebase I found the easiest package to use for Apple Sign in is: firebase_auth_oauth: ^0.2.2 ...This package allows for Apple ID to be used on Android systems as well.
Tips: Don't forget to set up a separate Service ID within your developer account Certificates, Identifiers & Profiles if using this package and include

    implementation 'androidx.browser:browser:1.2.0'

in your app build gradle, for Android and in your main -> AndroidManifest.xml

    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
    <uses-permission android:name="android.permission.INTERNET"/>

taracell avatar Dec 02 '20 19:12 taracell

For my case , similar to @robisaks , I had a wrong color code which is <color name="ta">#f2fcec1</color>, in the colors.xml and It triggered this error. But I wonder why it connects to Apple sign in ? Below is my full colors.xml file with the wrong color code.

<?xml version="1.0" encoding="utf-8"?>
<resources>
    <color name="black">#000000</color>
    <color name="ta">#f2fcec1</color>
</resources>

huxaiphaer avatar Dec 12 '20 23:12 huxaiphaer

I upgraded android/build.gradle to classpath 'com.android.tools.build:gradle:3.3.0' from

classpath 'com.android.tools.build:gradle:3.2.1' and it resolved the issue for me

dcoleyoung avatar Dec 31 '20 22:12 dcoleyoung

I still have this problem. Did anyone solve this issue?

zeevgrim avatar Feb 16 '21 20:02 zeevgrim