Android R Java Cannot Be Resolved to a Variable
Hello dev, meet me again (creatorb). Are you have experienced error like R cannot be resolved to a variable, sometimes i get that error like that when rebuild my project and next R file doesn't appear in the /gen folder. i confused, on my case it happens because there are similarities name between the packages name and package src gen name, and so i must change it to different name like this:
For example on my case, firstly the my packages name src is same with gen called gen called id.creatorb.muslimnews and i changed my src package to added activity on last name so it will be id.creatorb.muslimnews.activity, finally you can see my R.java has come and i can import my R.java now :) . Owh ya will you choose to change your gen package name not src package like me, isn't problem you can change it easy by go to your AndroidManifest.xml and search package, change it name and so your gen package name automatically change name as package name you have changed on AndroidManifest.xml. On other case somebody get error like that because their have a another error on layout xml then so it can't make automatically rebuild, don't forget to checking your xml file on res/layout, make sure it is not an error. Okkay dev, see you next post?
./creatorb
For example on my case, firstly the my packages name src is same with gen called gen called id.creatorb.muslimnews and i changed my src package to added activity on last name so it will be id.creatorb.muslimnews.activity, finally you can see my R.java has come and i can import my R.java now :) . Owh ya will you choose to change your gen package name not src package like me, isn't problem you can change it easy by go to your AndroidManifest.xml and search package, change it name and so your gen package name automatically change name as package name you have changed on AndroidManifest.xml. On other case somebody get error like that because their have a another error on layout xml then so it can't make automatically rebuild, don't forget to checking your xml file on res/layout, make sure it is not an error. Okkay dev, see you next post?
./creatorb
0 komentar :
Labels
Popular Posts
-
How to Create Recipes App Android 1.0 Splash Recipes App Hello dev, review kali ini mengenai cara pembuatan aplikasi resep masakan...
-
Halo dev, i'm creatorb. Apa kabar anda hari ini? Semoga masih sehat untuk melakukan aktifitas pada umumnya (coding set as default activi...
-
لسَّلاَمُ عَلَيْكُمْ وَرَحْمَةُ اللهِ وَبَرَكَاتُهُ Hello my dev friend and coders? Now i just wanna share about simple tips to...
-
Html Full Color Code | Daftar Kode Warna HTML lengkap | creatorb Hello dev, are you need more color code for your development? Now color ...
-
Eclipse Tip's and How to : Eclipse is defaulting to Java 1.5 and you have classes implementing interface methods (which in Java 1.6 c...
-
Who is the best between Genymotion or AVD ? Sebelum membaca lebih lanjut, perlu anda ketahui untuk pertama saya secara pribadi tidak i...
-
How to Fix keytool error: java.io.IOException: Keystore was tampered with, or password was incorrectHello dev, meet me again (creatorb). Case : Jika anda project android development anda menggunakan google map API, maka ada tahapan ...
-
Good morning, coders and developer wherever you are, how are you today? Mungkin lebih tepatnya tulisan saya kali ini bagi anda pecinta...
-
Hello dev, meet me again (creatorb). Sebelum membahas mengenai pemikiran yang dimaksud, apakah anda telah mengetahui apa itu OOP ? Menurut w...
-
How to Fix Error Fatal signal 11 (SIGSEGV) at 0x00000000 ? The real error is Out of memory on a 23818256-byte allocation . You are atte...
Posting Komentar