gpt4 book ai didi

android - 无法编译外部项目

转载 作者:行者123 更新时间:2023-12-03 05:01:11 25 4
gpt4 key购买 nike

我从其他人那里检索了一个项目,我应该继续研究。我对gradle和所有构建都不是很熟悉,但是我已经完成了经典的解决方案,但我的问题仍然存在。

这是我尝试运行项目时遇到的错误:

Error while executing: am start -n "com.nouveal.note/com.nouveal.note.ui.activities.MainActivity" -a android.intent.action.MAIN -c android.intent.category.LAUNCHER Starting: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] cmp=com.nouveal.note/.ui.activities.MainActivity } Error type 3 Error: Activity class {com.nouveal.note/com.nouveal.note.ui.activities.MainActivity} does not exist.

Error while Launching activity



我确实按照其他帖子的要求将 apply plugin: 'com.android.application'放入了build.gradle中,但仍然出现此错误。

我也收到几行警告(一旦出现错误,警告就会消失):
  • 警告:忽略不带关联的EnclosingMethod属性的匿名内部类的InnerClasses属性。此类可能是由不针对modern.class格式的编译器生成的。推荐的解决方案是使用最新的编译器,而不指定任何-target类型选项,从源重新编译类。

  • 我真的不知道如何解决这个问题,任何帮助表示赞赏...

    编辑:有我的 list :
    <?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>
    <!--&lt;!&ndash;all small size screens&ndash;&gt;
    <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" />
    &lt;!&ndash; all normal size screens &ndash;&gt;
    <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上对其进行了编译,并且可以正常工作,所以...

    最佳答案

    看起来找不到您的Activity:com.nouveal.note.ui.activities.MainActivity。如果您已四处移动,请确保更新manifest.xml文件以反射(reflect)新的程序包结构。

    该错误似乎与Gradle无关。

    关于android - 无法编译外部项目,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37970611/

    25 4 0
    Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
    广告合作:1813099741@qq.com 6ren.com