skb1129 / react-native-change-icon

Change your application icon programmatically for React Native apps
MIT License
500 stars 92 forks source link

MainActivityicon does not exist in com.packagename #15

Closed lntsudhakar closed 4 years ago

lntsudhakar commented 4 years ago

I'm trying to run in android, but I'm getting the following error.

AndroidManifest.xml

<activity
          android:name=".SplashActivity"
          android:theme="@style/SplashTheme"
          android:label="@string/app_name"
          android:exported="true">
        </activity>

      <activity
        android:name=".MainActivity"
        android:label="@string/app_name"
        android:configChanges="keyboard|keyboardHidden|screenSize"
        android:windowSoftInputMode="adjustNothing"
        android:exported="true"
        android:screenOrientation="sensorPortrait">
      </activity>
      <activity-alias
            android:name="com.package.MainActivityicon"
            android:enabled="true"
            android:icon="@mipmap/icon"
            android:targetActivity=".MainActivity">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity-alias>

        <activity-alias
            android:name="com.package.MainActivityic"
            android:enabled="false"
            android:icon="@mipmap/ic"
            android:targetActivity=".MainActivity">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity-alias>

Error

Component class
com.package.MainActivityicon does not exist in com.packagename
skb1129 commented 4 years ago

@lntsudhakar, I think it is a simple package name mismatch, in the AndroidManifest.xml file the package name is com.package whereas in the error it is com.packagename.

lntsudhakar commented 4 years ago

No I changed the actual package name to sample com.package. Both are same in my file.

skb1129 commented 4 years ago

@lntsudhakar, Please share some more details so that I can pinpoint the issue.

  1. What React-Native version are you using?
  2. Are you using the latest version of this package?
  3. Is the Java package name the same as the package name in AndroidManfest.xml?
  4. Can you please share the android/app/build.gradle file?
lntsudhakar commented 4 years ago

It was the package name different in gradle file. Now its fixed.