12

I have just created an react-native app and building the React Native application giving me The error below.

H:\App Data\ejob-app\android\app\build\intermediates\manifests\full\debug\AndroidManifest.xml:2: AAPT: error: attribute 'package' in <manifest> tag is not a valid Android package name: 'com.ejob-app'.

H:\App Data\ejob-app\android\app\build\intermediates\manifests\full\debug\AndroidManifest.xml:17: AAPT: error: attribute 'android:name' in <application> tag must be a valid Java class name.

H:\App Data\ejob-app\android\app\build\intermediates\manifests\full\debug\AndroidManifest.xml:24: AAPT: error: attribute 'android:name' in <activity> tag must be a valid Java class name.

And Ended up with the error below..

FAILURE: Build failed with an exception.

* Where:
Build file 'H:\App Data\ejob-app\android\app\build.gradle' line: 1

* What went wrong:
A problem occurred evaluating project ':app'.
> Plugin with id 'com.ejob.app' not found.

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --        
debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org

BUILD FAILED in 2s
Could not install the app on the device, read the error above for details.
Make sure you have an Android emulator running or a device connected and 
have
set up your Android development environment:
https://facebook.github.io/react-native/docs/getting-started.html

Here is my AndroidManifest.xml to check the required configuration.

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.ejob-app"
android:versionCode="1"
android:versionName="1.0" >

<uses-sdk
    android:minSdkVersion="16"
    android:targetSdkVersion="26" />

<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.READ_PHONE_STATE" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />

<application
    android:name="com.ejob-app.MainApplication"
    android:allowBackup="false"
    android:debuggable="true"
    android:icon="@mipmap/ic_launcher"
    android:label="@string/app_name"
    android:theme="@style/AppTheme" >
    <activity
        android:name="com.ejob-app.MainActivity"
        android:configChanges="keyboard|keyboardHidden|orientation|screenSize"
        android:label="@string/app_name"
        android:windowSoftInputMode="adjustResize" >
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />
            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
    </activity>
    <activity android:name="com.facebook.react.devsupport.DevSettingsActivity" />
    </application>

</manifest>

Please guide me on this, please tell me if i missing something. i am very new to react-native.

4
  • 1
    upload codes from AndroidManifest.xml too Commented Jan 11, 2019 at 11:10
  • 1
    also show us app/build.gradle, since it says error build.gradle line 1 > Plugin with id 'com.ejob.app' not found. Commented Jan 11, 2019 at 11:14
  • You are missing < tag in your manifest please find and fix that. Commented Jan 11, 2019 at 11:19
  • also might have to take care about avoiding numbers from package name Commented Aug 10, 2022 at 8:52

3 Answers 3

15

Package name should not contain dashes. Rename your package from

'com.ejob-app'

to

'com.ejob_app'

You can follow this question

Sign up to request clarification or add additional context in comments.

Comments

6

I had the same problem and in my case, the problem was that when I created flutter project, I gave the org name as in.mycompany (observe, "in"). Now, it seems "in" is a keyword in Dart and so, Android Studio uses `in` in the files that it generates. However, that make Gradle unhappy, and causes it to generate message saying name must be a valid Java package name. Quite a conundrum :)

The solution is to search for this string `in`.mycompany in the whole project and change it to in.mycompany in build.gradle and AndroidManifest.xml files (there are several of such files, so just search). But leave it as `in` in the kotlin file MainActivity.kt

That fixed it for me.

Comments

1

Solution by @Priyshrm works, I had the same problem, the package name was changed to "'in'.companyname.appname" and this 'in' was creating problem. Just remove '' and solved

1 Comment

Your answer could be improved with additional supporting information. Please edit to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers in the help center.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.