tranleduy2000 / javaide

Code editor, java auto complete, java compiler, aapt, dx, zipsigner for Android
GNU General Public License v3.0
474 stars 159 forks source link

compile apk error #26

Open algericoabad opened 7 years ago

algericoabad commented 7 years ago

Whenever I compile my android project, it always has an error because of the file R.java...I clicked one of the error and it lead to the R file which lead to this conclusion.

How do I fix it?

algericoabad commented 7 years ago

I created a new android project without touching any of the codes but still gave the same error.

algericoabad commented 7 years ago

Compiling... Run aidl Run aapt Calling JNImain... Result from native lib=0 /storage/emulated/0/.AaptJNI/native_stdout.txt: open failed: ENOENT (No such file or directory) Compile Java file USER CLASS PATH : .:/data/data/com.duy.compiler.javanide/files/system/classes/android.jar SOURCE CLASS PATH : /mnt/sdcard/JavaNIDE/lab002/src/main/java [parsing started RegularFileObject[/mnt/sdcard/JavaNIDE/lab002/src/main/java/com/example/myapplication/mainactivity.java]] [parsing completed 20ms] [search path for source files: /mnt/sdcard/JavaNIDE/lab002/src/main/java] [search path for class files: /system/framework/core.jar,/system/framework/core-junit.jar,/system/framework/bouncycastle.jar,/system/framework/ext.jar,/system/framework/framework.jar,/system/framework/android.policy.jar,/system/framework/services.jar,/system/framework/apache-xml.jar,/system/framework/actions.jar,.,/data/data/com.duy.compiler.javanide/files/system/classes/android.jar] [loading ZipFileIndexFileObject[/data/data/com.duy.compiler.javanide/files/system/classes/android.jar(android/app/Activity.class)]] [loading ZipFileIndexFileObject[/data/data/com.duy.compiler.javanide/files/system/classes/android.jar(android/widget/TextView.class)]] [loading ZipFileIndexFileObject[/data/data/com.duy.compiler.javanide/files/system/classes/android.jar(android/os/Bundle.class)]] [loading ZipFileIndexFileObject[/data/data/com.duy.compiler.javanide/files/system/classes/android.jar(android/view/LayoutInflater.class)]] [loading ZipFileIndexFileObject[/data/data/com.duy.compiler.javanide/files/system/classes/android.jar(android/view/LayoutInflater$Factory2.class)]] [loading ZipFileIndexFileObject[/data/data/com.duy.compiler.javanide/files/system/classes/android.jar(android/view/LayoutInflater$Factory.class)]] [loading ZipFileIndexFileObject[/data/data/com.duy.compiler.javanide/files/system/classes/android.jar(java/lang/Object.class)]] [loading ZipFileIndexFileObject[/data/data/com.duy.compiler.javanide/files/system/classes/android.jar(android/view/Window.class)]] [loading ZipFileIndexFileObject[/data/data/com.duy.compiler.javanide/files/system/classes/android.jar(android/view/Window$Callback.class)]] [loading ZipFileIndexFileObject[/data/data/com.duy.compiler.javanide/files/system/classes/android.jar(android/view/KeyEvent.class)]] [loading ZipFileIndexFileObject[/data/data/com.duy.compiler.javanide/files/system/classes/android.jar(android/view/KeyEvent$Callback.class)]] [loading ZipFileIndexFileObject[/data/data/com.duy.compiler.javanide/files/system/classes/android.jar(android/os/Parcelable.class)]] [loading ZipFileIndexFileObject[/data/data/com.duy.compiler.javanide/files/system/classes/android.jar(android/view/InputEvent.class)]] [loading ZipFileIndexFileObject[/data/data/com.duy.compiler.javanide/files/system/classes/android.jar(android/view/View.class)]] [loading ZipFileIndexFileObject[/data/data/com.duy.compiler.javanide/files/system/classes/android.jar(android/view/View$OnCreateContextMenuListener.class)]] [loading ZipFileIndexFileObject[/data/data/com.duy.compiler.javanide/files/system/classes/android.jar(android/graphics/drawable/Drawable.class)]] [loading ZipFileIndexFileObject[/data/data/com.duy.compiler.javanide/files/system/classes/android.jar(android/graphics/drawable/Drawable$Callback.class)]] [loading ZipFileIndexFileObject[/data/data/com.duy.compiler.javanide/files/system/classes/android.jar(android/view/accessibility/AccessibilityEventSource.class)]] [loading ZipFileIndexFileObject[/data/data/com.duy.compiler.javanide/files/system/classes/android.jar(android/content/ComponentCallbacks2.class)]] [loading ZipFileIndexFileObject[/data/data/com.duy.compiler.javanide/files/system/classes/android.jar(android/content/ComponentCallbacks.class)]] [loading ZipFileIndexFileObject[/data/data/com.duy.compiler.javanide/files/system/classes/android.jar(android/view/ContextThemeWrapper.class)]] [loading ZipFileIndexFileObject[/data/data/com.duy.compiler.javanide/files/system/classes/android.jar(android/content/ContextWrapper.class)]] [loading ZipFileIndexFileObject[/data/data/com.duy.compiler.javanide/files/system/classes/android.jar(android/content/Context.class)]] [loading ZipFileIndexFileObject[/data/data/com.duy.compiler.javanide/files/system/classes/android.jar(android/view/ViewDebug.class)]] [loading ZipFileIndexFileObject[/data/data/com.duy.compiler.javanide/files/system/classes/android.jar(android/view/ViewDebug$ExportedProperty.class)]] [loading ZipFileIndexFileObject[/data/data/com.duy.compiler.javanide/files/system/classes/android.jar(android/view/ViewDebug$IntToString.class)]] [loading ZipFileIndexFileObject[/data/data/com.duy.compiler.javanide/files/system/classes/android.jar(java/lang/Override.class)]] [loading ZipFileIndexFileObject[/data/data/com.duy.compiler.javanide/files/system/classes/android.jar(java/lang/annotation/Annotation.class)]] [loading ZipFileIndexFileObject[/data/data/com.duy.compiler.javanide/files/system/classes/android.jar(java/lang/annotation/Target.class)]] [loading ZipFileIndexFileObject[/data/data/com.duy.compiler.javanide/files/system/classes/android.jar(java/lang/annotation/ElementType.class)]] [loading ZipFileIndexFileObject[/data/data/com.duy.compiler.javanide/files/system/classes/android.jar(java/lang/annotation/Retention.class)]] [loading ZipFileIndexFileObject[/data/data/com.duy.compiler.javanide/files/system/classes/android.jar(java/lang/annotation/RetentionPolicy.class)]] [checking com.example.myapplication.mainactivity] [loading ZipFileIndexFileObject[/data/data/com.duy.compiler.javanide/files/system/classes/android.jar(java/lang/Error.class)]] [loading ZipFileIndexFileObject[/data/data/com.duy.compiler.javanide/files/system/classes/android.jar(android/content/pm/PackageManager.class)]] [loading ZipFileIndexFileObject[/data/data/com.duy.compiler.javanide/files/system/classes/android.jar(android/content/pm/PackageManager$NameNotFoundException.class)]] [loading ZipFileIndexFileObject[/data/data/com.duy.compiler.javanide/files/system/classes/android.jar(android/util/AndroidException.class)]] [loading ZipFileIndexFileObject[/data/data/com.duy.compiler.javanide/files/system/classes/android.jar(java/lang/Exception.class)]] [loading ZipFileIndexFileObject[/data/data/com.duy.compiler.javanide/files/system/classes/android.jar(java/lang/Throwable.class)]] [loading ZipFileIndexFileObject[/data/data/com.duy.compiler.javanide/files/system/classes/android.jar(java/lang/RuntimeException.class)]] [loading ZipFileIndexFileObject[/data/data/com.duy.compiler.javanide/files/system/classes/android.jar(android/content/IntentSender.class)]] [loading ZipFileIndexFileObject[/data/data/com.duy.compiler.javanide/files/system/classes/android.jar(android/content/IntentSender$SendIntentException.class)]] [loading ZipFileIndexFileObject[/data/data/com.duy.compiler.javanide/files/system/classes/android.jar(java/io/IOException.class)]] [loading ZipFileIndexFileObject[/data/data/com.duy.compiler.javanide/files/system/classes/android.jar(java/io/FileNotFoundException.class)]] [loading ZipFileIndexFileObject[/data/data/com.duy.compiler.javanide/files/system/classes/android.jar(java/lang/AutoCloseable.class)]] [loading RegularFileObject[/mnt/sdcard/JavaNIDE/lab002/src/main/java/com/example/myapplication/R.java]] [parsing started RegularFileObject[/mnt/sdcard/JavaNIDE/lab002/src/main/java/com/example/myapplication/R.java]] /mnt/sdcard/JavaNIDE/lab002/src/main/java/com/example/myapplication/R.java:1: error:class, interface, or enum expected Writing symbols for class R. ^ /mnt/sdcard/JavaNIDE/lab002/src/main/java/com/example/myapplication/R.java:1: error:'{' expected Writing symbols for class R. ^ /mnt/sdcard/JavaNIDE/lab002/src/main/java/com/example/myapplication/R.java:32: error:reached end of file while parsing } ^ [parsing completed 57ms] /mnt/sdcard/JavaNIDE/lab002/src/main/java/com/example/myapplication/R.java:11: error:class R is already defined in package unnamed package public final class R { ^ /mnt/sdcard/JavaNIDE/lab002/src/main/java/com/example/myapplication/R.java:12: error:modifier static not allowed here public static final class attr { ^ /mnt/sdcard/JavaNIDE/lab002/src/main/java/com/example/myapplication/R.java:14: error:modifier static not allowed here public static final class drawable { ^ /mnt/sdcard/JavaNIDE/lab002/src/main/java/com/example/myapplication/R.java:17: error:modifier static not allowed here public static final class id { ^ /mnt/sdcard/JavaNIDE/lab002/src/main/java/com/example/myapplication/R.java:20: error:modifier static not allowed here public static final class layout { ^ /mnt/sdcard/JavaNIDE/lab002/src/main/java/com/example/myapplication/R.java:23: error:modifier static not allowed here public static final class string { ^ /mnt/sdcard/JavaNIDE/lab002/src/main/java/com/example/myapplication/R.java:27: error:modifier static not allowed here public static final class style { ^ /mnt/sdcard/JavaNIDE/lab002/src/main/java/com/example/myapplication/mainactivity.java:12: error:cannot access R setContentView(R.layout.activity_main); ^ bad source file: /mnt/sdcard/JavaNIDE/lab002/src/main/java/com/example/myapplication/R.java file does not contain class com.example.myapplication.R Please remove or make sure it appears in the correct subdirectory of the sourcepath. [total 2909ms] Compile error

tranleduy2000 commented 6 years ago

Hello, I fixed this problem in latest commit 96928879486b2e9101fcf23fd24a6b6dffc7b2f5