I have imported a project in android studio, after doing the build of the project, i am getting 100's of error in java classes with multiple package imports.
I have tried changing the package name in the AndroidManifest.xml file and change the applicationId in app level build.gradle files, but i couldn't resolve it
this is my manifest file where the package name is defined :
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.space.demoapp">
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission
android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission
android:name="android.permission.READ_EXTERNAL_STORAGE" />
<application android:name=".SpaceApplication"
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/AppTheme"
android:testOnly="false">
<activity
android:name=".accountDetails.BrandProductDetailActivity"
android:exported="false"/>
</application>
the app level build.gradle :
defaultConfig {
applicationId "com.space.demoapp"
minSdkVersion 15
targetSdkVersion 26
versionCode 1
versionName "1.0"
testInstrumentationRunner
"android.support.test.runner.AndroidJUnitRunner"
}
and some classes where the package imports are different from what is defined in mnifest.xml and build.gradle :
package com.example.bchauhan.demoapp;
import android.app.Activity;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter;
import android.support.v4.view.ViewPager;
import android.view.View;
import android.view.ViewGroup;
import com.space.demoapp.data.model.DatumPosts;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import static com.example.bchauhan.demoapp.HomeFragment.FIRST_PAGE;
import static com.space.demoapp.MainActivity.FIRST_PAGE;
So in the project there are 2 packages : different package
I am expecting that while importing any class it should import
package com.space.demoapp
not package com.example.bchauhan.demoapp
Please help.