2
votes

I changed the characterset from utf-8 to utf-16 in the manifest and in the ParseActivity. At first, the app launched just fine, but then said problem occurred. I could even publish the apps APK and install it on my phone, where it works without problems. Idnd't change anything on the code since.

Here is what I tried so far:

  • Update AndroidStudio
  • Update Gradle
  • File --> Invalidate Cash and restart
  • File --> Sync Project with Gradle Files
  • Build --> Clean Project
  • Build --> Rebuild Project

unfortunately, i had problems to post the first 3 lines of the manifest. the just seem to become invisible in the "code-layout", but here they are ([<] = <, and [>] = >):

[<] ?xml version="1.0" encoding="utf-16"?[>]

[<]manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.hjgjhftf.smartcards"[>]

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

<application
    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">
    <activity android:name=".MainActivity">
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />

            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
    </activity>
    <activity android:name=".PracticeActivity" />
    <activity
        android:name=".LoadCreate"
        android:configChanges="keyboardHidden|orientation|screenSize" />
    <activity android:name=".CreateActivity" />
    <activity android:name=".BrowseActivity" />
    <activity android:name=".ParseActivity" />
    <activity android:name=".EndPracticeActivity"></activity>
</application>

2
make sure that MainActivity still exist in your projectToan Tran
it still is in the project.Schelmuffsky

2 Answers

0
votes

I solved the problem by changing the file encoding in the MainActivity from UTF-8 to UTF-16. After doing that, Android Studio could recognise the default activity, in this case MainActivity, once again.

0
votes

I got the same problem. Edit Configuration--> Launch option to nothing And solved by:

  • Selecting module name and then Edit Configuration
  • Launch option : select nothing [Default is default activity] Then apply changes.

Posted here, because it may work for someone else.