私は完全に機能していたアンドロイドプロジェクトを持っていました。MainActivity、CorrectAnswerActivity、UserFailed の 3 つのアクティビティがありました。私は、CorrectAnswerActivity と UserFailed で Google Play サービス API を使用しているため、これらは BaseGameUtil を拡張しています。
パッケージ名を変更するのが良い考えだと思うまでは、これで問題ありませんでした (ゲーム名を変更したため)。そのため、Failed または Correct のいずれかに移動する MainActivity のボタンをクリックすると、CorrectAnswerActivity または UserFailed が見つからないかのように、noclassdeffounderror が発生します。
マニフェストを新しいパッケージ名で更新し、それが言及されている他のすべての場所を更新しました。
08-20 21:45:29.765: E/AndroidRuntime(5549):
Caused by: java.lang.NoClassDefFoundError: com.blackcrowndev.numbers.CorrectAnswerActivity
08-20 21:45:29.765: E/AndroidRuntime(5549): at com.blackcrowndev.numbers.MainActivity.onClickGuess(MainActivity.java:254)
なんか関係ある気がする
public class CorrectAnswerActivity extends BaseGameActivity
implements View.OnClickListener {
しかし、私はライブラリ内で何も変更しませんでした。
助けてくれてありがとう。私は Java と Android の開発にまったく慣れていないので、さらに情報を提供する必要がある場合はお知らせください。私のマニフェストファイルを残します:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.blackcrowndev.numbers"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="14"
android:targetSdkVersion="18" />
<application
android:allowBackup="true"
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
android:theme="@style/Theme.Password" >
<meta-data
android:name="com.google.android.gms.games.APP_ID"
android:value="@string/app_id" />
<activity
android:name="com.blackcrowndev.numbers.MainActivity"
android:label="@string/app_name"
android:screenOrientation="portrait" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name="com.blackcrowndev.numbers.CorrectAnswerActivity"
android:label="@string/title_activity_correct_answer"
android:screenOrientation="portrait" >
</activity>
<activity
android:name="com.blackcrowndev.numbers.UserFailed"
android:label="@string/title_activity_user_failed"
android:screenOrientation="portrait" >
</activity>
<activity
android:name="com.blackcrowndev.numbers.HowToPlay"
android:label="@string/title_activity_how_to_play"
android:screenOrientation="portrait">
</activity>
</application>
</manifest>