I just updated android studio 1.3 to 1.5(1.5 downloaded from stable channel) and now created new project it is compiling fine but not deploying on the device and emulator.Here is the log cat image
You must declare your activity in the manifest file in order for it to be accessible to the system. To declare your activity, open your manifest file and add an <activity> element as a child of the <application> element.
<manifest ... >
<application ... >
<activity android:name=".ExampleActivity" />
...
</application ... >
...
</manifest >
When you create a new application using the Android SDK tools, the stub activity that's created for you automatically includes an intent filter that declares the activity responds to the "main" action and should be placed in the "launcher" category.
<activity android:name=".ExampleActivity" android:icon="#drawable/app_icon">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
Related
I need to have some native Android codes and configs in my Flutter project, for example in AndroidManifest.xml file. But attributes of the tags that I add are unknown (red colored) and not working, specifically <receiver> and <intent-filter> tags that I use here.
I also need to address some native java files located in a Flutter library and I don't know how to that too!
Following are my manifest image in my IDE and its code:
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.flutterapp">
<!-- The INTERNET permission is required for development. Specifically,
flutter needs it to communicate with the running application
to allow setting breakpoints, to provide hot reload, etc.
-->
<!-- io.flutter.app.FlutterApplication is an android.app.Application that
calls FlutterMain.startInitialization(this); in its onCreate method.
In most cases you can leave this as-is, but you if you want to provide
additional functionality it is fine to subclass or reimplement
FlutterApplication and put your custom class here. -->
<application
android:name="io.flutter.app.FlutterApplication"
android:label="my app"
android:allowBackup="false"
android:fullBackupContent="false"
android:icon="#mipmap/ic_launcher">
<activity android:name=".MainActivity"
android:launchMode="singleTop"
android:theme="#android:style/Theme.Black.NoTitleBar"
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|locale|layoutDirection"
android:hardwareAccelerated="true"
android:windowSoftInputMode="adjustResize">
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
</intent-filter>
</activity>
<receiver android:name = ".SmsReceiver" android:permission="android.permission.BROADCAST_SMS">
<intent-filter android:priority="999" >
<action android:name="android.intent.action.SMS_RECEIVED" />
<action android:name="android.provider.Telephony.SMS_DELIVER" />
<data
android:scheme="sms"
android:host="*"
android:port="1235" />
</intent-filter>
</receiver>
</application>
</manifest>
Flutter editor in Android Studio doesn't have proper lint check for Android project code. To access the Android project with proper lint check, it's better to open it via Tools > Flutter > Open Android module in Android Studio
I have been looking into building a app to replace the homescreen on android, I need to know how to add the option to add app shortcut to my app.
In your app's manifest file (AndroidManifest.xml), find an activity whose intent filters are set to the android.intent.action.MAIN action and the android.intent.category.LAUNCHER category.
Add a <meta-data> element to this activity that references the resource file where the app's shortcuts are defined:
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.myapplication">
<application ... >
<activity android:name="Main">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
<meta-data android:name="android.app.shortcuts"
android:resource="#xml/shortcuts" />
</activity>
</application>
</manifest>
You can find the rest here - https://developer.android.com/guide/topics/ui/shortcuts.html
Hope this helps!
I have Just Upgraded My Android Studio and when i am running my old project it gives me error when launching the theme to device
16:45:30 Session 'theme': Error Launching activity
Could not identify launch activity: Default Activity not found
Error while Launching activity
here is my manifest
<?xml version="1.0" encoding="utf-8" standalone="no"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"package="com.nitinvaid.theme.neoncolorsl" platformBuildVersionCode="23" platformBuildVersionName="6.0-2438415">
<meta-data android:name="org.cyanogenmod.theme.name" android:value="#string/theme_name"/>
<meta-data android:name="org.cyanogenmod.theme.author" android:value="#string/theme_author"/>
<application android:hasCode="false" android:icon="#drawable/ic_launcher" android:label="#string/theme_name">
</application>
</manifest>
May be for some reasons, your default activity removed from your manifest, add it as the following:
<activity
android:name=".YourActivity"
android:label="#string/app_name">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
Okay SO it looks like If You are Building Themes For CM13 then the new android studio will always gives you error as the themes dont have activity in it so its just the error you should ignore it or what you can do is
Just change the run configuration of android studio for a theme app. Instead of default activity, change it to no activity.
Hi i've added the AndroidAnnotations and configured it; it generates the activity with the underscore _ as suffix, but when I try to lunch the app, it gives this error
05-26 04:17:23.524: E/AndroidRuntime(5096): java.lang.RuntimeException:
Unable to instantiate activity
ComponentInfo{android_app.candgo/android_app.candgo.HelloAndroidActivity_}:
java.lang.ClassNotFoundException: Didn't find class
"android_app.candgo.HelloAndroidActivity_"
on path: /data/app/android_app.candgo-1.apk
Any suggestion about why it doesn't work
PD: I've ADT v22
PD: I've the HelloAndroidActivity_ registered at manifest
This is my manifest.xml (sorry for the delay)
<uses-sdk android:minSdkVersion="8"
android:targetSdkVersion="16" />
<application android:icon="#drawable/icon" android:label="#string/app_name">
<activity android:name="MainActivity_">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>
You need to add the ".apt_generated", or whichever folder AA outputs to, to your source directories listing. In Android Studio, you can find this in Project Settings -> Modules -> module_in_question -> Sources
Check your manifest file for a entry of the activity. Check the name.
If you updated ADT to rev 22. you can try this java.lang.ClassNotFoundException after changing nothing in the project but upgrading eclipse android sdk.
Check the package name in manifest
<manifest package="com.example.mypackaganame" //check the name
Check under application tag for the activity entry
<activity
android:name="com.example.mypackaganame.MainActivity"
// this is the main activity
android:label="#string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
Say you have second Activity. This how you declare for implicit intents
<activity
android:name="com.example.mypackaganame.SecondActivity"
// this is the Second activity
android:label="#string/app_name" >
<intent-filter>
<action android:name="com.example.mypackaganame.SecondActivity" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
Foe explicit intents
<activity
android:name=".SecondActivity"
// this is the Second activity
android:label="#string/app_name" >
</activity>
you need to register the activity class(AndroidAnnotations) in your manifest.xml,like:
<activity android:name = "com.your.packageName" android:screenOrientation="portrait" android:configChanges = "orientation"/>
then you can use it.
If you are using Eclipse follow these steps :
Step 1.
Go to Java Compiler and make sure that Compiler compliance level is set to 1.6, otherwise the processor won't be activated
Step 2.
Go to Java Compiler > Annotation Processing and choose Enable annotation processing
step 3.
Go to Java Compiler > Annotation Processing > Factory Path and add the processor JAR : androidannotations-X.X.X.jar.
step 4
Confirm the workspace rebuild
I am running tab based application in android.When i try to install the application on the emulator it gives output in the console as
[2011-03-08 12:40:35 - TabBar] Application already deployed. No need to reinstall.
[2011-03-08 12:40:35 - TabBar] \TabBar\bin\TabBar.apk installed on device
[2011-03-08 12:40:35 - TabBar] Done!
Can anyone tell how should i pursue
Thanks in advance
Tushar
I'm also tackled with this same problem and finally I found the solution for it. When you creating a new android project using Eclipes and if you didn't create a activity for your first window, your project's Manifest also don't create proper codings for you to application launch up.
So, you should hardcode them yourself.
First check these codes are available or not in your Project's Manifest file, within your main activity tags.
**
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
**
These two code lines are very important. Because these two lines are calling to android OS to launch this app.
So, Make sure these codes are available in your project's Manifest file. If it's not this below Manifest file code will gets you rough idea to fix this problem.
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.mershanfernando.testingappz"
android:versionCode="1"
android:versionName="1.0">
<uses-sdk android:minSdkVersion="10" />
<application android:icon="#drawable/ic_launcher" android:label="#string/app_name">
<activity android:name=".Main"
android:label="#string/app_name">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>