나는 free와 pro (버전)이라는 두 가지 맛을 지닌 하나의 프로젝트를 만들려고하고있다.맛을 서로 다른 패키지 이름을 사용하는 방법은 무엇입니까?
내 응용 프로그램이 다른 패키지와 PLAYSTORE 이미 (예 : com.example.appfree 및 com.example.app)
이 내 build.gradle입니다 :
defaultConfig {
applicationId "com.example.appfree"
}
productFlavors{
lite {
applicationIdSuffix 'lite'
}
pro {
}
}
그리고 이것은 내입니다 매니페스트 파일 :
<?xml version="1.0" encoding="utf-8"?>
<manifest
xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.app">
<application
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:supportsRtl="true"
android:theme="@style/AppTheme">
<activity
android:name=".SplashScreenActivity"
android:label="@string/app_name">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name=".MainActivity"/>
</application>
</manifest>
무료 및 프로 프리어 용 빌드 apk를 업로드하려고했습니다. 프로의 맛은 괜찮지 만, 패키지가 올바르지 않기 때문에 Google에서 무료 맛을 인정하지 않습니다. 이 문제를 어떻게 해결할 수 있습니까?
====== 해결 : ====== applicationIdSuffix는 buildTypes에서만 작동합니다.
Android Studio Project Site - ApplicationId versus PackageName에서 나는 applicationIdSuffix'이 맛을 위해 일'알고하지 않았다. 'applicationId'를 사용하여 향미료에 사용하려는 정확한 애플리케이션 ID를 입력하십시오. – CommonsWare
@CommonsWare, 좋은 답변입니다! applicationIdSuffix는 buildTypes에서만 작동합니다! 나는 applicationId를 사용했으며 완벽하게 작동합니다! :) –