I had a warning Exported receiver does not require permission in my AndroidManifest.xml about this receiver :
<receiver android:name="org.thieftracker.SmsReceiver" android:enabled="true">
<intent-filter>
<action android:name="android.provider.Telephony.SMS_RECEIVED" />
<action android:name="android.intent.action.ACTION_BATTERY_LOW"/>
<action android:name="android.intent.action.ACTION_BATTERY_OKAY"/>
</intent-filter>
</receiver>
I understand the problem, I fix it by changing first line with :
<receiver android:name="org.thieftracker.SmsReceiver" android:enabled="true" android:exported="false">
But it crashes on debug launch.
I roll back by removing the android:exported="false"
but it still crashes on : ActivityThread.handleBindApplication(ActivityThread$AppBindData) line: 4070
I tried to clean the project, it still crashes.
My only solution it to delete my whole workspace and copy back a backup !
I guess it comes from the Eclipse IDE.
Any idea ?
UPDATE :
Found it !
I forgot to put a permission in my AndroidManifest (WAKE_LOCK).
I still don't understand why it used to work when the permission was missing. I guess it comes from some cache/update stuff over AndroidManifest.xml
I also lost a lot of time because I did not know how to use LogCat and DDMS view. About that, I still don't know where to find the stack trace !
I put back the bug, and I am still fighting with IDE to find again the stack trace with the magic
java.lang.RuntimeException: Unable to create application org.thieftracker.ThiefTracker: java.lang.SecurityException: Neither user 10029 nor current process has android.permission.WAKE_LOCK
Where the hell did I get it ?!
I am not sure try this:<receiver android:name="org.thieftracker.SmsReceiver" android:enabled="true" android:exported="false">
Related
I have just got rejection of my app update with the message below.
Your app(s) are vulnerable to Intent Redirection.
com.facebook.CustomTabMainActivity->onCreate
i am using a facebook login in the app and it uses activity as below defined. Simple solution could be to set exported="false" but even my build is not working I get a build error " error MSB6006: "java.exe" exited with code 1."
I am using xamarin. I am not sure if that is related to it but i guess not.
<activity android:name="com.facebook.CustomTabMainActivity" android:exported="true" />
<activity android:name="com.facebook.CustomTabActivity" android:exported="true">
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data android:scheme="#string/fb_login_protocol_scheme" />
</intent-filter>
</activity>
If i understand correctly, exported=false also not a good solution i need data from another app. In this case if user has facebook app installed and login details should be delivered from the facebook app, exported=false makes the activity private and cannot receive the data.
So what could be the possible solution here?
You have a duplicate, the first line is not necessary.
<activity android:name="com.facebook.CustomTabMainActivity" android:exported="true" />
Only use the rest and the sign in works.
I have found the problem with diagnostic build. I have Android library in the project which has also Manifest file. Indeed my Manifest in the Android library project didnt have anything within the application tags as shown below.
<application />
But somehow setting goes double with once true and other with false. Not sure why but within the logs I have found out that was message like "at the line xx android:exported="false" and other line yy android:exported="true" use tools:replace.
This seems to be caused by Manifest merger and simply setting as below solved the error and now it builds fine and works as well.
<activity android:name="com.facebook.CustomTabActivity"
tools:replace="android:exported" android:exported="false">
I hope that it helps in case anyone come across with the same issue
Error running 'app': The activity 'MainActivity' is not declared in AndroidManifest.xml
I've been getting this error code about 12 hours ago and trying to fix the problem. It seems to be related to package or activity on the codes: so here's what I've come up with
<activity android:name="com.dot.forklift.MainActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
Sync grandle and invalidated caches didn't work out for this matter; also, clean project didn't do much for this.
Even after those, the program is neither able to detect the activity nor to run properly. Keep sending the exact same error code as above.
I don't know where to research anymore and hard stuck on this same problem, please help me out.
I cleared all the bugs... Recently before running this app it was showing "No default activity found" I changed configuration to "Nothing" & also added Android Manifest.xml file.
After successful build, Emulator shows app in settings>>app management.
But,
There is nothing in Apps Menu. Even I tried manually installing this app in my device. But it says "App Not Installed"
Share your experience. Help me out. Thank you.
Please include all manifest functions into this code, if I am missing something. This app is cloud storage app.
This is my manifest file :
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
>
<application
android:allowBackup="true"
android:icon="#mipmap/ic_launcher"
android:label="#string/app_name"
android:supportsRtl="true"
android:theme="#style/AppTheme">
<activity
android:name=".activities.MainActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>```
Sometimes android studio has quircks and bugs.
In this case when it complains of activity not found even though you know it's there do the following:
clean build - see if it works
remove cable of device reattach cable of device - see if it works
restart android studio - see if it works
invalidate caches and restart - see if it works
if none of the above work, that means you have some place in that activity that in theory compiles, in practice there is a problem with it.
Add this in your activity tag
<category android:name="android.intent.category.DEFAULT" />
I've just started having this issue today on a project that has been working for months, without changing the manifest at all I get this error when trying to run the app. My main activity is defined in the manifest as:
<activity
android:name=".MenuActivity"
android:screenOrientation="portrait">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
I've tried all of the solutions I've found from previous questions to unfortunately no effect.
The weirdest part of this is if I hit "sync project with gradle files" 5-10 times one right after the other, it will start working for a few runs and then i'll need to repeat to fix the problem again. Anyone experienced this?
You can edit your configuration as below Edit Configurations:
Then select your Default Activity as below Launch Options:
I have my Emulator open, and using Command Prompt I remove my application. I didn't closed the Emulator.
Then I go to Eclipse and hit Debug, but doesn't deploy the apk to the emulator, just tells me the package not yet registered with the system.
New package not yet registered with the system. Waiting 3 seconds before next attempt.
Restarting the emulator is not an option, as that takes 10-15 minutes.
What I am doing wrong?
I have encountered this occasionally. Doing a clean project before rebuilding and redeploying seems to do the trick.
This is eclipse (the point is eclipse can not run your app because can not start the right intent because can not find the right package) and one of the workaround of this is to rename your package in the manifest for example rename
package="com.hernblog.GreenThumbs"
to
package="com.hernblog.GreenThumbs1"
compile and build this, then put it back to the name you wanted
package="com.hernblog.GreenThumbs"
works as a charm :)
Clean and re-build may not help.
So, in that case remove the app from your device.
Then re-run your project on your device. That will help.
After trying many different solutions for this problem, I found that the line
<application android:debuggable="true" />
in my AndroidManifest was causing this problem.
Removing this line fixed it for me.
Note: You can still build with debugging mode without this line by using the ndk-build option NDK_DEBUG=1
im also having same problem.
I just commit my src,res folder in svn.
Then i check out new project from svn then it will works correctly.
Also check your "Enabled" option in manifest! Mine turned to off, somehow ..
I have also had this problem.
For me it was the fact that my launcher activity (the one with the Launch intent) did not have the "android:label" attribute
WRONG!!!
<application
android:icon="#drawable/icon"
android:label="#string/app_name">
<activity
android:name=".ui.SplashScreenActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name=".ui.DashboardActivity"
android:label="#string/app_name">
</activity>
<activity android:name=".ui.LogListActivity"></activity>
</application>
RIGHT - Note the SplashScreenActivity
<application
android:icon="#drawable/icon"
android:label="#string/app_name">
<activity
android:name=".ui.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=".ui.DashboardActivity"
android:label="#string/app_name">
</activity>
<activity android:name=".ui.LogListActivity"></activity>
</application>