3

For the past 2 months, I went back on forth with from Eclipse to Android Studio and the other way around to try and fix this error.

So, while I test it on a Motorola E 4G LTE, the error won't show up.

But when I test it on my Samsung Galaxy S3, the error shows up no matter what.

My application is a test application, which has every functionality in the MainActivity. I will link the main activity and the error which I get in LogCat. If any other information is needed, let me know.

MainActivity:

public class MainActivity extends Activity {

    TextView tv;
    Button btn;
    LinearLayout ll;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);

        ll = (LinearLayout) findViewById(R.id.ll);

        tv = new TextView(this);
        btn = new Button(this);
        btn.setText("Press here");
        btn.setVisibility(View.VISIBLE);



        ll.addView(btn);

    }

    @Override
    protected void onStart() {
        super.onStart();

        btn.setOnClickListener(new View.OnClickListener(){
            @Override
            public void onClick(View v) {

                tv.setText("works");
                tv.setVisibility(View.VISIBLE);

                ll.addView(tv);

            }
        });

    }
}

LogCat error:

07-17 21:25:12.909: E/DatabaseUtils(2344): Writing exception to parcel
07-17 21:25:12.909: E/DatabaseUtils(2344): java.lang.SecurityException: Permission Denial: get/set setting for user asks to run as user -2 but is calling from user 0; this requires android.permission.INTERACT_ACROSS_USERS_FULL
07-17 21:25:12.909: E/DatabaseUtils(2344):  at com.android.server.am.ActivityManagerService.handleIncomingUser(ActivityManagerService.java:13140)
07-17 21:25:12.909: E/DatabaseUtils(2344):  at android.app.ActivityManager.handleIncomingUser(ActivityManager.java:2038)
07-17 21:25:12.909: E/DatabaseUtils(2344):  at com.android.providers.settings.SettingsProvider.callFromPackage(SettingsProvider.java:607)
07-17 21:25:12.909: E/DatabaseUtils(2344):  at android.content.ContentProvider$Transport.call(ContentProvider.java:279)
07-17 21:25:12.909: E/DatabaseUtils(2344):  at android.content.ContentProviderNative.onTransact(ContentProviderNative.java:273)
07-17 21:25:12.909: E/DatabaseUtils(2344):  at android.os.Binder.execTransact(Binder.java:388)
07-17 21:25:12.909: E/DatabaseUtils(2344):  at dalvik.system.NativeStart.run(Native Method)

IMPORTANT: The error occurs when I press the button.But it works, the app does not crash, although, the error is there. Also, I firstly got this error in the application I am developing when I was trying to make an UDP connection.After that, every touch or click was triggering the error in the project...

Any suggestions besides what you can find with an obvious google search and by reading android documentation is more than welcome...

Just for the record, I am working with Android studio.

When I try to add it,it won't show me the INTERACT_ACROSS_USERS_FULL...

Bryan Herbst
  • 66,602
  • 10
  • 133
  • 120
Vlad
  • 910
  • 1
  • 10
  • 18
  • 2
    did you try adding that permission in your manifest? – tyczj Jul 17 '15 at 18:33
  • I did and a friend suggested two ways to add the permission...no one of those worked.Can you please write the exact permission here?Maybe I added it in a faulty way,but I doubt so. – Vlad Jul 17 '15 at 18:35
  • I am willing to try anything though...it's getting on my nerves big time... – Vlad Jul 17 '15 at 18:36
  • you add the permission just like you would any other permission, show your manifest with the permission in it – tyczj Jul 17 '15 at 18:38
  • Check the edit ,sir. – Vlad Jul 17 '15 at 18:44
  • just because android studio does not recognize the permission does not mean you cant put it in. Copy the permission from the error and paste it in there – tyczj Jul 17 '15 at 18:47
  • Let us [continue this discussion in chat](http://chat.stackoverflow.com/rooms/83577/discussion-between-vlad-and-tyczj). – Vlad Jul 17 '15 at 18:47
  • 1
    First, note that a runtime issue like this has nothing to do with your IDE (Eclipse or Android Studio), so switching between the two will not help. Second, there's another [StackOverflow post here](http://stackoverflow.com/questions/21456233/crash-before-app-starts-securityexception-permission-denial-interact-across) with the same issue, but no resolution yet. It appears to be a bug with that specific device, or with certain ROMs on that device. – Bryan Herbst Jul 17 '15 at 18:50
  • @Tanis.7x according to this answer it is a signature level permission http://stackoverflow.com/questions/19756727/what-do-i-do-about-this-requires-android-permission-interact-across-users-full/19756762#19756762 – tyczj Jul 17 '15 at 18:52
  • 1
    It is. But the issue seems to be that the device is requiring the permission in places where it shouldn't be required. – Bryan Herbst Jul 17 '15 at 18:53
  • Why am I never surprised when questions like this (i.e., "It works on one device and not another"?) invariably involve problems with Samsung devices? – Squonk Jul 17 '15 at 19:34
  • Are they known for that...? – Vlad Jul 17 '15 at 19:49
  • @Vlad : Samsung are known for 'bending' the guidelines of the AOSP to their own advantage to the point that it seems a number of their devices behave unexpectedly with apps which work fine on other manufacturers' devices. The AOSP is exactly what it's meant to be...Open Source...and can be used and adapted by anybody - Samsung, however, seem to have repeatedly modified things in a non-standard way. Just search Stack Overflow for Android questions with Samsung in them - there are quite a few related to their devices behaving differently to other manufacturer's devices. – Squonk Jul 17 '15 at 21:53
  • God damn it,lost so much time, thinking it is a real error...that's really dumb.Thanks for the info btw... – Vlad Jul 17 '15 at 22:31

1 Answers1

0

So...for those who had the same problem, the answer is nothing like what I expected, but it seems to be the right answer.

It looks like my Samsung Galaxy S3 is at fault for the error right now.

Tested both the application I work on and the test application on my Samsung and on my Motorola.The Motorola doesn't trigger any error, while the Samsung does.

The only problem is that before I make a fresh reinstall of the AS ,the Motorola was getting the same error.

I will consider this as the right answer at this moment, but if things change and I encounter the problem again,I will be back with fresh information.

Thank you for the help ,to those who replied.

Vlad
  • 910
  • 1
  • 10
  • 18