我正在尝试集成 In App Review,但收到此编译错误:
Duplicate class com.google.android.play.core.common.IntentSenderForResultStarter found in modules jetified-core-1.9.1-runtime (com.google.android.play:core:1.9.1) and jetified-core-common-2.0.0-runtime (com.google.android.play:core-common:2.0.0)
Duplicate class com.google.android.play.core.common.LocalTestingException found in modules jetified-core-1.9.1-runtime (com.google.android.play:core:1.9.1) and jetified-core-common-2.0.0-runtime (com.google.android.play:core-common:2.0.0)
Duplicate class com.google.android.play.core.common.PlayCoreDialogWrapperActivity found in modules jetified-core-1.9.1-runtime (com.google.android.play:core:1.9.1) and jetified-core-common-2.0.0-runtime (com.google.android.play:core-common:2.0.0)
Duplicate class com.google.android.play.core.listener.StateUpdatedListener found in modules jetified-core-1.9.1-runtime (com.google.android.play:core:1.9.1) and jetified-core-common-2.0.0-runtime (com.google.android.play:core-common:2.0.0)
Duplicate class com.google.android.play.core.review.ReviewInfo found in modules jetified-core-1.9.1-runtime (com.google.android.play:core:1.9.1) and jetified-review-2.0.0-runtime (com.google.android.play:review:2.0.0)
Duplicate class com.google.android.play.core.review.ReviewManager found in modules jetified-core-1.9.1-runtime (com.google.android.play:core:1.9.1) and jetified-review-2.0.0-runtime (com.google.android.play:review:2.0.0)
Duplicate class com.google.android.play.core.review.ReviewManagerFactory found in modules jetified-core-1.9.1-runtime (com.google.android.play:core:1.9.1) and jetified-review-2.0.0-runtime …我已按照我的 mac book pro 中的https://docs.amplify.aws/lib/q/platform/android将 aws amplify 集成到 Android 应用程序中。
现在我将同一个项目签出到另一台机器 mac mini 中。并试图奔跑。
我收到此错误,不知道如何修复它。
AmplifyException {message=Failure performing sync query to AppSync: [GraphQLResponse.Error{message='You are not authorized to make this call.'
尝试过,放大拉取,放大配置,放大初始化。但没有人能够解决这个问题。
提前致谢
amazon-s3 amazon-web-services aws-amplify aws-amplify-sdk-android
我有一个使用 Amplify Auth 的 Android 应用程序。我可以使用访客访问和密钥,但不能使用会话令牌。使用临时凭证时, Postman 需要会话令牌。
根据Amplify 文档,我使用以下代码来获取密钥:
Amplify.Auth.fetchAuthSession(
    result -> {
        Log.i(TAG, "inside getGuestCredentials()...result....." + result.toString());
        AWSCognitoAuthSession cognitoAuthSession = (AWSCognitoAuthSession) result;
        Log.i(TAG, "Is user signed in: " + cognitoAuthSession.isSignedIn());
        switch (cognitoAuthSession.getIdentityId().getType()) {
            case SUCCESS:
                Log.i(TAG, "Guest IdentityId: " + cognitoAuthSession.getIdentityId().getValue());
                Log.i(TAG, "Guest access key: " + cognitoAuthSession.getAWSCredentials().getValue().getAWSAccessKeyId());
                Log.i(TAG, "Guest secret key: " + cognitoAuthSession.getAWSCredentials().getValue().getAWSSecretKey());
                String sessionToken = ((AWSSessionCredentials) mobileClient.getCredentials()).getSessionToken();
                Log.i(TAG, "Guest sessionToken: " + sessionToken);
                break;
            case FAILURE:
                Log.i(TAG, "failure Guest IdentityId not present …android postman amazon-cognito aws-amplify aws-amplify-sdk-android
预期结果 中 
模型的 Java 类schema.graphql已创建。
实际结果 我收到此消息:
错误:未配置 AppSync API。请添加API
我试过的
正如Amplify API 文档中所建议的,已尝试amplify codegen models从项目目录执行。
正如Amplify 入门指南中所建议的,我尝试modelgen从 Android Studio执行 Gradle任务。
项目信息
执行amplify status显示为项目配置了 AppSync API:   
    Current Environment: dev
    | Category | Resource name           | Operation | Provider plugin |
    | -------- | ----------------------- | --------- | --------------- |
    | Api      | THIS_IS_MY_RESOURCE NAME| Create    |                 |
    GraphQL endpoint: MY_GRAPHQL_ENDPOINT
amplifyconfiguration.json并且awsconfiguration.json在 …
android amazon-web-services aws-appsync aws-amplify aws-amplify-sdk-android
我一直在尝试使用 AWS Amplify 来生成 GraphQL API 和后端。我可以使用引导式架构创建来创建一个工作后端。我选择了 Todo 示例。我可以从 Android Studio 内置的应用程序中调用它。查询和突变工作正常。每当我使用 Android Studio 查看 amplify/backend/api/project/(其中 project 是项目名称)中的 schema.graphql 时,我都会收到有关尝试重新定义 Todo 和使用未声明指令 @model 的错误。我确定我遗漏了一些明显的东西。所以任何帮助将不胜感激。
Android Studio 3.6.3 / Gradle 5.6.4 / Gradle Plugin 3.6.3 / JS Graph QL 2.4.0 / Java Language / Amplify CLI 4.18.1 / npm 6.14.4 / node 12.16.2
尝试以这种方式使用这个 graphql 插件是错误的吗?
在 Android Studio 中创建一个带有空活动的项目。从项目根运行:
amplify init 
接受默认值。跑:
amplify add api
选择 GraphQL、引导模式并选择 Todo 示例。否则采用默认值。跑:
amplify push
amplify/backend/api/project 中的 graphql.schema 将包含 todo 模式
type Todo …android-studio graphql aws-amplify aws-amplify-cli aws-amplify-sdk-android
我正在使用 Android Amplify 库。我无法找出从Amplify.Auth.signIn()函数传回的错误类型。我没有在任何地方找到这方面的文档。现在我只是在猜测它会返回什么。我想要的是告诉用户如何从错误中恢复。用户名不存在,密码不正确,格式错误等。阅读源代码我给我的印象是 AmplifyException.recoveryMessage 是我想要的,但这仍然有问题,因为它不允许我自定义消息。
/**
 * Sign in the user to the back-end service and set the currentUser for this application
 * @param username User's username
 * @param password User's password
 */
override fun initiateSignin(username : String, password : String) {
    //Sign in the user to the AWS back-end
    Amplify.Auth.signIn(
        username,
        password,
        {result ->
            if (result.isSignInComplete) {
                Timber.tag(TAG).i("Sign in successful.")
                //Load the user if the sign in was successful
                loadUser()
            } else {
                Timber.tag(TAG).i("Sign in unsuccessful.") …amazon-web-services amazon-cognito aws-amplify aws-amplify-sdk-android
我的 Android 应用程序使用AWS Cognito 和 Amplify Auth SDK进行身份验证,我正在尝试为登录/注册流程编写 JUnit 测试用例。我正在使用 Mockito 框架来模拟这些类。
我从登录开始,我的登录模型是这样的
class LoginService(val auth: AuthCategory) {
 fun login(username: String, password: String): MutableLiveData<Login> {
    val liveData = MutableLiveData<Login>()
    auth.signIn(username, password,
        { result ->
            liveData.postValue(Login(result, null))
        },
        { error ->
            liveData.postValue(Login(null, error))
        }
    )
    return liveData
    }
  }
我的视图模型这样称呼它
class LoginViewModel : ViewModel() {
    val loginService = LoginService(Amplify.Auth)
    fun login(username: String, password: String): MutableLiveData<Login> {
        return loginService.login(username, password)
    }
}
我的测试用例看起来像这样
lateinit var auth: AuthCategory
lateinit var loginService: …android junit4 mockito amazon-cognito aws-amplify-sdk-android
目前,我工作的公司在多个 Android 应用程序中使用 AWS 库,AWS 库如下:
com.amazonaws:aws-android-sdk-s3
com.amazonaws:aws-android-sdk-mobile-client
com.amazonaws:aws-android-sdk-auth-userpools
com.amazonaws:aws-android-sdk-auth-core
当我尝试查找这些库的文档时,我只能找到 Xamarin 文档。Android 和 iOS 文档缺失,并且我看到不祥的警告“2021 年 10 月 30 日,AWS Amplify 将取代 AWS Mobile Hub”
目前尚不清楚“AWS Mobile Hub”是否仅包含在线 Mobile Hub 界面,或者是否包含我一直在使用的这些库。
我是否可以无限期地使用 AWS 开发工具包库,或者它们会在 2021 年 10 月 30 日停止运行吗?我找不到任何可以直接回答这个问题的东西。
android amazon-web-services aws-amplify aws-sdk-ios aws-amplify-sdk-android
我想开发一个简单的 Android 应用程序来将图像文件上传到 AWS 中已创建的 S3 存储桶。如果我用谷歌搜索,所有最新的 AWS 文档都会将我重定向到使用Amplify框架。我不明白此处描述的上传文件的文档。我不明白在哪里可以提供存储桶名称、IAM 凭证等。我也没有找到任何视频教程。如果在没有提供适当文档的情况下强制使用 Amplify,为什么 AWS 会这样做呢?
在这里他们提到使用 Amplify CLI 配置所有详细信息
amplify add storage
并要求使用推送更改
amplify push
但如果我们想以编程方式添加详细信息,例如存储桶名称、用户详细信息等,那么我们该怎么做呢?给我使用 Amplify 框架或适用于 Android 的旧 AWS SDK 的分步详细信息,以便在不使用 Cognito 的情况下上传文件
android amazon-s3 aws-amplify aws-amplify-cli aws-amplify-sdk-android
我目前正在尝试配置我使用 AWS Amplify 添加的 REST API。我已经配置了用户身份验证,用户可以按照身份验证文档中概述的步骤注册和登录。然后我使用api 步骤添加了一个 REST API 。
目前,我只是想从 DynamoDB 中检索项目列表。当我在 aws 控制台上测试 api 时它是成功的,但是,当我从我的 android api 进行调用时,它返回以下错误:
{"message":"Authorization header requires 'Credential' parameter. Authorization header requires 'Signature' parameter. Authorization header requires 'SignedHeaders' parameter. Authorization header requires existence of either a 'X-Amz-Date' or a 'Date' header. Authorization=[a long string of characters]
我知道放大会使用 AWS_IAM 自动将 API 设置为受限,我认为这就是返回上述消息的原因。我正在尝试使用我之前通过身份验证步骤设置的用户池对其进行身份验证。我的 android 应用程序中调用 API 的代码如下:
{"message":"Authorization header requires 'Credential' parameter. Authorization header requires 'Signature' parameter. Authorization header requires 'SignedHeaders' parameter. …android amazon-cognito aws-api-gateway aws-amplify aws-amplify-sdk-android
aws-amplify ×8
android ×7
amazon-s3 ×2
aws-appsync ×1
aws-sdk-ios ×1
gradle ×1
graphql ×1
junit4 ×1
mockito ×1
postman ×1