Tag Archives: AndroidSudio

Kotlin activity Startup and Compile Error [How to Solve]

The android project added an activity written in kotlin code and tried to launch the page.
The error is reported as follows:

C:\Users\15901\Desktop\ShangXueTang\app\src\main\java\com\example\shangxuetang\MainActivity.java:41: ����: �Ҳ�������
startActivity(new Intent(MainActivity.this, LifecycleActivity.class));
^
����: �� LifecycleActivity
�: �� MainActivity
1 ������

 

Solution:

    1. Add the following two lines of configuration to build.gradle(:app)
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
    1. add the dependency path.
dependencies {
        classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
        }

Android Studio compile error: build tools is corrupt [Solved]

Error Messages:
Installed Build Tools revision 32.0.0 rc1 is corrupted. Remove and install again using the SDK Manager.
Problem Cause.
File corruption in buildTools after AndroidSutdio version upgrade.

Solution:
1 Modify d8.bat to dx.bat
2 Modify d8.jar to dx.jar