0
我正在用AWS Cognito和Polly構建Android應用程序。該應用一直運行良好,直到今天它開始在auth.SignerFactory.createSigner
函數中加入IllegalArgumentException
。Android SDK SignerFactory拋出異常
我有以下代碼:
mCredentialsProvider = new CognitoCachingCredentialsProvider(
appContext,
COGNITO_POOL_ID,
Regions.US_EAST_1);
Map<String, String> logins = new HashMap<>();
logins.put("graph.facebook.com", AccessToken.getCurrentAccessToken().getToken());
mCredentialsProvider.setLogins(logins);
//setup amazon polly
mPollyClient = new AmazonPollyPresigningClient(mCredentialsProvider);
而引發的異常:
Caused by: java.lang.IllegalArgumentException
at com.amazonaws.auth.SignerFactory.createSigner(SignerFactory.java:115)
at com.amazonaws.auth.SignerFactory.lookupAndCreateSigner(SignerFactory.java:104)
at com.amazonaws.auth.SignerFactory.getSigner(SignerFactory.java:79)
at com.amazonaws.AmazonWebServiceClient.computeSignerByServiceRegion(AmazonWebServiceClient.java:379)
at com.amazonaws.AmazonWebServiceClient.computeSignerByURI(AmazonWebServiceClient.java:351)
at com.amazonaws.AmazonWebServiceClient.setEndpoint(AmazonWebServiceClient.java:215)
at com.amazonaws.services.polly.AmazonPollyClient.init(AmazonPollyClient.java:281)
at com.amazonaws.services.polly.AmazonPollyClient.<init>(AmazonPollyClient.java:261)
at com.amazonaws.services.polly.AmazonPollyPresigningClient.<init>(AmazonPollyPresigningClient.java:128)
at com.amazonaws.services.polly.AmazonPollyPresigningClient.<init>(AmazonPollyPresigningClient.java:107)
at com.amazonaws.services.polly.AmazonPollyPresigningClient.<init>(AmazonPollyPresigningClient.java:76)
at com.example.mymirrorlinkapplication.MainActivity.initializeLex(MainActivity.java:552)
at com.example.mymirrorlinkapplication.MainActivity.checkFacebookLogin(MainActivity.java:298)
at com.example.mymirrorlinkapplication.MainActivity.checkPermissions(MainActivity.java:289)
我試圖改變從CognitoCachingCredentialsProvider
到CognitoCredentialsProvider
,但結果是一樣的。造成這個問題的原因是什麼?