mkloubert / nativescript-social-login

NativeScript plugin for social (token based) log-ins.
MIT License
42 stars 44 forks source link

Multiple dex files define Lcom/facebook/internal/Utility$GraphMeRequestWithCacheCallback #43

Closed tomas-lsd closed 6 years ago

tomas-lsd commented 6 years ago

In my project i work with javascript and the social login plugin is not working. On build a project for android give me an error with the message:

Running full build
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: Some input files use unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
Skip com.google.android.gms.internal.zzu
        Error: java.lang.NullPointerException

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:transformClassesWithDexForF0F1Debug'.
> com.android.build.api.transform.TransformException: com.android.ide.common.process.ProcessException: java.util.concurrent.ExecutionException: com.android.dex.DexException: Multiple dex files define Lcom/facebook/internal/Utility$GraphMeRequestWithCacheCallback;

Then, i added into app.gradle, in android -> defaultConfig this: multiDexEnabled true But then, on build project for android:

Running full build
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: Some input files use unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
Skip com.google.android.gms.internal.zzu
        Error: java.lang.NullPointerException

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:transformClassesWithJarMergingForF0F1Debug'.
> com.android.build.api.transform.TransformException: java.util.zip.ZipException: duplicate entry: com/facebook/AccessToken$1.class

This is the package.json:

{
  "description": "My Application",
  "license": "SEE LICENSE IN <your-license-filename>",
  "readme": "My Application",
  "repository": "<fill-your-repository-here>",
  "nativescript": {
    "id": "com.my.MyApp",
    "tns-ios": {
      "version": "3.4.1"
    },
    "tns-android": {
      "version": "3.4.2"
    }
  },
  "dependencies": {
    "base-64": "^0.1.0",
    "email-validator": "^1.0.7",
    "nativescript-dev-webpack": "^0.9.1",
    "nativescript-dom": "^2.0.0",
    "nativescript-localstorage": "^1.1.5",
    "nativescript-orientation": "^2.0.1",
    "nativescript-pro-ui": "^3.3.0",
    "nativescript-slides": "^2.2.12",
    "nativescript-social-login": "^3.0.8",
    "nativescript-statusbar": "^3.0.1",
    "nativescript-theme-core": "~1.0.2",
    "qs": "^6.4.0",
    "tns-core-modules": "^3.4.1",
    "tns-i18n": "0.0.10",
    "utf8": "^2.1.2"
  },
  "devDependencies": {
    "babel-traverse": "6.24.1",
    "babel-types": "6.24.1",
    "babylon": "6.17.2",
    "lazy": "1.0.11",
    "nativescript-dev-android-snapshot": "^0.*.*",
    "nativescript-dev-sass": "^1.2.0",
    "webpack": "~3.10.0",
    "webpack-bundle-analyzer": "^2.9.1",
    "webpack-sources": "~1.1.0",
    "copy-webpack-plugin": "~4.3.0",
    "raw-loader": "~0.5.1",
    "css-loader": "~0.28.7",
    "nativescript-worker-loader": "~0.8.1",
    "resolve-url-loader": "~2.2.1",
    "extract-text-webpack-plugin": "~3.0.2",
    "uglifyjs-webpack-plugin": "~1.1.6",
    "sass-loader": "~6.0.6"
  }
}

tns info:

All NativeScript components versions information
┌──────────────────┬─────────────────┬────────────────┬─────────────┐
│ Component        │ Current version │ Latest version │ Information │
│ nativescript     │ 3.4.3           │ 3.4.3          │ Up to date  │
│ tns-core-modules │ 3.4.1           │ 3.4.1          │ Up to date  │
│ tns-android      │ 3.4.2           │ 3.4.2          │ Up to date  │
│ tns-ios          │ 3.4.1           │ 3.4.1          │ Up to date  │
└──────────────────┴─────────────────┴────────────────┴─────────────┘

app.gradle:

buildscript {
    repositories {
        jcenter()
        mavenLocal()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:2.1.0'
        classpath 'com.google.gms:google-services:3.0.0'
    }
}

repositories {
    mavenCentral()
    maven { url 'https://maven.fabric.io/public' }
}

dependencies {
    compile 'com.facebook.android:facebook-android-sdk:4.6.0'
    compile 'com.google.android.gms:play-services-auth:8.4.0'
}

android {  
  defaultConfig {  
    generatedDensities = []
    applicationId = "com.my.MyApp" 
    multiDexEnabled true

  }  
  aaptOptions {  
    additionalParameters "--no-version-vectors"  
  }

} 
tomas-lsd commented 6 years ago

Sorry, i tried to delete this line compile 'com.facebook.android:facebook-android-sdk:4.6.0' from app.gradle And it works correctly.