Do you want to request a feature or report a bug?
Bug report
What is the current behavior?
After adding aws-amplify to the project and linking both aws-amplify-react-native and amazon-cognito-identity-js, Android build fails with the following error:
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:transformClassesWithDexForDebug'.
> com.android.build.api.transform.TransformException: com.android.ide.common.process.ProcessException: java.util.concurrent.ExecutionException: com.android.dex.DexIndexOverflowException: Cannot merge new index 67250 into a non-jumbo instruction!
Reverting back to a commit without amplify allows me to build again. Comparison of the two branches confirm that only aws-amplify resources were added to the android project and are causing the build errors.
If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem. Your bug will get fixed much faster if we can run your code and it doesn't have dependencies other than AWS Amplify.
What is the expected behavior?
It is expected that the build would succeed.
Which versions of Amplify, and which browser / OS are affected by this issue? Did this work in previous versions?
Environment:
OS: macOS High Sierra 10.13.3
Node: 8.10.0
Yarn: 1.5.1
npm: 5.6.0
Watchman: 4.9.0
Xcode: Xcode 9.3 Build version 9E145
Android Studio: 3.0 AI-171.4443003
Packages: (wanted => installed)
react: 16.3.0-alpha.1 => 16.3.0-alpha.1
react-native: 0.54.2 => 0.54.2
"aws-amplify": "0.2.14",
"aws-amplify-react-native": "0.2.7",
"aws-appsync": "^1.0.3",
"aws-appsync-react": "^1.0.2",
"aws-sdk": "^2.173.0",
@jdeanwaite there is no need to link aws-amplify-react-native unless you want to enable pinpoint push notification in your app. And if you linked this module, you will have to do some extra configuration to make it work.
Just for help:
Adding aws-amplify on Expo26 causes: Couldn't find preset "es2015" ..... from amazon-cognito.identity-js
it seems that Expo forget to add babel-preset-es2015 in CRNA process ...
Solve:
npm i --save-dev babel-preset-es2015
i got the same issue
@mmcaptton that solution works for me as well.
For the record it seems that linking the android library must add a tons of functions as it requires me to add multidex support (some quick googling got me to android's docs on the matter). After adding multidex support, building worked again.
To the point of @powerful23, you should avoid linking if you do not have to.
@dabit3 This seems like a separate issue, but glad that fix works for you. I haven't tried it with an expo app yet, but I am assuming that using amplify with expo would be much easier since you are not dealing with linking. Also, love the podcast <3.
Most helpful comment
Just for help:
Adding aws-amplify on Expo26 causes: Couldn't find preset "es2015" ..... from amazon-cognito.identity-js
it seems that Expo forget to add babel-preset-es2015 in CRNA process ...
Solve:
npm i --save-dev babel-preset-es2015