2017-02-13 5 views
1

프로젝트를 분리 할 때 https://getexponent.com/에 의해 자동 생성 된 반응이있는 네이티브 프로젝트가 있습니다. 이제 반응 네이티브 링크를 추가 한 후 이러한 빌드 오류가 발생합니다. 그것은 엑스 코드와 아이폰 OS 프로젝트로 잘 작동하지만 안드로이드 스튜디오 나에게이 오류주고있다 :오류 : 패키지 이름이 'com.facebook.react'인 둘 이상의 라이브러리

Error:Execution failed for task ':app:processDebugResources'. 
> Error: more than one library with package name 'com.facebook.react' 

그리고 build.grade 파일을

apply plugin: 'com.android.application' 

android { 
    compileSdkVersion 24 
    buildToolsVersion '24.0.3' 

    packagingOptions { 
    exclude 'META-INF/LICENSE' 
    exclude 'META-INF/NOTICE' 
    } 

    defaultConfig { 
    applicationId "com.foo.app" 
    minSdkVersion 19 
    targetSdkVersion 24 
    versionCode 1 
    versionName "1.0" 
    multiDexEnabled true 
    ndk { 
     abiFilters 'armeabi-v7a', 'x86' 
    } 
    manifestPlaceholders = [ 
     'appAuthRedirectScheme': 'com.foo.app' 
    ] 
    } 
    buildTypes { 
    release { 
     minifyEnabled false 
     proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' 
    } 
    } 
    dexOptions { 
    javaMaxHeapSize "8g" 
    } 
} 

task exponentPrebuildStep(type: Exec) { 
    workingDir '../../' 

    if (System.getProperty('os.name').toLowerCase().contains('windows')) { 
    commandLine 'cmd', '/c', '.\\.exponent-source\\android\\detach-scripts\\prepare-detached-build.bat' 
    } else { 
    commandLine './.exponent-source/android/detach-scripts/prepare-detached-build.sh' 
    } 
} 
preBuild.dependsOn exponentPrebuildStep 

repositories{ 
    flatDir{ 
    dirs 'libs' 
    } 
    mavenLocal() 
    maven { url 'https://maven.fabric.io/public' } 
} 

dependencies { 
    compile project(':react-native-lock') 
    compile fileTree(dir: 'libs', include: ['*.jar']) 
    testCompile 'junit:junit:4.12' 
    compile 'com.android.support:appcompat-v7:24.1.1' 
    compile 'com.android.support:multidex:1.0.0' 


    compile('host.exp.exponent:exponentview:[email protected]') { 
    exclude module: 'bolts-android' 
    transitive = true; 
    } 


} 

과 반응 - 네이티브 잠금

repositories { 
    jcenter() 
} 

apply plugin: 'com.android.library' 

android { 
    compileSdkVersion 23 
    buildToolsVersion '24.0.3' 

    defaultConfig { 
     minSdkVersion 16 
     targetSdkVersion 23 
     versionCode 1 
     versionName "0.4.0" 
     ndk { 
      abiFilters "armeabi-v7a", "x86" 
     } 
    } 

    packagingOptions { 
     exclude 'META-INF/LICENSE' 
     exclude 'META-INF/NOTICE' 
    } 
} 

ext.libraries = [ 
    testing: [ 
      dependencies.create('junit:junit:4.11') { 
       exclude module: 'hamcrest-core' 
      }, 
      'org.robolectric:robolectric:3.0-rc3', 
      'com.google.guava:guava:18.0', 
      'org.hamcrest:hamcrest-integration:1.3', 
      'org.hamcrest:hamcrest-core:1.3', 
      'org.hamcrest:hamcrest-library:1.3', 
      'org.mockito:mockito-core:1.10.19', 
      dependencies.create('com.squareup:fest-android:1.0.+') { 
       exclude group: 'com.android.support', module: 'support-v4' 
      }, 
      'org.powermock:powermock-api-mockito:1.6.3', 
      'org.powermock:powermock-module-junit4-rule:1.6.3', 
      'org.powermock:powermock-classloading-xstream:1.6.3' 
     ] 
] 

dependencies { 
    compile fileTree(dir: 'libs', include: ['*.jar']) 
    compile 'com.android.support:appcompat-v7:23.1.0' 
    compile 'com.android.support:recyclerview-v7:23.0.1' 
    compile 'com.android.support:support-v4:23.+' 
    compile 'com.facebook.react:react-native:+' 
    compile 'com.auth0.android:lock:1.17.+' 
    compile 'com.auth0.android:lock-passwordless:1.17.+' 
    testCompile libraries.testing 
} 
+0

을 문서화

. –

+0

ok - 파일이 추가되었습니다. – MonkeyBonkey

답변