Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

error: a type with the same simple name is already defined by the single-type-import of RNAWSCognitoPackage #27

Open
wzup opened this issue Jun 12, 2018 · 2 comments

Comments

@wzup
Copy link

wzup commented Jun 12, 2018

Environment

Environment:

  • OS: Linux 4.13
  • Node: 8.9.4
  • Yarn: Not Found
  • npm: 5.6.0
  • Watchman: Not Found
  • Xcode: N/A
  • Android Studio: Not Found

Packages: (wanted => installed)

  • react: 16.3.0-alpha.2 => 16.3.0-alpha.2
  • react-native: 0.54.2 => 0.54.2

Description

When I try $ react-native run-android on android emulator, I get this error:

:app:compileDebugJavaWithJavac
/home/user/app/android/app/src/main/java/com/package/MainApplication.java:8: error: a type with the same simple name is already defined by the single-type-import of RNAWSCognitoPackage
import com.airlabsinc.RNAWSCognitoPackage;
^
1 error
Incremental compilation of 1 classes completed in 0.448 secs.
:app:compileDebugJavaWithJavac FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:compileDebugJavaWithJavac'.
> Compilation failed; see the compiler error output for details.

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

BUILD FAILED

Total time: 10.964 secs
Could not install the app on the device, read the error above for details.
Make sure you have an Android emulator running or a device connected and have
set up your Android development environment:
https://facebook.github.io/react-native/docs/getting-started.html

Then I have 2 imports with the same name in my /home/user/app/android/app/src/main/java/com/package/MainApplication.java
May this cause the issue?
Is this the issue with RN?

package com.package;

import android.app.Application;

import com.facebook.react.ReactApplication;
import com.amazonaws.RNAWSCognitoPackage; // 1
import com.amazonaws.amplify.pushnotification.RNPushNotificationPackage;
import com.airlabsinc.RNAWSCognitoPackage; // 2
import com.horcrux.svg.SvgPackage;
import com.toast.ToastPackage;
import com.vdi.VDIPackage;
import com.BV.LinearGradient.LinearGradientPackage;
import com.facebook.react.ReactNativeHost;
import com.facebook.react.ReactPackage;
import com.facebook.react.shell.MainReactPackage;
import com.facebook.soloader.SoLoader;

import java.util.Arrays;
import java.util.List;

Steps to Reproduce

// TO DO

Expected Behavior

Running app on android emulator

Actual Behavior

See error above

Question asked

SO: https://stackoverflow.com/questions/50815811/execution-failed-for-task-appcompiledebugjavawithjavac

react-native: facebook/react-native#19656

@giginkrishnan
Copy link

any solution on this ?

@Peererxon
Copy link

In my case worked deleted the old react-native-google-signin and instead let the @react-native-google-signin/google-signin in the package.json, then cleaning the Gradle, cleaning metro cache and uninstalling the app from the device.
then I runned npm run android (before check that I add the @ before the node_modules path) and its work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants