无法编译应用程序java.lang.IllegalStateException:processingEnv不能为null

时间:2019-11-29 13:18:08

标签: kotlin

由于某种原因,我的项目无法编译。 这是使用Android ROOM的音乐播放器 我无法弄清楚为什么它没有编译.. 这是我的课程: 谁能帮忙弄清楚哪里出了问题以及为什么它不为我编译? 我很迷失在这里

SongsListener界面

package com.forplay.a4play.`interface`

interface SongListListener {
    fun refreshItems()

    fun listToggleShuffle()

    fun listToggleSongRepetition()
}

BaseActivity.kt

package com.forplay.a4play.activity

import androidx.appcompat.app.AppCompatActivity
import androidx.core.app.ActivityCompat
import com.forplay.a4play.R
import com.forplay.a4play.dialog.ConfirmationDialog
import com.forplay.a4play.extension.*
import com.forplay.a4play.util.Const.Permissions.PERMISSION_WRITE_STORAGE

abstract class BaseActivity : AppCompatActivity() {

    companion object {
        var funAfterSAFPermission: ((success: Boolean) -> Unit)? = null
    }

    private val GENERIC_PERM_HANDLER = 100
    var actionOnPermission: ((granted: Boolean) -> Unit)? = null
    private var isAskingPermissions: Boolean = false

    override fun onResume() {
        super.onResume()

        handlePermission(PERMISSION_WRITE_STORAGE) {
            if (!it) {
                toast("Has No Permissions")
            }
        }
    }

    protected fun handlePermission(permissionId: Int, callback: (granted: Boolean) -> Unit) {
        actionOnPermission = null
        if (hasPermission(permissionId)) {
            callback(true)
        } else {
            isAskingPermissions = true
            actionOnPermission = callback
            ActivityCompat.requestPermissions(
                this,
                arrayOf(getPermissionString(permissionId)),
                GENERIC_PERM_HANDLER
            )
        }
    }

    override fun onRequestPermissionsResult(
        requestCode: Int,
        permissions: Array<String>,
        grantResults: IntArray
    ) {
        super.onRequestPermissionsResult(requestCode, permissions, grantResults)
        isAskingPermissions = false
        if (requestCode == GENERIC_PERM_HANDLER && grantResults.isNotEmpty()) {
            actionOnPermission?.invoke(grantResults[0] == 0)
        }
    }

    fun handleSAFDialog(path: String, callback: (success: Boolean) -> Unit): Boolean {
        return if (!packageName.startsWith("com.forplay")) {
            callback(true)
            false
        } else if (isShowingSAFDialog(path) || isShowingOTGDialog(path)) {
            funAfterSAFPermission = callback
            true
        } else {
            callback(true)
            false
        }
    }

    fun checkAppOnSDCard() {
        if (!config.wasAppOnSDShown && isAppInstalledOnSDCard()) {
            config.wasAppOnSDShown = true
            ConfirmationDialog(this, "", R.string.app_on_sd_card, R.string.ok, 0) {}
        }
    }
}

MainActivity.kt

    class MainActivity : BaseActivity(), SongListListener {
    private var isThirdPartyIntent:Boolean = false
    private var songs = ArrayList<Song>()
    private var searchMenuItem: MenuItem? = null
    private var isSearchOpen = false
    private var wasInitialPlaylistSet = false
    private var lastFilePickerPath = ""
    private var artView: ViewGroup? = null

    private var actionbarSize = 0
    private var topArtHeight = 0

    private var storedTextColor = 0
    private var storedShowAlbumCover = true

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(R.layout.activity_main)
        appLaunched(BuildConfig.APPLICATION_ID)
        isThirdPartyIntent = intent.action == Intent.ACTION_VIEW

        BusProvider.getInstance().register(this)
        initSeekbarChangeListener()

        actionbarSize = getActionBarHeight()
        artView = layoutInflater.inflate(R.layout.item_transparent, null) as ViewGroup
        setTopArtHeight()
        songs_fastscroller.measureItemIndex = LIST_HEADERS_COUNT

        handlePermission(PERMISSION_WRITE_STORAGE) {
            if (it) {
                initializePlayer()
            } else {
                toast(R.string.no_storage_permissions)
            }
        }

        shuffle_btn.setOnClickListener { toggleShuffle() }
        previous_btn.setOnClickListener { sendIntent(PREVIOUS) }
        play_pause_btn.setOnClickListener { sendIntent(PLAYPAUSE) }
        next_btn.setOnClickListener { sendIntent(NEXT) }
        repeat_btn.setOnClickListener { toggleSongRepetition() }
        song_progress_current.setOnClickListener { sendIntent(SKIP_BACKWARD) }
        song_progress_max.setOnClickListener { sendIntent(SKIP_FORWARD) }

        songs_playlist_empty_add_folder.setOnClickListener { addFolderToPlaylist() }
        volumeControlStream = AudioManager.STREAM_MUSIC
        storeStateVariables()

//        songs_list.recyclerScrollCallback = object : RecyclerScrollCallback {
//            override fun onScrolled(scrollY: Int) {
//                top_navigation.beVisibleIf(scrollY > topArtHeight && !isSearchOpen)
//                val minOverlayTransitionY = actionbarSize - topArtHeight
//                art_holder.translationY =
//                    Math.min(0, Math.max(minOverlayTransitionY, -scrollY / 2)).toFloat()
//                song_list_background.translationY = Math.max(0, -scrollY + topArtHeight).toFloat()
//            }
//        }

        if (savedInstanceState != null) {
            songs_list.onGlobalLayout {
                songs_list.scrollToPosition(0)
            }
        }

        checkAppOnSDCard()
    }

这是gradle(项目)

 // Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {
    ext.kotlin_version = '1.3.50'
    repositories {
        google()
        jcenter()

    }
    dependencies {
        classpath 'com.android.tools.build:gradle:3.5.2'
        classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}

allprojects {
    repositories {
        google()
        jcenter()
        maven { url "https://maven.google.com" }
        maven { url "https://jitpack.io" }
        maven { url "https://kotlin.bintray.com/kotlinx"}
    }
}

task clean(type: Delete) {
    delete rootProject.buildDir
}

This is gradle (APP)
    apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
apply plugin: 'kotlin-kapt'

android {
    compileSdkVersion 28
    buildToolsVersion "29.0.2"
    defaultConfig {
        applicationId "com.forplay.a4play"
        minSdkVersion 21
        targetSdkVersion 28
        versionCode 1
        versionName "1.0"
        setProperty("archivesBaseName", "music-player")
    }

    buildTypes {
        release {
            minifyEnabled true
            proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
        }
    }

    sourceSets {
        main.java.srcDirs += 'src/main/kotlin'
    }

    lintOptions {
        checkReleaseBuilds false
        abortOnError false
    }
}

dependencies {
    implementation fileTree(dir: 'libs', include: ['*.jar'])
    implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
    implementation 'androidx.appcompat:appcompat:1.1.0'
    implementation 'androidx.core:core-ktx:1.1.0'
    implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
    implementation 'androidx.core:core:1.1.0'
    implementation 'androidx.media:media:1.1.0'
    implementation 'com.squareup:otto:1.3.8'

    implementation 'androidx.swiperefreshlayout:swiperefreshlayout:1.0.0'
    implementation 'androidx.documentfile:documentfile:1.0.1'
    implementation 'com.google.android.material:material:1.0.0'

    kapt "androidx.room:room-compiler:2.2.2"
    implementation "androidx.room:room-runtime:2.2.2"

    implementation 'com.github.bumptech.glide:glide:4.10.0'
    kapt 'com.github.bumptech.glide:compiler:4.10.0'

    testImplementation 'junit:junit:4.12'
    androidTestImplementation 'androidx.test.ext:junit:1.1.1'
    androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
}

编译器错误:

    Executing tasks: [:app:assembleDebug] in project /Users/nirisraelhen/Dev/Android/Projects/4Play

    > Task :app:preBuild UP-TO-DATE
    > Task :app:preDebugBuild UP-TO-DATE
    > Task :app:checkDebugManifest UP-TO-DATE
    > Task :app:generateDebugBuildConfig UP-TO-DATE
    > Task :app:mainApkListPersistenceDebug UP-TO-DATE
    > Task :app:compileDebugAidl NO-SOURCE
    > Task :app:compileDebugRenderscript NO-SOURCE
    > Task :app:generateDebugResValues UP-TO-DATE
    > Task :app:generateDebugResources UP-TO-DATE
    > Task :app:mergeDebugResources UP-TO-DATE
    > Task :app:createDebugCompatibleScreenManifests UP-TO-DATE
    > Task :app:processDebugManifest UP-TO-DATE
    > Task :app:processDebugResources UP-TO-DATE
    > Task :app:kaptGenerateStubsDebugKotlin

    > Task :app:kaptDebugKotlin FAILED
    e: /Users/nirisraelhen/Dev/Android/Projects/4Play/app/build/tmp/kapt3/stubs/debug/com/forplay/a4play/activity/MainActivity.java:6: error: <identifier> expected
    public final class MainActivity extends com.forplay.a4play.activity.BaseActivity implements com.forplay.a4play.interface.SongListListener {
                                                                                                                   ^
    e: /Users/nirisraelhen/Dev/Android/Projects/4Play/app/build/tmp/kapt3/stubs/debug/com/forplay/a4play/activity/MainActivity.java:6: error: illegal start of type
    public final class MainActivity extends com.forplay.a4play.activity.BaseActivity implements com.forplay.a4play.interface.SongListListener {
                                                                                                                            ^
    e: /Users/nirisraelhen/Dev/Android/Projects/4Play/app/build/tmp/kapt3/stubs/debug/com/forplay/a4play/activity/MainActivity.java:6: error: ';' expected
    public final class MainActivity extends com.forplay.a4play.activity.BaseActivity implements com.forplay.a4play.interface.SongListListener {
                                                                                                                                             ^
    e: /Users/nirisraelhen/Dev/Android/Projects/4Play/app/build/tmp/kapt3/stubs/debug/com/forplay/a4play/activity/MainActivity.java:7: error: illegal start of expression
        private boolean isThirdPartyIntent;
        ^
    e: /Users/nirisraelhen/Dev/Android/Projects/4Play/app/build/tmp/kapt3/stubs/debug/com/forplay/a4play/activity/MainActivity.java:8: error: illegal start of expression
        private java.util.ArrayList<com.forplay.a4play.model.Song> songs;
        ^
    e: /Users/nirisraelhen/Dev/Android/Projects/4Play/app/build/tmp/kapt3/stubs/debug/com/forplay/a4play/activity/MainActivity.java:9: error: illegal start of expression
        private android.view.MenuItem searchMenuItem;
        ^
    e: /Users/nirisraelhen/Dev/Android/Projects/4Play/app/build/tmp/kapt3/stubs/debug/com/forplay/a4play/activity/MainActivity.java:10: error: illegal start of expression
        private boolean isSearchOpen;
        ^
    e: /Users/nirisraelhen/Dev/Android/Projects/4Play/app/build/tmp/kapt3/stubs/debug/com/forplay/a4play/activity/MainActivity.java:11: error: illegal start of expression
        private boolean wasInitialPlaylistSet;
        ^
    e: /Users/nirisraelhen/Dev/Android/Projects/4Play/app/build/tmp/kapt3/stubs/debug/com/forplay/a4play/activity/MainActivity.java:12: error: illegal start of expression
        private java.lang.String lastFilePickerPath;
        ^
    e: /Users/nirisraelhen/Dev/Android/Projects/4Play/app/build/tmp/kapt3/stubs/debug/com/forplay/a4play/activity/MainActivity.java:13: error: illegal start of expression
        private android.view.ViewGroup artView;
        ^
    e: /Users/nirisraelhen/Dev/Android/Projects/4Play/app/build/tmp/kapt3/stubs/debug/com/forplay/a4play/activity/MainActivity.java:14: error: illegal start of expression
        private int actionbarSize;
        ^
    e: /Users/nirisraelhen/Dev/Android/Projects/4Play/app/build/tmp/kapt3/stubs/debug/com/forplay/a4play/activity/MainActivity.java:15: error: illegal start of expression
        private int topArtHeight;
        ^
    e: /Users/nirisraelhen/Dev/Android/Projects/4Play/app/build/tmp/kapt3/stubs/debug/com/forplay/a4play/activity/MainActivity.java:16: error: illegal start of expression
        private int storedTextColor;
        ^
    e: /Users/nirisraelhen/Dev/Android/Projects/4Play/app/build/tmp/kapt3/stubs/debug/com/forplay/a4play/activity/MainActivity.java:17: error: illegal start of expression
        private boolean storedShowAlbumCover;
        ^
    e: /Users/nirisraelhen/Dev/Android/Projects/4Play/app/build/tmp/kapt3/stubs/debug/com/forplay/a4play/activity/MainActivity.java:18: error: illegal start of expression
        private java.util.HashMap _$_findViewCache;
        ^
    e: /Users/nirisraelhen/Dev/Android/Projects/4Play/app/build/tmp/kapt3/stubs/debug/com/forplay/a4play/activity/MainActivity.java:21: error: ';' expected
        protected void onCreate(@org.jetbrains.annotations.Nullable()
                               ^
    e: /Users/nirisraelhen/Dev/Android/Projects/4Play/app/build/tmp/kapt3/stubs/debug/com/forplay/a4play/activity/MainActivity.java:22: error: ';' expected
        android.os.Bundle savedInstanceState) {
                                            ^
    e: /Users/nirisraelhen/Dev/Android/Projects/4Play/app/build/tmp/kapt3/stubs/debug/com/forplay/a4play/activity/MainActivity.java:26: error: ';' expected
        protected void onResume() {
                               ^
    e: /Users/nirisraelhen/Dev/Android/Projects/4Play/app/build/tmp/kapt3/stubs/debug/com/forplay/a4play/activity/MainActivity.java:30: error: ';' expected
        protected void onPause() {
                              ^
    e: /Users/nirisraelhen/Dev/Android/Projects/4Play/app/build/tmp/kapt3/stubs/debug/com/forplay/a4play/activity/MainActivity.java:34: error: ';' expected
        protected void onStop() {
                             ^
    e: /Users/nirisraelhen/Dev/Android/Projects/4Play/app/build/tmp/kapt3/stubs/debug/com/forplay/a4play/activity/MainActivity.java:38: error: ';' expected
        protected void onDestroy() {
                                ^
    e: /Users/nirisraelhen/Dev/Android/Projects/4Play/app/build/tmp/kapt3/stubs/debug/com/forplay/a4play/activity/MainActivity.java:41: error: illegal start of expression
        private final void storeStateVariables() {
        ^
    e: /Users/nirisraelhen/Dev/Android/Projects/4Play/app/build/tmp/kapt3/stubs/debug/com/forplay/a4play/activity/MainActivity.java:41: error: ';' expected
        private final void storeStateVariables() {
                                              ^
    e: /Users/nirisraelhen/Dev/Android/Projects/4Play/app/build/tmp/kapt3/stubs/debug/com/forplay/a4play/activity/MainActivity.java:45: error: ';' expected
        protected void onNewIntent(@org.jetbrains.annotations.NotNull()
                                  ^
    e: /Users/nirisraelhen/Dev/Android/Projects/4Play/app/build/tmp/kapt3/stubs/debug/com/forplay/a4play/activity/MainActivity.java:46: error: ';' expected
        android.content.Intent intent) {
                                     ^
    e: /Users/nirisraelhen/Dev/Android/Projects/4Play/app/build/tmp/kapt3/stubs/debug/com/forplay/a4play/activity/MainActivity.java:49: error: illegal start of expression
        private final void setTopArtHeight() {
        ^
    e: /Users/nirisraelhen/Dev/Android/Projects/4Play/app/build/tmp/kapt3/stubs/debug/com/forplay/a4play/activity/MainActivity.java:49: error: ';' expected
        private final void setTopArtHeight() {
                                          ^
    e: /Users/nirisraelhen/Dev/Android/Projects/4Play/app/build/tmp/kapt3/stubs/debug/com/forplay/a4play/activity/MainActivity.java:52: error: illegal start of expression
        private final void setupSearch(android.view.Menu menu) {
        ^
    e: /Users/nirisraelhen/Dev/Android/Projects/4Play/app/build/tmp/kapt3/stubs/debug/com/forplay/a4play/activity/MainActivity.java:52: error: ';' expected
        private final void setupSearch(android.view.Menu menu) {
                                      ^
    e: /Users/nirisraelhen/Dev/Android/Projects/4Play/app/build/tmp/kapt3/stubs/debug/com/forplay/a4play/activity/MainActivity.java:52: error: ';' expected
        private final void setupSearch(android.view.Menu menu) {
                                                             ^
    e: /Users/nirisraelhen/Dev/Android/Projects/4Play/app/build/tmp/kapt3/stubs/debug/com/forplay/a4play/activity/MainActivity.java:55: error: illegal start of expression
        private final void showSortingDialog() {
        ^
    e: /Users/nirisraelhen/Dev/Android/Projects/4Play/app/build/tmp/kapt3/stubs/debug/com/forplay/a4play/activity/MainActivity.java:55: error: ';' expected
        private final void showSortingDialog() {
                                            ^
    e: /Users/nirisraelhen/Dev/Android/Projects/4Play/app/build/tmp/kapt3/stubs/debug/com/forplay/a4play/activity/MainActivity.java:58: error: illegal start of expression
        private final void toggleShuffle() {
        ^
    e: /Users/nirisraelhen/Dev/Android/Projects/4Play/app/build/tmp/kapt3/stubs/debug/com/forplay/a4play/activity/MainActivity.java:58: error: ';' expected
        private final void toggleShuffle() {
                                        ^
    e: /Users/nirisraelhen/Dev/Android/Projects/4Play/app/build/tmp/kapt3/stubs/debug/com/forplay/a4play/activity/MainActivity.java:61: error: illegal start of expression
        private final void toggleSongRepetition() {
        ^
    e: /Users/nirisraelhen/Dev/Android/Projects/4Play/app/build/tmp/kapt3/stubs/debug/com/forplay/a4play/activity/MainActivity.java:61: error: ';' expected
        private final void toggleSongRepetition() {
                                               ^
    e: /Users/nirisraelhen/Dev/Android/Projects/4Play/app/build/tmp/kapt3/stubs/debug/com/forplay/a4play/activity/MainActivity.java:64: error: illegal start of expression
        private final void removePlaylist() {
        ^
    e: /Users/nirisraelhen/Dev/Android/Projects/4Play/app/build/tmp/kapt3/stubs/debug/com/forplay/a4play/activity/MainActivity.java:64: error: ';' expected
        private final void removePlaylist() {
                                         ^
    e: /Users/nirisraelhen/Dev/Android/Projects/4Play/app/build/tmp/kapt3/stubs/debug/com/forplay/a4play/activity/MainActivity.java:67: error: illegal start of expression
        private final void openPlaylist() {
        ^
    e: /Users/nirisraelhen/Dev/Android/Projects/4Play/app/build/tmp/kapt3/stubs/debug/com/forplay/a4play/activity/MainActivity.java:67: error: ';' expected
        private final void openPlaylist() {
                                       ^
    e: /Users/nirisraelhen/Dev/Android/Projects/4Play/app/build/tmp/kapt3/stubs/debug/com/forplay/a4play/activity/MainActivity.java:70: error: illegal start of expression
        private final void showPlaylists(java.util.ArrayList<com.forplay.a4play.model.Playlist> playlists) {
        ^
    e: /Users/nirisraelhen/Dev/Android/Projects/4Play/app/build/tmp/kapt3/stubs/debug/com/forplay/a4play/activity/MainActivity.java:70: error: ';' expected
        private final void showPlaylists(java.util.ArrayList<com.forplay.a4play.model.Playlist> playlists) {
                                        ^
    e: /Users/nirisraelhen/Dev/Android/Projects/4Play/app/build/tmp/kapt3/stubs/debug/com/forplay/a4play/activity/MainActivity.java:70: error: ';' expected
        private final void showPlaylists(java.util.ArrayList<com.forplay.a4play.model.Playlist> playlists) {
                                                                                                         ^
    e: /Users/nirisraelhen/Dev/Android/Projects/4Play/app/build/tmp/kapt3/stubs/debug/com/forplay/a4play/activity/MainActivity.java:73: error: illegal start of expression
        private final void addFolderToPlaylist() {
        ^
    e: /Users/nirisraelhen/Dev/Android/Projects/4Play/app/build/tmp/kapt3/stubs/debug/com/forplay/a4play/activity/MainActivity.java:73: error: ';' expected
        private final void addFolderToPlaylist() {
                                              ^
    e: /Users/nirisraelhen/Dev/Android/Projects/4Play/app/build/tmp/kapt3/stubs/debug/com/forplay/a4play/activity/MainActivity.java:76: error: illegal start of expression
        private final java.util.ArrayList<java.lang.String> getFolderSongs(java.io.File folder) {
        ^
    e: /Users/nirisraelhen/Dev/Android/Projects/4Play/app/build/tmp/kapt3/stubs/debug/com/forplay/a4play/activity/MainActivity.java:76: error: ';' expected
        private final java.util.ArrayList<java.lang.String> getFolderSongs(java.io.File folder) {
                                                                          ^
    e: /Users/nirisraelhen/Dev/Android/Projects/4Play/app/build/tmp/kapt3/stubs/debug/com/forplay/a4play/activity/MainActivity.java:76: error: ';' expected
        private final java.util.ArrayList<java.lang.String> getFolderSongs(java.io.File folder) {
                                                                                              ^
    e: /Users/nirisraelhen/Dev/Android/Projects/4Play/app/build/tmp/kapt3/stubs/debug/com/forplay/a4play/activity/MainActivity.java:80: error: illegal start of expression
        private final void addFileToPlaylist() {
        ^
    e: /Users/nirisraelhen/Dev/Android/Projects/4Play/app/build/tmp/kapt3/stubs/debug/com/forplay/a4play/activity/MainActivity.java:80: error: ';' expected
        private final void addFileToPlaylist() {
                                            ^
    e: /Users/nirisraelhen/Dev/Android/Projects/4Play/app/build/tmp/kapt3/stubs/debug/com/forplay/a4play/activity/MainActivity.java:83: error: illegal start of expression
        private final void createPlaylistFromFolder() {
        ^
    e: /Users/nirisraelhen/Dev/Android/Projects/4Play/app/build/tmp/kapt3/stubs/debug/com/forplay/a4play/activity/MainActivity.java:83: error: ';' expected
        private final void createPlaylistFromFolder() {
                                                   ^
    e: /Users/nirisraelhen/Dev/Android/Projects/4Play/app/build/tmp/kapt3/stubs/debug/com/forplay/a4play/activity/MainActivity.java:86: error: illegal start of expression
        private final void createPlaylistFrom(java.lang.String path) {
        ^

    e: /Users/nirisraelhen/Dev/Android/Projects/4Play/app/build/tmp/kapt3/stubs/debug/com/forplay/a4play/activity/MainActivity.java:111: error: ';' expected
        private final void fillSongsListView(java.util.ArrayList<com.forplay.a4play.model.Song> songs) {
                                            ^
    e: /Users/nirisraelhen/Dev/Android/Projects/4Play/app/build/tmp/kapt3/stubs/debug/com/forplay/a4play/activity/MainActivity.java:111: error: ';' expected
        private final void fillSongsListView(java.util.ArrayList<com.forplay.a4play.model.Song> songs) {
                                                                                                     ^
    e: /Users/nirisraelhen/Dev/Android/Projects/4Play/app/build/tmp/kapt3/stubs/debug/com/forplay/a4play/activity/MainActivity.java:114: error: illegal start of expression
        private final int getSongIndex(com.forplay.a4play.model.Song song) {
        ^
org.jetbrains.kotlin.cli.jvm.compiler.KotlinToJVMBytecodeCompiler.compileModules$cli(KotlinToJVMBytecodeCompiler.kt:182)
        at org.jetbrains.kotlin.cli.jvm.K2JVMCompiler.doExecute(K2JVMCompiler.kt:164)
        at org.jetbrains.kotlin.cli.jvm.K2JVMCompiler.doExecute(K2JVMCompiler.kt:54)
        at org.jetbrains.kotlin.cli.common.CLICompiler.execImpl(CLICompiler.kt:84)
        at org.jetbrains.kotlin.cli.common.CLICompiler.execImpl(CLICompiler.kt:42)
        at org.jetbrains.kotlin.cli.common.CLITool.exec(CLITool.kt:104)
        at org.jetbrains.kotlin.daemon.CompileServiceImpl.compile(CompileServiceImpl.kt:1558)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:498)
        at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:357)
        at sun.rmi.transport.Transport$1.run(Transport.java:200)
        at sun.rmi.transport.Transport$1.run(Transport.java:197)
        at java.security.AccessController.doPrivileged(Native Method)
        at sun.rmi.transport.Transport.serviceCall(Transport.java:196)
        at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:573)
        at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(TCPTransport.java:834)
        at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.lambda$run$0(TCPTransport.java:688)
        at java.security.AccessController.doPrivileged(Native Method)
        at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:687)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
        at java.lang.Thread.run(Thread.java:748)
    Caused by: java.lang.IllegalStateException: processingEnv must not be null
        at androidx.room.RoomProcessor.getSupportedOptions(RoomProcessor.kt:57)
        at org.jetbrains.kotlin.kapt3.base.incremental.IncrementalProcessor.getSupportedOptions(incrementalProcessors.kt)
        at org.jetbrains.kotlin.kapt3.base.incremental.IncrementalProcessor.createDependencyCollector(incrementalProcessors.kt:44)
        at org.jetbrains.kotlin.kapt3.base.incremental.IncrementalProcessor.access$createDependencyCollector(incrementalProcessors.kt:22)
        at org.jetbrains.kotlin.kapt3.base.incremental.IncrementalProcessor$dependencyCollector$1.invoke(incrementalProcessors.kt:24)
        at org.jetbrains.kotlin.kapt3.base.incremental.IncrementalProcessor$dependencyCollector$1.invoke(incrementalProcessors.kt:22)
        at kotlin.SynchronizedLazyImpl.getValue(LazyJVM.kt:74)
        at org.jetbrains.kotlin.kapt3.base.incremental.IncrementalProcessor.getRuntimeType(incrementalProcessors.kt:69)
        at org.jetbrains.kotlin.cli.jvm.compiler.KotlinToJVMBytecodeCompiler.compileModules$cli(KotlinToJVMBytecodeCompiler.kt:177)
        ... 23 more


    FAILURE: Build failed with an exception.

    * What went wrong:
    Execution failed for task ':app:kaptDebugKotlin'.
    > Internal compiler error. See log for more details

    * 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 3s
    10 actionable tasks: 2 executed, 8 up-to-date

1 个答案:

答案 0 :(得分:0)

问题是由于您的软件包名称引起的。 包com.forplay.a4play。**interface**

由于界面是关键字,因此不能将其用作软件包名称。 将其更改为其他所有非关键字术语,您的问题将得到解决。