Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Creating a new project in Android studio-Kotlin error

I am very new to Kotlin and I am creating a new project that supports Kotlin in Android Studio 3.0 canary.

This project is having two issues.

  1. The R file is not getting resolved
  2. The package name must be a '.' separated identifier list

What should I do now?

Thanks in advance.

like image 287
Nisargi Joshi Avatar asked Jun 09 '17 10:06

Nisargi Joshi


People also ask

How do you fix your project requires a newer version of the Kotlin gradle plugin?

Solution of This error: Go to the Kotlin Gradle Plugin version checkup page, and get the latest version from the page. The latest version we get is "1.6. 21", now you have to update the version code at build. gradle located at android\build.

Why Android Studio is not opening?

If Studio doesn't start after an upgrade, the problem may be due to an invalid Android Studio configuration imported from a previous version of Android Studio or an incompatible plugin.


2 Answers

I assume you are using one of Kotlin keywords in your package name.

To fix compilation error just surround the Keywords like in ,as,is with Grave accent ( ` ). E.g. `is`.package.name,
`in`.company.app

Hope, it'll help you.

like image 78
Olga Konoreva Avatar answered Oct 01 '22 02:10

Olga Konoreva


This happens when you use a domain name with ".in" or any 2 character TLD in domain name while creating the project. This should be resolved if you create with a 3 character TLD domain name. Otherwise you can use as in_.xyz

like image 32
Tamal Biswas Avatar answered Oct 01 '22 02:10

Tamal Biswas