android "use $ instead of ." produce cannot resolve symbol - java

In my manifest. with the new SDK, it requires me to replace my android:name paths with the warning:
use $ instead of . for inner classes(or use only lowercase letters in package name)
This is one of my activities:
<activity
android:name=".Activities.LoginActivity" >
</activity>
and it suggest me to replace it with
<activity
android:name=".Activities$LoginActivity" >
</activity>
The problem is that this produce the following:
Cannot resolve symble Activities
So, what I have to do? I just ignore the alert or I have to replace it someway else?
EDIT:
here is the source of activities folder:
app.java.personal.pier.myapp.Activities
this is my entire manifest, I don't think it should be need but just in case it is here :)
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="personal.pier.myapp" >
<uses-permission android:name="andorid.permission.WRITE_EXTERNAL_STORAGE" />
<application
android:allowBackup="true"
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
android:theme="#style/AppTheme"
android:supportsRtl="true" >
<activity
android:name=".Activities.SplashScreenActivity"
android:label="#string/app_name"
>
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name=".Activities.LoginActivity" >
</activity>
<activity
android:name=".Activities.HomePageActivity" >
</activity>
<activity
android:name=".Activities.FoodAddActivity" >
</activity>
<activity
android:name=".Activities.FoodManagementActivity" >
</activity>
<activity
android:name=".Activities.FoodDetailsActivity" >
</activity>
<activity
android:name=".Activities.EatingSuntActivity" >
</activity>
<activity
android:name=".Activities.EatingDetailsActivity" >
</activity>
<activity
android:name=".Activities.EatingAddActivity" >
</activity>
<activity android:name=".Activities.SportAddActivity" >
</activity>
</application>
</manifest>

The most likely problem appeared because you are using upper case in your package name.

Related

I have warning "App is not indexable by Google Search; consider adding at least one Activity with an ACTION-VIEW intent filter. "

After the update, the following warning appeared in the studio:
“App is not indexable by Google Search; consider adding ACTION-VIEW intent filter. See issue explanation for more details. more ... (Ctrl + F1) »
How to fix it?
My Api is 28.
Here is my manifests:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.omen.serverforcofe" >
<uses-permission android:name="android.permission.NFC"/>
<uses-feature android:name="android.hardware.nfc" android:required="true" />
<application
android:allowBackup="true"
android:icon="#mipmap/ic_launcher"
android:label="#string/app_name"
android:theme="#style/AppTheme"
>
<activity
android:name=".MainActivity"
android:label="#string/app_name"
android:launchMode="singleTop">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
<intent-filter>
<action android:name="android.nfc.action.NDEF_DISCOVERED" />
<category android:name="android.intent.category.DEFAULT" />
<data android:mimeType="text/plain"
/>
</intent-filter>
</activity>
</application>
</manifest>
<activity
android:name=".MyActivity"
android:screenOrientation="portrait"
android:label="#string/app_name">
<intent-filter>
<action android:name="android.intent.action.VIEW" />
</intent-filter>
</activity>
Adding this intent filter to one of the activities declared in app manifest fixed this for me.

changed package name, now AndroidManifest.xml doesn't work

So, I tried to change the package by the following steps I found elsewhere on StackOverflow website:
create a new package
refractor the package to the new package
changing the package line in the form for the AndroidManifest.xml
btw I'm using Eclipse, if that's relevant.
However, I'm getting an error message in the AndroidManifext.xml file:
Parser exception for /GameProj/AndroidManifest.xml: The prefix "com.p.gameproj.Dataid" for attribute "com.p.gameproj.Dataid:name" associated with an element type "activity" is not bound At line 31.
Can someone tell me what the error message means?
Also, here's the AndroidManifest.xml file, if it's relevant:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.p.gameproj"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="8"
android:targetSdkVersion="21" />
<application
android:allowBackup="true"
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
android:theme="#style/AppTheme" >
<activity
android:name="com.p.gameproj.MainActivity"
android:label="#string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
com.p.gameproj.Creditsname=".Credits"
android:label="#string/title_activity_credits" >
</activity>
<activity
com.p.gameproj.Dataid:name=".Data"
android:label="#string/title_activity_data" >
</activity>
<activitycom.p.gameproj.CharacterPageandroid:name=".CharacterPage"
android:label="#string/title_activity_character_page" >
</activity>
<activity
com.p.gameproj.StatPageame=".StatPage"
android:label="#string/title_activity_stat_page" >
</activity>
<activitycom.p.gameproj.MapMain android:name=".MapMain"
android:label="#string/title_activity_map_main" >
</activity>
com.p.gameproj.ScreenLocvity
android:name=".ScreenLoc"
android:label="#string/title_activity_screen_loc"com.p.gameproj.BattleScreen/activity>
<activity
android:name=".BattleScreen"
android:label="#string/title_activity_battle_screen" >
</com.p.gameproj.InvScreen
<activity
android:name=".InvScreen"
android:label="#string/title_activity_inv_screen"com.p.gameproj.ShopThing </activity>
<activity
android:name=".ShopThing"
android:label="#string/title_activity_shop_thing" >
</activity>
</application>
</manifest>
Looks like something went wrong during your package name change. Probably a bad find/replace action. There are a several invalid attributes and elements in the AndroidManifest.xml file such as the following:
<activity
com.p.gameproj.Dataid:name=".Data"
android:label="#string/title_activity_data" >
Notice the com.p.gameproj.Dataid:name=".Data". It should be android:name=".Data".
Once you fix all these bad values it should work again.
This should be close
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.p.gameproj"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="8"
android:targetSdkVersion="21" />
<application
android:allowBackup="true"
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
android:theme="#style/AppTheme" >
<activity
android:name="com.p.gameproj.MainActivity"
android:label="#string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name=".Credits"
android:label="#string/title_activity_credits" >
</activity>
<activity
android:name=".Data"
android:label="#string/title_activity_data" >
</activity>
<activity
android:name=".CharacterPage"
android:label="#string/title_activity_character_page" >
</activity>
<activity
android:name=".StatPage"
android:label="#string/title_activity_stat_page" >
</activity>
<activity
android:name=".MapMain"
android:label="#string/title_activity_map_main" >
</activity>
<activity
android:name=".ScreenLoc"
android:label="#string/title_activity_screen_loc">
</activity>
<activity
android:name=".BattleScreen"
android:label="#string/title_activity_battle_screen" >
</activity>
<activity
android:name=".InvScreen"
android:label="#string/title_activity_inv_screen">
</activity>
<activity
android:name=".ShopThing"
android:label="#string/title_activity_shop_thing" >
</activity>
</application>
</manifest>

error on uploading to google play: android:label attribute: attribute is not a string value

i have tried to upload my new apk to google play services and it says the current error message:
Your APK cannot be analyzed using aapt. Error output:
Failed to run aapt dump badging:
ERROR getting 'android:label' attribute:attribute is not a string value
I have tried to search for this error on the web, and this tutorial(ERROR getting 'android:label' attribute: attribute is not a string value) recomended to use the "aapt dump badging APKPATH" command to see what's the error. Here's what i got:
http://postimg.org/image/u8d0unohv/
I really don´t know how to read this. Can someone help me to identify the error? My game has a values-jp folder for japanese strings and here is the manifest file:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="br.ufrn.dimap.pairg.karutakanji.android"
android:versionCode="7"
android:versionName="0.1.12-beta" >
<supports-screens
android:largeScreens="true"
android:normalScreens="false"
android:smallScreens="false"
android:xlargeScreens="true"
android:requiresSmallestWidthDp="600" />
<uses-sdk
android:minSdkVersion="11"
android:targetSdkVersion="18" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.GET_ACCOUNTS" />
<uses-permission android:name="android.permission.GET_TASKS" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<dependency>
<groupId>javax.mail</groupId>
<artifactId>mail</artifactId>
<version>1.4.5</version>
</dependency>
<dependency>
<groupId>javax.activation</groupId>
<artifactId>activation</artifactId>
<version>1.1.1</version>
</dependency>
<application
android:allowBackup="true"
android:icon="#drawable/ic_launcher"
android:label="#string/tituloDoApp"
android:theme="#style/AppTheme" >
<meta-data
android:name="com.google.android.gms.games.APP_ID"
android:value="#string/app_id" />
<meta-data
android:name="com.google.android.gms.version"
android:value="#integer/google_play_services_version" />
<activity
android:name="com.karutakanji.EscolherCategoriasModoTreinamento"
android:label="#string/app_name"
android:screenOrientation="portrait" >
</activity>
<activity
android:name="com.karutakanji.MainActivity"
android:label="#string/tituloDoApp"
android:screenOrientation="portrait"
android:windowSoftInputMode="stateHidden" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name="com.karutakanji.ModoCasual"
android:label="#string/title_activity_tela_inicial_multiplayer"
android:screenOrientation="portrait" >
</activity>
<activity
android:name="com.karutakanji.ModoTreinamento"
android:label="#string/title_activity_modo_treinamento"
android:screenOrientation="portrait" >
</activity>
<activity
android:name="com.karutakanji.DadosPartidasAnteriores"
android:label="#string/title_activity_dados_partidas_anteriores"
android:screenOrientation="portrait" >
</activity>
<activity
android:name="com.karutakanji.MostrarDadosUmaPartida"
android:label="#string/title_activity_mostrar_dados_uma_partida"
android:screenOrientation="portrait" >
</activity>
<activity
android:name="com.karutakanji.LojinhaMaceteKanjiActivity"
android:label="#string/title_activity_lojinha_macete_kanji"
android:screenOrientation="portrait" >
</activity>
<activity
android:name="com.karutakanji.VerMaceteKanjiActivity"
android:label="#string/title_activity_ver_macete_kanji"
android:screenOrientation="portrait" >
</activity>
<service
android:name="com.karutakanji.BackgroundSoundService"
android:enabled="true" >
</service>
<activity
android:name="com.karutakanji.MostrarRegrasModoTreinamento"
android:label="#string/tituloDoApp"
android:screenOrientation="portrait" >
</activity>
<activity
android:name="com.karutakanji.Configuracoes"
android:label="#string/title_activity_configuracoes"
android:screenOrientation="portrait" >
</activity>
<activity
android:name="com.karutakanji.EscolherFormaDeJogoTreinamento"
android:label="#string/title_activity_escolher_forma_de_jogo_treinamento"
android:screenOrientation="portrait" >
</activity>
<activity
android:name="com.karutakanji.ModoCompeticao"
android:label="#string/title_activity_modo_competicao"
android:screenOrientation="portrait" >
</activity>
<activity
android:name="com.karutakanji.RankingCompeticao"
android:label="#string/title_activity_ranking_competicao"
android:screenOrientation="portrait" >
</activity>
<activity
android:name="com.karutakanji.EsqueceuSenha"
android:label="#string/title_activity_esqueceu_senha"
android:screenOrientation="portrait" >
</activity>
<activity
android:name="com.karutakanji.MostrarPalavrasUmaPartida"
android:label="#string/title_activity_mostrar_palavras_uma_partida"
android:screenOrientation="portrait" >
</activity>
</application>
</manifest>
It looks like you have some of your tags out of place. Make sure you follow the correct structure which can be found Here. Looking at the Manifest page it does not seem that the "dependency" tag is valid as it is not within the "can contain" list.
i have found the answer. Just follow the link i gave, use the command aapt dump badging APKPATH, you will receive a sort of id number on the error. Search(ctrl+f) on your project's R.java archive and find a component there. My error was: On strings.xml, this component with this id didn't exist! I must have deleted it by mistake ^^

How to set Holo light theme for all android application

I accidentally did something in the layout and now all of my activities are dark colored with white text "inside TextViews", before that all of them were grey color with black text, as I searched the internet I believe that I somehow changed all activities from "Holo light" to "Holo dark", how can I get the default theme back?
PS. I don't believe the problem is from the layouts because I didn't touch them.
PS. Here is my manifest :
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.excellence.youniversity"
android:versionCode="2"
android:versionName="1.1" >
<uses-sdk
android:minSdkVersion="9"
android:targetSdkVersion="22" />
<supports-screens
android:largeScreens="true"
android:normalScreens="true"
android:resizeable="true"
android:smallScreens="true" />
<application
android:allowBackup="true"
android:icon="#drawable/blue"
android:label="#string/app_name"
android:theme="#style/AppTheme" >
<activity
android:name=".MainActivity"
android:label="#string/app_name"
android:theme="#android:style/Theme.NoTitleBar" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name=".CoursesActivity"
android:label="#string/title_activity_courses"
android:theme="#android:style/Theme.NoTitleBar" >
</activity>
<activity
android:name=".Technology"
android:label="#string/title_activity_technology"
android:theme="#android:style/Theme.NoTitleBar" >
</activity>
<activity
android:name=".Science"
android:label="#string/title_activity_science"
android:theme="#android:style/Theme.NoTitleBar" >
</activity>
<activity
android:name=".Langauges"
android:label="#string/title_activity_langauges"
android:theme="#android:style/Theme.NoTitleBar" >
</activity>
<activity
android:name=".Thinking"
android:label="#string/title_activity_thinking"
android:theme="#android:style/Theme.NoTitleBar" >
</activity>
<activity
android:name=".Art"
android:label="#string/title_activity_art"
android:theme="#android:style/Theme.NoTitleBar" >
</activity>
<activity
android:name=".Medicine"
android:label="#string/title_activity_medicine"
android:theme="#android:style/Theme.NoTitleBar" >
</activity>
<activity
android:name=".RoboticActivity"
android:label="#string/title_activity_robotic"
android:theme="#android:style/Theme.NoTitleBar" >
</activity>
<activity
android:name=".TechActivity"
android:label="#string/title_activity_tech"
android:theme="#android:style/Theme.NoTitleBar" >
</activity>
<activity
android:name=".AndroidActivity"
android:label="#string/title_activity_android"
android:theme="#android:style/Theme.NoTitleBar" >
</activity>
<activity
android:name=".WedooActivity"
android:label="#string/title_activity_wedoo"
android:theme="#android:style/Theme.NoTitleBar" >
</activity>
<activity
android:name=".AndroiddActivity"
android:label="#string/title_activity_androidd"
android:theme="#android:style/Theme.NoTitleBar" >
</activity>
<activity
android:name=".CSIActivity"
android:label="#string/title_activity_csi"
android:theme="#android:style/Theme.NoTitleBar" >
</activity>
<activity
android:name=".ChemistryActivity"
android:label="#string/title_activity_chemistry"
android:theme="#android:style/Theme.NoTitleBar" >
</activity>
<activity
android:name=".AstronomyActivity"
android:label="#string/title_activity_astronomy"
android:theme="#android:style/Theme.NoTitleBar" >
</activity>
<activity
android:name=".ArchitectureActivity"
android:label="#string/title_activity_architecture"
android:theme="#android:style/Theme.NoTitleBar" >
</activity>
<activity
android:name=".AstronomyyActivity"
android:label="#string/title_activity_astronomyy"
android:theme="#android:style/Theme.NoTitleBar" >
</activity>
<activity
android:name=".FashionActivity"
android:label="#string/title_activity_fashion"
android:theme="#android:style/Theme.NoTitleBar" >
</activity>
<activity
android:name=".PhotographyActivity"
android:label="#string/title_activity_photography"
android:theme="#android:style/Theme.NoTitleBar" >
</activity>
<activity
android:name=".VideoActivity"
android:label="#string/title_activity_video"
android:theme="#android:style/Theme.NoTitleBar" >
</activity>
<activity
android:name=".EnglishActivity"
android:label="#string/title_activity_english"
android:theme="#android:style/Theme.NoTitleBar" >
</activity>
<activity
android:name=".ChessActivity"
android:label="#string/title_activity_chess"
android:theme="#android:style/Theme.NoTitleBar" >
</activity>
<activity
android:name=".BudActivity"
android:label="#string/title_activity_bud"
android:theme="#android:style/Theme.NoTitleBar" >
</activity>
<activity
android:name=".FirstaidActivity"
android:label="#string/title_activity_firstaid"
android:theme="#android:style/Theme.NoTitleBar" >
</activity>
<activity
android:name=".AboutUs"
android:label="#string/title_activity_about_us"
android:theme="#android:style/Theme.NoTitleBar" >
</activity>
</application>
</manifest>
Here is the Styles.xml inside the values folder
<!--
Base application theme, dependent on API level. This theme is replaced
by AppBaseTheme from res/values-vXX/styles.xml on newer devices.
-->
<style name="AppBaseTheme" parent="Theme.AppCompat.Light">
<!--
Theme customizations available in newer API levels can go in
res/values-vXX/styles.xml, while customizations related to
backward-compatibility can go here.
-->
</style>
<!-- Application theme. -->
<style name="AppTheme" parent="AppBaseTheme">
<!-- All customizations that are NOT specific to a particular API-level can go here. -->
</style>
You have set android:theme="#android:style/Theme.NoTitleBar" in your activities and that style will give you Holo Dark theme.
You have to replace that with
android:theme="#android:style/Theme.Light.NoTitleBar"

Setting Wrong Application Name

I have my application named Umall but it is replaced by Slash that is my First Activity i am stuck with that small problem don't know how to handle it.. i gave application name directly in application lable
My Manifest.XML is
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.ef.umall"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="15"
android:targetSdkVersion="19" />
<uses-permission android:name="android.permission.INTERNET" />
<application
android:allowBackup="true"
android:icon="#drawable/app_logo"
android:label="Umall"
android:theme="#style/AppTheme" >
<activity
android:name=".MainActivity"
android:label="" >
</activity>
<activity
android:name=".activity.SplashActivity_"
android:label="#string/title_activity_splash" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name=".activity.HomeActivity"
android:label="#string/title_activity_home" >
</activity>
<activity
android:name=".activity.ProductsListActivity_"
android:label="#string/title_activity_products_list" >
</activity>
<activity
android:name=".activity.ProductDetail_"
android:label="#string/title_activity_product_detail" >
</activity>
<activity
android:name=".activity.CartActivity_"
android:label="#string/title_activity_cart" >
</activity>
<activity
android:name=".activity.ProductActivity_"
android:label="#string/title_activity_product" >
</activity>
<activity
android:name=".activity.UmallBaseActivity_"
android:label="#string/title_activity_umall_base" >
</activity>
<activity
android:name=".activity.ShopingChart"
android:label="#string/title_activity_shoping_chart" >
</activity>
</application>
</manifest>
Try to define the application name in your string.xml file and then replace this line :
<application
android:allowBackup="true"
android:icon="#drawable/app_logo"
android:label="#string/appname"
android:theme="#style/AppTheme" >
Where "appname" is a string in string.xml like :
<string name="appname">Umall</string>
can have a label attribute. If it's absent the label is inherited from the parent component (either Activity or Application). So using this, you can set a label for the launcher icon, while still having the Activity with it's own title.
so change this
<activity
android:name=".activity.SplashActivity_"
android:label="#string/title_activity_splash" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
to this
<activity
android:name=".activity.SplashActivity_"
android:label="#string/title_activity_splash" >
<intent-filter android:label="Umall">
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
better to use #string/app_name
more info here

Categories