我从其他人那里检索了一个项目,我应该继续研究它。我对gradle和所有版本都不太熟悉,但我已经完成了经典的解决方案,我的问题仍然存在。
以下是我尝试运行项目时遇到的错误:
执行时出错:am start -n " com.nouveal.note / com.nouveal.note.ui.activities.MainActivity" -一个 android.intent.action.MAIN -c android.intent.category.LAUNCHER 开始:Intent {act = android.intent.action.MAIN 猫= [android.intent.category.LAUNCHER] cmp = com.nouveal.note / .ui.activities.MainActivity}错误类型3错误: 活动类 {com.nouveal.note / com.nouveal.note.ui.activities.MainActivity} 不存在。
启动活动时出错
我确实按照其他帖子的建议将apply plugin: 'com.android.application'
放入我的build.gradle中,但仍然犯了这个错误。
我也会收到几行警告(一旦出现错误就会消失):
我真的迷失了如何解决这个问题,感谢任何帮助...
编辑:有我的清单:<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.nouveal.note" >
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.RECORD_AUDIO" />
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE"/>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
<uses-permission android:name="android.permission.INTERNET"/>
<compatible-screens>
<!--<!–all small size screens–>
<screen android:screenSize="small" android:screenDensity="ldpi" />
<screen android:screenSize="small" android:screenDensity="mdpi" />
<screen android:screenSize="small" android:screenDensity="hdpi" />
<screen android:screenSize="small" android:screenDensity="xhdpi" />
<!– all normal size screens –>
<screen android:screenSize="normal" android:screenDensity="ldpi" />
<screen android:screenSize="normal" android:screenDensity="mdpi" />
<screen android:screenSize="normal" android:screenDensity="hdpi" />
<screen android:screenSize="normal" android:screenDensity="xhdpi" />-->
<!-- all large size screens - at 4" to 7" -->
<screen android:screenSize="large" android:screenDensity="ldpi" />
<screen android:screenSize="large" android:screenDensity="mdpi" />
<screen android:screenSize="large" android:screenDensity="hdpi" />
<screen android:screenSize="large" android:screenDensity="xhdpi" />
<screen android:screenSize="large" android:screenDensity="480" />
<screen android:screenSize="large" android:screenDensity="640" />
<!-- all extra large size screens - at 7" to 10" -->
<screen android:screenSize="xlarge" android:screenDensity="ldpi" />
<screen android:screenSize="xlarge" android:screenDensity="mdpi" />
<screen android:screenSize="xlarge" android:screenDensity="hdpi" />
<screen android:screenSize="xlarge" android:screenDensity="xhdpi" />
<screen android:screenSize="xlarge" android:screenDensity="480" />
<screen android:screenSize="xlarge" android:screenDensity="640" />
</compatible-screens>
<application
android:name=".application.NoteApplication"
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:logo="@mipmap/ic_app_logo"
android:label="${appName}"
android:theme="@style/AppTheme" >
<activity
android:name=".ui.activities.MainActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name=".ui.activities.MediaListActivity"
android:parentActivityName=".ui.activities.MainActivity"
android:label="@string/screen_list_media_title"/>
<activity
android:name=".ui.activities.MediaTextActivity"
android:windowSoftInputMode="adjustResize"
android:label="@string/screen_media_text_title"/>
<activity
android:name=".ui.activities.MediaImageActivity"
android:label="@string/screen_media_image_title"/>
<activity
android:name=".ui.activities.MediaAudioActivity"
android:label="@string/screen_media_audio_title"/>
<activity
android:name=".ui.activities.MediaVideoActivity"
android:label="@string/screen_media_video_title"/>
<activity
android:name=".ui.activities.MediaDrawActivity"
android:label="@string/screen_media_drawing_title"/>
<activity
android:name=".ui.activities.SettingsActivity"
android:label="@string/screen_settings_title"/>
<meta-data
android:name="com.google.android.gms.version"
android:value="@integer/google_play_services_version" />
<provider
android:name=".database.NoteAppProvider"
android:authorities="com.nouveal.note.NoteProvider" />
</application>
</manifest>
顺便说一句,我的同事在android studio 1.4上编译了它并且它有效,所以......
答案 0 :(得分:2)
看起来无法找到您的活动:com.nouveal.note.ui.activities.MainActivity
。如果您已经移动了,请确保更新manifest.xml
文件以反映新的包结构。
此错误似乎与Gradle
无关。
答案 1 :(得分:0)
根据您的错误日志,我认为您的设备是我的LG Stylus 3 Android 7.0,当您按下并将应用程序从桌面移动到垃圾箱时,应用程序不会从设备中删除。有关详细信息,请参阅my accepted answer on the same question。