按照集成向导,在android项目的 build.gradle 中加入: implementation ‘cn.authing:guard:+’
然后在 MainActivity.kt 中加入
Authing.init(applicationContext, “XXXXXXXXXXXXX”)
在 SecondActivity.kt中加入
AuthFlow.start(this)
启动debug报错:
java.lang.ClassNotFoundException: Didn’t find class “com.google.gson.reflect.TypeToken” on path: DexPathList[[zip file “/system/framework/android.test.mock.jar”, zip file “/system/framework/android.test.runner.jar”, zip file “/data/app/com.ml.projects.example-PNyRli4afLqzryhr7RXlog==/base.apk”],nativeLibraryDirectories=[/data/app/com.ml.projects.example-PNyRli4afLqzryhr7RXlog==/lib/x86, /data/app/com.ml.projects.example-PNyRli4afLqzryhr7RXlog==/base.apk!/lib/x86, /system/lib]]
at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:134)
at java.lang.ClassLoader.loadClass(ClassLoader.java:379)
at java.lang.ClassLoader.loadClass(ClassLoader.java:312)
Android Studio 版本:2021.1.1 Patch 3
classpath ‘com.android.tools.build:gradle:7.1.0’
compileSdk 30
proguard-rules:
-keep class com.github.aachartmodel.aainfographics.** { ; }
-keep class com.google.gson.* { *; }