突然在 android 中找不到项目文件 jdk
Suddenly project files can not find jdk in android
我的项目直到昨晚都运行良好。今天,当我打开 stdio 时,突然出现错误,说找不到 LayoutInflator,找不到 Activity class,我们在导入时总是看到的每个 class 都不起作用。当我试图运行 应用程序然后它正在打开 "edit configuration" window 。我还设置了 jdk 和 stdio sdk 路径,并在所有配置的清单中声明了 activity,但我每次都丢失了。我附上我的清单和构建文件。
清单代码
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.shubham.sharma.bunktrackingapp" >
<application
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:theme="@style/AppTheme" >
<activity
android:name="TeacherPanel.MainActivity"
android:label="@string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name=".CoordinatorPanel.MainActivity"
android:label="@string/app_name" ></activity>
</application>
</manifest>
我的 gradle 代码在这里
apply plugin: 'com.android.application'
android {
compileSdkVersion 23
buildToolsVersion "23.0.3"
defaultConfig {
applicationId "com.shubham.sharma.bunktrackingapp"
minSdkVersion 15
targetSdkVersion 23
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile('com.mikepenz:materialdrawer:4.6.4@aar') {
transitive = true
}
compile 'com.android.support:multidex:1.0.1'
compile 'com.android.support:appcompat-v7:23.1.1'
compile 'com.android.support:cardview-v7:23.1.1'
compile 'com.android.support:design:23.1.1'
compile 'com.android.support:support-v4:23.1.1'
compile 'com.github.satyan:sugar:1.4'
compile 'com.squareup.retrofit:retrofit:2.0.0-beta2'
compile 'com.squareup.retrofit:converter-gson:2.0.0-beta2'
compile 'com.hannesdorfmann.mosby:mvp:2.0.0'
compile 'com.jakewharton:butterknife:7.0.1'
compile 'com.pnikosis:materialish-progress:1.7'
compile 'com.jakewharton.timber:timber:4.1.0'
compile 'de.greenrobot:eventbus:3.0.0-beta1'
compile files('libs/apache-httpcomponents-httpcore.jar')
compile files('libs/apache-httpcomponents-httpclient.jar')
}
您可能在构建配置方面遇到问题,只需转到“选项构建”并选择“重建”project.If它不起作用,然后让我知道您看到的错误是什么。
如果 jdk 是问题然后 ff Ubuntu - do -> sudo apt-get install openjdk-8-jdk - 这里首先检查什么版本java 如果它是 windows,你必须将环境变量中的 jdk/jre 设置为 java 8 对于这两个步骤,你将从 google.if 获得很多链接,但它没有解决最后一个选项然后尝试重做最后一步,由于这个错误导致 occurred.Try 创建另一个 android 项目并看到你在 java 文件中得到相同的错误,如果没有那么它不是 jdk 问题这与您的项目 R 文件有关,因为您的 xml 文件中存在一些错误。尝试 clean/re-build 项目。
我的项目直到昨晚都运行良好。今天,当我打开 stdio 时,突然出现错误,说找不到 LayoutInflator,找不到 Activity class,我们在导入时总是看到的每个 class 都不起作用。当我试图运行 应用程序然后它正在打开 "edit configuration" window 。我还设置了 jdk 和 stdio sdk 路径,并在所有配置的清单中声明了 activity,但我每次都丢失了。我附上我的清单和构建文件。 清单代码
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.shubham.sharma.bunktrackingapp" >
<application
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:theme="@style/AppTheme" >
<activity
android:name="TeacherPanel.MainActivity"
android:label="@string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name=".CoordinatorPanel.MainActivity"
android:label="@string/app_name" ></activity>
</application>
</manifest>
我的 gradle 代码在这里
apply plugin: 'com.android.application'
android {
compileSdkVersion 23
buildToolsVersion "23.0.3"
defaultConfig {
applicationId "com.shubham.sharma.bunktrackingapp"
minSdkVersion 15
targetSdkVersion 23
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile('com.mikepenz:materialdrawer:4.6.4@aar') {
transitive = true
}
compile 'com.android.support:multidex:1.0.1'
compile 'com.android.support:appcompat-v7:23.1.1'
compile 'com.android.support:cardview-v7:23.1.1'
compile 'com.android.support:design:23.1.1'
compile 'com.android.support:support-v4:23.1.1'
compile 'com.github.satyan:sugar:1.4'
compile 'com.squareup.retrofit:retrofit:2.0.0-beta2'
compile 'com.squareup.retrofit:converter-gson:2.0.0-beta2'
compile 'com.hannesdorfmann.mosby:mvp:2.0.0'
compile 'com.jakewharton:butterknife:7.0.1'
compile 'com.pnikosis:materialish-progress:1.7'
compile 'com.jakewharton.timber:timber:4.1.0'
compile 'de.greenrobot:eventbus:3.0.0-beta1'
compile files('libs/apache-httpcomponents-httpcore.jar')
compile files('libs/apache-httpcomponents-httpclient.jar')
}
您可能在构建配置方面遇到问题,只需转到“选项构建”并选择“重建”project.If它不起作用,然后让我知道您看到的错误是什么。
如果 jdk 是问题然后 ff Ubuntu - do -> sudo apt-get install openjdk-8-jdk - 这里首先检查什么版本java 如果它是 windows,你必须将环境变量中的 jdk/jre 设置为 java 8 对于这两个步骤,你将从 google.if 获得很多链接,但它没有解决最后一个选项然后尝试重做最后一步,由于这个错误导致 occurred.Try 创建另一个 android 项目并看到你在 java 文件中得到相同的错误,如果没有那么它不是 jdk 问题这与您的项目 R 文件有关,因为您的 xml 文件中存在一些错误。尝试 clean/re-build 项目。