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:
-
- Add the following two lines of configuration to build.gradle(:app)
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
-
- add the dependency path.
dependencies {
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
}
Read More:
- [Solved] Android project Compile error: error processing kotlin-stdlib-1.6.0.jar
- [Solved] Error:Kotlin: Module was compiled with an incompatible version of Kotlin. The binary version of
- Kotlin develop Error: java.lang.VerifyError [How to Solve]
- [Solved] Activity jump permission UID Error: ActivityTaskmanager: Permission Denied
- [Solved] fragment error: java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.myapplication/com.example.myapplication.MainActivity}…
- Android activity Fail to Switch to androidx AppCompatActivity Error
- [Solved] Tomcat startup error: sub-container startup failed
- Gradle Compile Error: compileJava FAILED [How to Solve]
- kafka Environment Build and Startup Error: ERROR [KafkaServer id=1] Fatal error during KafkaServer startup. Prepare to shutdown
- [Solved] kafka startup Error: ERROR Fatal error during KafkaServer startup. Prepare to shutdown
- [Solved] Maven Multi-Project Compile Error: The POM for xxx is invalid
- Android startup page (solve the problem of starting black and white screen)
- [Solved] Maven compile error: Blocked mirror for repositories
- [Solved] O2oa compile error: Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin
- [Solved] IDEA Compile Lombok to Generate getter/setter Error
- OTA Pack Compile Error: ExternalError: Failed to run signapk.jar: return code 1:Error: A JNI error has occurred
- Springboot startup error “No bean named’org.springframework.context.annotation.ConfigurationClassPostProcessor.importRegistry’ available”
- MVN compile Error: [ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin…
- [Solved] Springcloud Add Eureka to Startup Error
- [Solved] SpringCloud Compile Error: java: JPS incremental annotation processing is disabled. Compilation results on partial recompilation may be inaccurate.