2017-12-18 1 views
1

Gradle 용 Android Plugin을 2.3.3에서 3.0.1로 업그레이드하고 싶습니다. Migration Guide 다음의 모든 오류를 해결할 수 있습니다. 이제 내 문제는 Android Nougat (24) 및 Android Marshmallow (23) 애플리케이션 아이콘이 기본 로봇 아이콘으로 대체된다는 것입니다.3.0으로 Gradle Plugin 업데이트 후 응용 프로그램 아이콘이 보이지 않습니다.

문제의 원인을 알려주십시오. 이전에는 아이콘이 표시되었으며 지금은 논리적 인 이유가 표시되지 않습니다.

나는 모든 제안을 시도했지만 성공하지 못했습니다. here.

buildscript { 
ext.kotlinVersion = '1.2.10' 
repositories { 
    jcenter() 
    google() 
} 

dependencies { 
    classpath 'com.android.tools.build:gradle:3.0.1' 
    classpath 'com.google.gms:google-services:3.1.0' 
    classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVersion" 
} 
} 

allprojects { 
ext { 
    androidApplicationId = 'myapp.android' 
    androidVersionCode = 1 
    androidVersionName = "1.0" 
    testInstrumentationRunner = "android.support.test.runner.AndroidJUnitRunner" 
} 

repositories { 
    maven { url "https://maven.google.com" } 
} 
} 
+0

'ic_launcher_round'값에 대해 리소스로 사용할 수있는 것을 확인 했습니까 –

+0

문제없이 내 Android Studio를 업데이트 했으므로 프로젝트를 정리해야합니다. – salman

+0

@AbdulWaheed 나는 아이콘을 확인했으며, 예상 한대로 내 앱 아이콘이다. –

답변

1

안드로이드 시스템이 애플리케이션까지의 아이콘을 표시하지 않을 것입니다 :

<!-- Permissions --> 
<uses-permission android:name="android.permission.INTERNET" /> 
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" /> 
... 

<application 
    android:name="...Application" 
    android:allowBackup="false" 
    android:allowTaskReparenting="true" 
    android:icon="@mipmap/ic_launcher" 
    android:label="@string/application" 
    android:largeHeap="true" 
    android:roundIcon="@mipmap/ic_launcher_round" 
    android:theme="@style/Theme.MyTheme" 
    tools:replace="android:icon,theme,label,allowBackup"> 

<uses-library android:name="com.google.android.maps" /> 

    <activity 
     android:name="...SplashActivity" 
     android:label="@string/application" 
     android:theme="@style/Theme.Splash"> 
     <intent-filter> 
      <action android:name="android.intent.action.MAIN" /> 
      <category android:name="android.intent.category.LAUNCHER" /> 
     </intent-filter> 

    </activity> 

... 


</application> 
다음

프로젝트 Gradle을 파일입니다 : 여기

내 매니페스트 파일입니다 너는 그래.

우선 순위가 높은 목록의 아이콘을 바꾸고 우선 순위가 낮은 목록에 아이콘을 보관합니다.

+0

매니페스트 병합 중 충돌을 해결하려면 "바꾸기"가 필요합니다. 여기에 문제가 설명되어 있습니다 : https://stackoverflow.com/questions/24506800/android-studio-gradle-icon-error-manifest-merger –

+0

@MarioKutlev 아마 하위 프로젝트에 같은 이름의 하위 리소스가있는 경우 (ic_launcher)를 사용하면 해당 문제가 발생합니다. 임의의 해결책은 실행기 아이콘의 이름을 바꾸는 것입니다. – Ibrahim

+0

ic_launcher의 이름을 변경했지만 도움이되지 않았습니다. :( –

0

이 문제는이 Twitter post에서 발견되었습니다. Migration guide에서 설명한대로 "Android 플러그인 3.0.0에서 AAPT2가 기본적으로 사용 설정됩니다." 이 변경으로 인해 자원에 문제가 발생하는 것 같습니다.

응용 프로그램의 아이콘을 수정하려면 gradle.properties 파일에 android.enableAapt2=false을 추가하여 Aapt2 사용을 비활성화해야했습니다.

참고 : 같은 gradle 설정으로 새 응용 프로그램을 만들 때 문제를 재현 할 수 없습니다.

관련 문제