error: <identifier> expected with package com.native - android

I followed this instructions to setup android requirements and initiate a project with react-native. When I try to run the application using the command react-native run-android, it keeps showing this error then exiting the process.
/path/to/native/android/app/src/main/java/com/native/MainActivity.java:1: error: <identifier> expected
package com.native;
^

The package name should not be a language tag.
Try the other keyword for the package
Like
package com.nativeapp or package com.appnative

As android relies on java to compile code, packages names fall under java reserved words restrictions, native is one of them. full list in Oracle documentation.
You also will have to avoid javascript reserved keyword defined in ECMA documentation.

Try changing any other package name as given package name is not a valid package name for android/java.

Related

Invalid application's package name in 'AndroidManifest.xml React native

I am trying to set up the app for the play store and I change the package name in the AndroidManifest.xml file. While making the app build I am getting a warning. I try to find the solution but did not get the right answer.
warn Invalid application's package name "com.bilalyaqoob.Animals" in 'AndroidManifest.xml'.
bilalyaqoob is my name and Animals is app name.
Can you please me what I am doing wrong?
You must changes all package name.
If you use Visual Code you can do this.

Buildozer error while compiling for Android

I am trying to compile a Kivy app to an Android apk. I get the following error at the very end of the process. Can someone please advise? The buildozer on-screen debug log and buildozer spec files are attached for reference.
Please advise.
Following is the buildozer error log:
Error: ERROR: /home/neo/code/siva-android/v1.1/.buildozer/android/platform/build-armeabi-v7a/dists/SIVAv1.1__armeabi-v7a/gradlew failed!
I found the issue with help of a person on a Kivy forum. It was due to an incorrect specification of the package name in the Buildozer spec file. Special characters are not allowed.
package.name: String, package name.
The Package name is one word with only ASCII characters and/or numbers. It should not contain any special characters. For example, if your application is named Flat Jewels, the package name can be flatjewels.
Buildozer app specifications

Android App bundle Cannot find symbol variable for resource

I am trying to access the resource which is in base.apk, As documented I am placing all common source and resource in base app. But when I try to access the same from dynamic-module its giving error: cannot find symbol variable <resource>
What I have noticed is the R package in the dynamic module is different than the base app. But the IDE is not complaining anything.
Appreciate if anyone can help with this issue.
Thanks.
You may try to remove the R import statement generated in the dynamic module and use the same as in the App module.
You'll have to explicitly import the R file for the module you're requesting the resource from. For Kotlin I use import aliases like this:
import foo.bar.base.R as Rbase
So instead of foo.bar.base.R.dimen.bar_foo_size I can write Rbase.dimen.bar_foo_size. This also makes it fairly explicit to see where a resource is coming from compared to having to look into the imports.

Package name doesnt match regex

My android studio project gives me an error "Package name doesnt match regex".
The package name is: package com.mondelicious.yuomi.Utils
Can somebody tell me what is wrong? Thank you
Naming Conventions
Package names are written in all lower case to avoid conflict with the
names of classes or interfaces.

Error when uploading apk to playstore, apk name not valid

I developed my very first android app but when i'm uploading to the Play Store I get the following error:
error
For those not speaking dutch," upload failed, the name of your apk has to be the following format 'com.example.myapp'. I'm guessing I didn't do this but I have no idea how to fix this. I'm using Android Studio 0.6.1
I did search the web but couldn't find a fix.
It is the name of the package of your app i.e bundle identifier. Also example cannot be used in it. For more info: Android - Package Name convention
change the package name
(com.example) is invalid.
use (com.xyz).
xyz means any thing u like but not example

Categories

Resources