0

필요한 모든 종속성을 가진 AAR 파일을 생성하는 데 문제가 있습니다. 내가 파일> 새로 모듈> 가져 오기 .JAR/.AAR 패키지를 사용하여 생성 된 AAR 파일을 추가하려고모든 종속성을 가진 AAR 파일 생성

apply plugin: 'com.android.library' 

android { 
    compileSdkVersion 25 
    buildToolsVersion '25.0.3' 

    defaultConfig { 
     minSdkVersion 15 
     targetSdkVersion 25 
     versionCode 1 
     versionName "3.5.0" 
     multiDexEnabled true 
     testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" 

    } 
    buildTypes { 
     release { 
      minifyEnabled false 
      proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' 
     } 
    } 
    compileOptions { 
     sourceCompatibility JavaVersion.VERSION_1_7 
     targetCompatibility JavaVersion.VERSION_1_7 
    } 

} 

dependencies { 
    compile 'com.android.support:appcompat-v7:24.2.1' 
    compile 'com.facebook.android:facebook-android-sdk:4.14.1' 
    compile 'com.squareup.retrofit2:retrofit:2.3.0' 
    compile 'com.google.code.gson:gson:2.8.1' 
    compile 'io.reactivex.rxjava2:rxandroid:2.0.1' 
    compile 'com.squareup.retrofit2:adapter-rxjava2:2.3.0' 
    compile 'com.google.android.gms:play-services:11.0.4' 
} 

: build.gradle의 구성은 다음과 같습니다. 그러나 페이스 북과 Google Play 서비스가 특정 외부 종속성을 모두 포함 할 수는 없습니다. 오류 메시지 :

Error:No resource found that matches the given name (at 'value' with value '@integer/google_play_services_version'). 

그리고 AndroidManifest.xml에는 com.facebook.FacebookActivity가 없습니다.

이 문제를 해결할 때 도움을주십시오. pom.xml 파일을 사용하여

업데이트

시도 건물,하지만 사용.

<?xml version="1.0" encoding="UTF-8"?> 
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
    xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> 
    <modelVersion>4.0.0</modelVersion> 
    <groupId>com.loginradius.androidsdk</groupId> 
    <artifactId>loginradius-android-sdk</artifactId> 
    <version>3.5.0</version> 
    <packaging>aar</packaging> 

    <properties> 
     <!-- use UTF-8 for everything --> 
     <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> 
     <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding> 
    </properties> 

    <dependencies> 
     <dependency> 
      <groupId>com.facebook.android</groupId> 
      <artifactId>facebook-android-sdk</artifactId> 
      <version>4.27.0</version> 
     </dependency> 
     <dependency> 
      <groupId>com.google.android</groupId> 
      <artifactId>google-play-services</artifactId> 
      <version>r22</version> 
     </dependency> 
    </dependencies> 

    <build> 
     <plugins> 
      <plugin> 
       <groupId>com.jayway.maven.plugins.android.generation2</groupId> 
       <artifactId>android-maven-plugin</artifactId> 
       <version>3.9.0-rc.1</version> 
       <configuration> 
        <sdk> 
         <platform>19</platform> 
        </sdk> 
        <deleteConflictingFiles>true</deleteConflictingFiles> 
        <undeployBeforeDeploy>true</undeployBeforeDeploy> 
       </configuration> 
       <extensions>true</extensions> 
      </plugin> 
      <plugin> 
       <artifactId>maven-compiler-plugin</artifactId> 
       <version>3.1</version> 
       <configuration> 
        <source>1.6</source> 
        <target>1.6</target> 
       </configuration> 
      </plugin> 
     </plugins> 
    </build> 

</project> 
+0

https://stackoverflow.com/questions/24325333/no-resource-found-integer-google-play-services-version-whats-this – Lingeshwaran

+0

@Lingeshwaran : 나는 내가 '적절한 솔루션 –

답변

0

모든 종속성이 저장되는 pom 파일을 생성해야합니다.

+0

하지 않을 수 있습니다 생각 내가 pom 파일을 생성하려고 시도했지만 성공적으로 빌드 할 수 없었습니다. 더 자세히 설명해 주시겠습니까? –

+0

@HiteshPamnani ok, 시도한 코드 – shmakova

+0

@HiteshPamnani이 pom은 (예를 들어, facebook sdk와 같은 버전의) 라이브러리가 아닙니다. 여기에서 생성하는 방법을 찾으십시오. https://stackoverflow.com/a/34914603/4141049 – shmakova

0

lib를 릴리스 할 계획이라면 패키지 된 aar에 종속 라이브러리를 포함하지 말고 대신 lib 빌드 스크립트에서 찾을 수있는 동일한 compile 종속성을 앱의 빌드 스크립트에 다음과 같이 추가하는 것이 좋습니다.

app build.gradle는 :

dependencies { 
    compile ':my-lib' 
    compile 'com.android.support:appcompat-v7:24.2.1' 
    compile 'com.facebook.android:facebook-android-sdk:4.14.1' 
    compile 'com.squareup.retrofit2:retrofit:2.3.0' 
    compile 'com.google.code.gson:gson:2.8.1' 
    compile 'io.reactivex.rxjava2:rxandroid:2.0.1' 
    compile 'com.squareup.retrofit2:adapter-rxjava2:2.3.0' 
    compile 'com.google.android.gms:play-services:11.0.4' 
} 

라이브러리의 사용자가 라이브러리가하는 것처럼 그들은 공공 도서관을 사용할 때 충돌을 병합에 직면하지 않을 그런 식으로, Gradle을가 자동으로 해결됩니다.

+0

에 게시해야합니다. 그러나, 나는 하나의 라이브러리에 모든 의존성을 포함시키는 더 좋은 방법을 찾고있다. –

+0

lib 사용자가 다음과 같은 문제를 겪게해서는 안됩니다. https://stackoverflow.com/q/38658378/2949966 https://stackoverflow.com/q/29628067/2949966 Gradle을 (를) 해결할 수 없습니다. aar에 특정 lib가 포함되어있는 경우 충돌을 병합합니다. 반면에 앱은 lib에 의존하고 lib의 메소드 호출 코드를 포함합니다. – ahasbini