I already tried it in JAVA and kotlin from multiple tutorials and examples like: https://github.com/fbsamples/account-kit-samples-for-android/tree/master/samples/AccountKitSimpleSample and I just can't get it to work!
This is the latest code how I try it:
fun startRequest(){
val intent = Intent(this, AccountKitActivity::class.java)
val builder = AccountKitConfiguration.AccountKitConfigurationBuilder(LoginType.PHONE, AccountKitActivity.ResponseType.TOKEN)
intent.putExtra(AccountKitActivity.ACCOUNT_KIT_ACTIVITY_CONFIGURATION, builder.build())
startActivityForResult(intent, ACCOUNTKIT_REQUEST_CODE)
Log.d("letsSee", "pikaboo1") // this is shown in the log
}
public override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) {
Log.d("letsSee", "pikaboo2") // this not
if (requestCode == ACCOUNTKIT_REQUEST_CODE){
val loginResult: AccountKitLoginResult = data!!.getParcelableExtra(AccountKitLoginResult.RESULT_KEY)
if(loginResult.getError() != null)
{
Log.d("letsSee", "error: " + loginResult.getError().toString())
}
else if(loginResult.wasCancelled())
{
Log.d("letsSee", "cancelled")
}
else
{
if(loginResult.getAccessToken() != null){
val accountid = loginResult.getAccessToken()!!.getAccountId()
Log.d("letsSee", "Success: " + accountid.toString())
}else{
Log.d("letsSee", "FAIL: " + loginResult.getAuthorizationCode()!!.substring(0,10))
}
}
}
}
This is the error log:
09-18 02:00:51.014 1102-1102/com.amoflirt.amoflirt E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.amoflirt.amoflirt, PID: 1102
java.lang.NoClassDefFoundError: Failed resolution of: Lcom/google/android/gms/common/api/Api$zzf;
at com.google.android.gms.auth.api.Auth.<clinit>(Unknown Source:0)
at com.facebook.accountkit.ui.AccountKitActivity.onCreate(AccountKitActivity.java:281)
at android.app.Activity.performCreate(Activity.java:7174)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1220)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2910)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3032)
at android.app.ActivityThread.-wrap11(Unknown Source:0)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1696)
at android.os.Handler.dispatchMessage(Handler.java:105)
at android.os.Looper.loop(Looper.java:164)
at android.app.ActivityThread.main(ActivityThread.java:6944)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:327)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1374)
Caused by: java.lang.ClassNotFoundException: Didn't find class "com.google.android.gms.common.api.Api$zzf" on path: DexPathList[[zip file "/data/app/com.amoflirt.amoflirt-wtMOEQEYlPaxtL74SS3EhA==/base.apk", zip file "/data/app/com.amoflirt.amoflirt-wtMOEQEYlPaxtL74SS3EhA==/split_lib_dependencies_apk.apk", zip file "/data/app/com.amoflirt.amoflirt-wtMOEQEYlPaxtL74SS3EhA==/split_lib_resources_apk.apk", zip file "/data/app/com.amoflirt.amoflirt-wtMOEQEYlPaxtL74SS3EhA==/split_lib_slice_0_apk.apk", zip file "/data/app/com.amoflirt.amoflirt-wtMOEQEYlPaxtL74SS3EhA==/split_lib_slice_1_apk.apk", zip file "/data/app/com.amoflirt.amoflirt-wtMOEQEYlPaxtL74SS3EhA==/split_lib_slice_2_apk.apk", zip file "/data/app/com.amoflirt.amoflirt-wtMOEQEYlPaxtL74SS3EhA==/split_lib_slice_3_apk.apk", zip file "/data/app/com.amoflirt.amoflirt-wtMOEQEYlPaxtL74SS3EhA==/split_lib_slice_4_apk.apk", zip file "/data/app/com.amoflirt.amoflirt-wtMOEQEYlPaxtL74SS3EhA==/split_lib_slice_5_apk.apk", zip file "/data/app/com.amoflirt.amoflirt-wtMOEQEYlPaxtL74SS3EhA==/split_lib_slice_6_apk.apk", zip file "/data/app/com.amoflirt.amoflirt-wtMOEQEYlPaxtL74SS3EhA==/split_lib_slice_7_apk.apk", zip file "/data/app/com.amoflirt.amoflirt-wtMOEQEYlPaxtL74SS3EhA==/split_lib_slice_8_apk.apk", zip file "/data/app/com.amoflirt.amoflirt-wtMOEQEYlPaxtL74SS3EhA==/split_lib_slice_9_apk.apk"],nativeLibraryDirectories=[/data/app/com.amoflirt.amoflirt-wtMOEQEYlPaxtL74SS3EhA==/lib/arm64, /system/lib64, /system/vendor/lib64]]
at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:93)
at java.lang.ClassLoader.loadClass(ClassLoader.java:379)
at java.lang.ClassLoader.loadClass(ClassLoader.java:312)
at com.google.android.gms.auth.api.Auth.<clinit>(Unknown Source:0)
at com.facebook.accountkit.ui.AccountKitActivity.onCreate(AccountKitActivity.java:281)
at android.app.Activity.performCreate(Activity.java:7174)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1220)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2910)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3032)
at android.app.ActivityThread.-wrap11(Unknown Source:0)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1696)
at android.os.Handler.dispatchMessage(Handler.java:105)
at android.os.Looper.loop(Looper.java:164)
at android.app.ActivityThread.main(ActivityThread.java:6944)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:327)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1374)
Suppressed: java.io.IOException: No original dex files found for dex location (arm64) /data/app/com.amoflirt.amoflirt-wtMOEQEYlPaxtL74SS3EhA==/split_lib_resources_apk.apk
at dalvik.system.DexFile.openDexFileNative(Native Method)
at dalvik.system.DexFile.openDexFile(DexFile.java:353)
at dalvik.system.DexFile.<init>(DexFile.java:100)
at dalvik.system.DexFile.<init>(DexFile.java:74)
at dalvik.system.DexPathList.loadDexFile(DexPathList.java:374)
at dalvik.system.DexPathList.makeDexElements(DexPathList.java:337)
at dalvik.system.DexPathList.<init>(DexPathList.java:157)
at dalvik.system.BaseDexClassLoader.<init>(BaseDexClassLoader.java:65)
at dalvik.system.PathClassLoader.<init>(PathClassLoader.java:64)
at com.android.internal.os.PathClassLoaderFactory.createClassLoader(PathClassLoaderFactory.java:43)
at android.app.ApplicationLoaders.getClassLoader(ApplicationLoaders.java:69)
at android.app.ApplicationLoaders.getClassLoader(ApplicationLoaders.java:36)
at android.app.LoadedApk.createOrUpdateClassLoaderLocked(LoadedApk.java:678)
at android.app.LoadedApk.getClassLoader(LoadedApk.java:711)
at android.app.LoadedApk.getResources(LoadedApk.java:944)
09-18 02:00:51.015 1102-1102/com.amoflirt.amoflirt E/AndroidRuntime: at android.app.ContextImpl.createAppContext(ContextImpl.java:2303)
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:5943)
at android.app.ActivityThread.-wrap1(Unknown Source:0)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1764)
... 6 more
I'm totally desperate with this awful garbage, already wasted 2 days on that
Halleluja I got it:
https://github.com/evollu/react-native-fcm/issues/998
added googlePlayServicesVersion=12.0.1 to gradle.properties (I guess it's unnecessary) added following to android/build.gradle:
allprojects {
repositories {
//start here
configurations.all {
resolutionStrategy.eachDependency { DependencyResolveDetails details ->
def requested = details.requested
if (requested.group == 'com.google.android.gms') {
details.useVersion '12.0.1'
}
if (requested.group == 'com.google.firebase') {
details.useVersion '12.0.1'
}
}
}
//end
jcenter()
maven {
url "https://maven.google.com"
}
}
}
This was the 1000000th fix which I tried and I was 99.999% sure it will not work but it did :D