不會產生ID最近我切換到IntelliJ IDEA的12的IntelliJ IDEA在R.java
現在創建了一個項目在Android很快就遇到了一個問題:在R.java
重建項目未生成的ID沒有幫助。
也許在IntelliJ Idea有什麼妙不可言的嗎?
錯誤:
12-01 16:08:15.067: ERROR/AndroidRuntime(7108): FATAL EXCEPTION: main
android.content.res.Resources$NotFoundException: String resource ID #0x1
at android.content.res.Resources.getText(Resources.java:266)
at android.widget.TextView.setText(TextView.java:3624)
at com.example.poem_new.MyActivity.invalidateCounters(MyActivity.java:41)
at com.example.poem_new.MyActivity.access$000(MyActivity.java:11)
at com.example.poem_new.MyActivity$1.onTextChanged(MyActivity.java:29)
at android.widget.TextView.sendOnTextChanged(TextView.java:8027)
at android.widget.TextView.handleTextChanged(TextView.java:8074)
at android.widget.TextView$ChangeWatcher.onTextChanged(TextView.java:8454)
at android.text.SpannableStringBuilder.sendTextChange(SpannableStringBuilder.java:892)
at android.text.SpannableStringBuilder.change(SpannableStringBuilder.java:352)
at android.text.SpannableStringBuilder.change(SpannableStringBuilder.java:266)
at android.text.SpannableStringBuilder.replace(SpannableStringBuilder.java:443)
at android.text.SpannableStringBuilder.replace(SpannableStringBuilder.java:420)
at android.text.SpannableStringBuilder.replace(SpannableStringBuilder.java:29)
at android.view.inputmethod.BaseInputConnection.replaceText(BaseInputConnection.java:669)
at android.view.inputmethod.BaseInputConnection.commitText(BaseInputConnection.java:188)
at com.android.internal.widget.EditableInputConnection.commitText(EditableInputConnection.java:149)
at com.android.internal.view.IInputConnectionWrapper.executeMessage(IInputConnectionWrapper.java:315)
at com.android.internal.view.IInputConnectionWrapper$MyHandler.handleMessage(IInputConnectionWrapper.java:85)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:154)
at android.app.ActivityThread.main(ActivityThread.java:4945)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:511)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551)
at dalvik.system.NativeStart.main(Native Method)
R.java文件是空的:
/* This stub is for using by IDE only. It is NOT the R class actually packed into APK */
public final class R {
}
您可以取消選中編譯器選項部分中的「使用外部構建」 –
未選中。沒有幫助... – Val
我有這個相同的問題。該項目在Intellij 11中建立良好,但不編譯12 –