Can't use date and time picker library












0














I'm getting a gradle error when trying to add a dependency. I'm trying to use Wdullaer's library, but getting an error message:




Manifest merger failed : uses-sdk:minSdkVersion 15 cannot be smaller than version 16 declared in library [com.wdullaer:materialdatetimepicker:4.0.1] /home/jonathon/.gradle/caches/transforms-1/files-1.1/materialdatetimepicker-4.0.1.aar/e6a687a3cda7a3733aea1e4617c99341/AndroidManifest.xml as the library might be using APIs not available in 15
Suggestion: use a compatible library with a minSdk of at most 15,
or increase this project's minSdk version to at least 16,
or use tools:overrideLibrary="com.wdullaer.materialdatetimepicker" to force usage (may lead to runtime failures)




I've tried to change the minSdkVerison, but still getting some kind of error.



Gradle file:



dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:appcompat-v7:27.1.1'
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
debugCompile 'com.amitshekhar.android:debug-db:1.0.0'
implementation 'com.android.support:recyclerview-v7:27.1.1'
implementation 'org.ocpsoft.prettytime:prettytime:4.0.1.Final'
compile 'com.wdullaer:materialdatetimepicker:4.0.1'


}



https://github.com/wdullaer/MaterialDateTimePicker



If it's impossible to use for any reason, does anyone have any suggestions for a date and time picker library or some kind? Thanks.










share|improve this question


















  • 1




    When you say "I've tried to change the minSdkVerison, but still getting some kind of error.", what is that new error?
    – TWL
    Nov 12 '18 at 22:42
















0














I'm getting a gradle error when trying to add a dependency. I'm trying to use Wdullaer's library, but getting an error message:




Manifest merger failed : uses-sdk:minSdkVersion 15 cannot be smaller than version 16 declared in library [com.wdullaer:materialdatetimepicker:4.0.1] /home/jonathon/.gradle/caches/transforms-1/files-1.1/materialdatetimepicker-4.0.1.aar/e6a687a3cda7a3733aea1e4617c99341/AndroidManifest.xml as the library might be using APIs not available in 15
Suggestion: use a compatible library with a minSdk of at most 15,
or increase this project's minSdk version to at least 16,
or use tools:overrideLibrary="com.wdullaer.materialdatetimepicker" to force usage (may lead to runtime failures)




I've tried to change the minSdkVerison, but still getting some kind of error.



Gradle file:



dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:appcompat-v7:27.1.1'
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
debugCompile 'com.amitshekhar.android:debug-db:1.0.0'
implementation 'com.android.support:recyclerview-v7:27.1.1'
implementation 'org.ocpsoft.prettytime:prettytime:4.0.1.Final'
compile 'com.wdullaer:materialdatetimepicker:4.0.1'


}



https://github.com/wdullaer/MaterialDateTimePicker



If it's impossible to use for any reason, does anyone have any suggestions for a date and time picker library or some kind? Thanks.










share|improve this question


















  • 1




    When you say "I've tried to change the minSdkVerison, but still getting some kind of error.", what is that new error?
    – TWL
    Nov 12 '18 at 22:42














0












0








0







I'm getting a gradle error when trying to add a dependency. I'm trying to use Wdullaer's library, but getting an error message:




Manifest merger failed : uses-sdk:minSdkVersion 15 cannot be smaller than version 16 declared in library [com.wdullaer:materialdatetimepicker:4.0.1] /home/jonathon/.gradle/caches/transforms-1/files-1.1/materialdatetimepicker-4.0.1.aar/e6a687a3cda7a3733aea1e4617c99341/AndroidManifest.xml as the library might be using APIs not available in 15
Suggestion: use a compatible library with a minSdk of at most 15,
or increase this project's minSdk version to at least 16,
or use tools:overrideLibrary="com.wdullaer.materialdatetimepicker" to force usage (may lead to runtime failures)




I've tried to change the minSdkVerison, but still getting some kind of error.



Gradle file:



dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:appcompat-v7:27.1.1'
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
debugCompile 'com.amitshekhar.android:debug-db:1.0.0'
implementation 'com.android.support:recyclerview-v7:27.1.1'
implementation 'org.ocpsoft.prettytime:prettytime:4.0.1.Final'
compile 'com.wdullaer:materialdatetimepicker:4.0.1'


}



https://github.com/wdullaer/MaterialDateTimePicker



If it's impossible to use for any reason, does anyone have any suggestions for a date and time picker library or some kind? Thanks.










share|improve this question













I'm getting a gradle error when trying to add a dependency. I'm trying to use Wdullaer's library, but getting an error message:




Manifest merger failed : uses-sdk:minSdkVersion 15 cannot be smaller than version 16 declared in library [com.wdullaer:materialdatetimepicker:4.0.1] /home/jonathon/.gradle/caches/transforms-1/files-1.1/materialdatetimepicker-4.0.1.aar/e6a687a3cda7a3733aea1e4617c99341/AndroidManifest.xml as the library might be using APIs not available in 15
Suggestion: use a compatible library with a minSdk of at most 15,
or increase this project's minSdk version to at least 16,
or use tools:overrideLibrary="com.wdullaer.materialdatetimepicker" to force usage (may lead to runtime failures)




I've tried to change the minSdkVerison, but still getting some kind of error.



Gradle file:



dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:appcompat-v7:27.1.1'
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
debugCompile 'com.amitshekhar.android:debug-db:1.0.0'
implementation 'com.android.support:recyclerview-v7:27.1.1'
implementation 'org.ocpsoft.prettytime:prettytime:4.0.1.Final'
compile 'com.wdullaer:materialdatetimepicker:4.0.1'


}



https://github.com/wdullaer/MaterialDateTimePicker



If it's impossible to use for any reason, does anyone have any suggestions for a date and time picker library or some kind? Thanks.







android gradle






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Nov 12 '18 at 22:33









Jonathon

357




357








  • 1




    When you say "I've tried to change the minSdkVerison, but still getting some kind of error.", what is that new error?
    – TWL
    Nov 12 '18 at 22:42














  • 1




    When you say "I've tried to change the minSdkVerison, but still getting some kind of error.", what is that new error?
    – TWL
    Nov 12 '18 at 22:42








1




1




When you say "I've tried to change the minSdkVerison, but still getting some kind of error.", what is that new error?
– TWL
Nov 12 '18 at 22:42




When you say "I've tried to change the minSdkVerison, but still getting some kind of error.", what is that new error?
– TWL
Nov 12 '18 at 22:42












1 Answer
1






active

oldest

votes


















0














use this date picker method for better performance.. its also suppored in min device.hope it will be useful to you.



  private void datePicker(){

// Get Current Date
final Calendar c = Calendar.getInstance();
final int mYear = c.get(Calendar.YEAR);
final int mMonth = c.get(Calendar.MONTH);
final int mDay = c.get(Calendar.DAY_OF_MONTH);


//get day Name
SimpleDateFormat sdfday = new SimpleDateFormat("EEEE");
Date d_name = new Date(mYear-1900,mMonth,mDay);
final String dayOfTheWeek = sdfday.format(d_name);

final DatePickerDialog datePickerDialog = new DatePickerDialog(this,R.style.picker1,
new DatePickerDialog.OnDateSetListener() {


@Override
public void onDateSet(DatePicker view, int year,int monthOfYear, int dayOfMonth) {



//get calendar format
SimpleDateFormat sdf = new SimpleDateFormat("MM-dd-yyyy");
final String formatedDate = sdf.format(new Date(year-1900, monthOfYear, dayOfMonth));

date_time = formatedDate;

//*************Call Time Picker Here ********************

}
}, mYear, mMonth, mDay);

datePickerDialog.getDatePicker().setMinDate(c.getTimeInMillis());
datePickerDialog.show();
}



private void timePicker(){
// Get Current Time
final Calendar c = Calendar.getInstance();
final int mHour = c.get(Calendar.HOUR_OF_DAY);
final int mMinute = c.get(Calendar.MINUTE);


// Launch Time Picker Dialog
TimePickerDialog timePickerDialog = new TimePickerDialog(this,R.style.picker1,
new TimePickerDialog.OnTimeSetListener() {



@Override
public void onTimeSet(TimePicker view, int hourOfDay,int minute) {


DateInput.setText(date_time+" "+String.format("%02d:%02d", hourOfDay, minute));

Log.d("datenew",date_time + hourOfDay+":"+minute);
}
}, mHour, mMinute, false);
timePickerDialog.show();
}





share|improve this answer





















    Your Answer






    StackExchange.ifUsing("editor", function () {
    StackExchange.using("externalEditor", function () {
    StackExchange.using("snippets", function () {
    StackExchange.snippets.init();
    });
    });
    }, "code-snippets");

    StackExchange.ready(function() {
    var channelOptions = {
    tags: "".split(" "),
    id: "1"
    };
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function() {
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled) {
    StackExchange.using("snippets", function() {
    createEditor();
    });
    }
    else {
    createEditor();
    }
    });

    function createEditor() {
    StackExchange.prepareEditor({
    heartbeatType: 'answer',
    autoActivateHeartbeat: false,
    convertImagesToLinks: true,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: 10,
    bindNavPrevention: true,
    postfix: "",
    imageUploader: {
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    },
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    });


    }
    });














    draft saved

    draft discarded


















    StackExchange.ready(
    function () {
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53271063%2fcant-use-date-and-time-picker-library%23new-answer', 'question_page');
    }
    );

    Post as a guest















    Required, but never shown

























    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    0














    use this date picker method for better performance.. its also suppored in min device.hope it will be useful to you.



      private void datePicker(){

    // Get Current Date
    final Calendar c = Calendar.getInstance();
    final int mYear = c.get(Calendar.YEAR);
    final int mMonth = c.get(Calendar.MONTH);
    final int mDay = c.get(Calendar.DAY_OF_MONTH);


    //get day Name
    SimpleDateFormat sdfday = new SimpleDateFormat("EEEE");
    Date d_name = new Date(mYear-1900,mMonth,mDay);
    final String dayOfTheWeek = sdfday.format(d_name);

    final DatePickerDialog datePickerDialog = new DatePickerDialog(this,R.style.picker1,
    new DatePickerDialog.OnDateSetListener() {


    @Override
    public void onDateSet(DatePicker view, int year,int monthOfYear, int dayOfMonth) {



    //get calendar format
    SimpleDateFormat sdf = new SimpleDateFormat("MM-dd-yyyy");
    final String formatedDate = sdf.format(new Date(year-1900, monthOfYear, dayOfMonth));

    date_time = formatedDate;

    //*************Call Time Picker Here ********************

    }
    }, mYear, mMonth, mDay);

    datePickerDialog.getDatePicker().setMinDate(c.getTimeInMillis());
    datePickerDialog.show();
    }



    private void timePicker(){
    // Get Current Time
    final Calendar c = Calendar.getInstance();
    final int mHour = c.get(Calendar.HOUR_OF_DAY);
    final int mMinute = c.get(Calendar.MINUTE);


    // Launch Time Picker Dialog
    TimePickerDialog timePickerDialog = new TimePickerDialog(this,R.style.picker1,
    new TimePickerDialog.OnTimeSetListener() {



    @Override
    public void onTimeSet(TimePicker view, int hourOfDay,int minute) {


    DateInput.setText(date_time+" "+String.format("%02d:%02d", hourOfDay, minute));

    Log.d("datenew",date_time + hourOfDay+":"+minute);
    }
    }, mHour, mMinute, false);
    timePickerDialog.show();
    }





    share|improve this answer


























      0














      use this date picker method for better performance.. its also suppored in min device.hope it will be useful to you.



        private void datePicker(){

      // Get Current Date
      final Calendar c = Calendar.getInstance();
      final int mYear = c.get(Calendar.YEAR);
      final int mMonth = c.get(Calendar.MONTH);
      final int mDay = c.get(Calendar.DAY_OF_MONTH);


      //get day Name
      SimpleDateFormat sdfday = new SimpleDateFormat("EEEE");
      Date d_name = new Date(mYear-1900,mMonth,mDay);
      final String dayOfTheWeek = sdfday.format(d_name);

      final DatePickerDialog datePickerDialog = new DatePickerDialog(this,R.style.picker1,
      new DatePickerDialog.OnDateSetListener() {


      @Override
      public void onDateSet(DatePicker view, int year,int monthOfYear, int dayOfMonth) {



      //get calendar format
      SimpleDateFormat sdf = new SimpleDateFormat("MM-dd-yyyy");
      final String formatedDate = sdf.format(new Date(year-1900, monthOfYear, dayOfMonth));

      date_time = formatedDate;

      //*************Call Time Picker Here ********************

      }
      }, mYear, mMonth, mDay);

      datePickerDialog.getDatePicker().setMinDate(c.getTimeInMillis());
      datePickerDialog.show();
      }



      private void timePicker(){
      // Get Current Time
      final Calendar c = Calendar.getInstance();
      final int mHour = c.get(Calendar.HOUR_OF_DAY);
      final int mMinute = c.get(Calendar.MINUTE);


      // Launch Time Picker Dialog
      TimePickerDialog timePickerDialog = new TimePickerDialog(this,R.style.picker1,
      new TimePickerDialog.OnTimeSetListener() {



      @Override
      public void onTimeSet(TimePicker view, int hourOfDay,int minute) {


      DateInput.setText(date_time+" "+String.format("%02d:%02d", hourOfDay, minute));

      Log.d("datenew",date_time + hourOfDay+":"+minute);
      }
      }, mHour, mMinute, false);
      timePickerDialog.show();
      }





      share|improve this answer
























        0












        0








        0






        use this date picker method for better performance.. its also suppored in min device.hope it will be useful to you.



          private void datePicker(){

        // Get Current Date
        final Calendar c = Calendar.getInstance();
        final int mYear = c.get(Calendar.YEAR);
        final int mMonth = c.get(Calendar.MONTH);
        final int mDay = c.get(Calendar.DAY_OF_MONTH);


        //get day Name
        SimpleDateFormat sdfday = new SimpleDateFormat("EEEE");
        Date d_name = new Date(mYear-1900,mMonth,mDay);
        final String dayOfTheWeek = sdfday.format(d_name);

        final DatePickerDialog datePickerDialog = new DatePickerDialog(this,R.style.picker1,
        new DatePickerDialog.OnDateSetListener() {


        @Override
        public void onDateSet(DatePicker view, int year,int monthOfYear, int dayOfMonth) {



        //get calendar format
        SimpleDateFormat sdf = new SimpleDateFormat("MM-dd-yyyy");
        final String formatedDate = sdf.format(new Date(year-1900, monthOfYear, dayOfMonth));

        date_time = formatedDate;

        //*************Call Time Picker Here ********************

        }
        }, mYear, mMonth, mDay);

        datePickerDialog.getDatePicker().setMinDate(c.getTimeInMillis());
        datePickerDialog.show();
        }



        private void timePicker(){
        // Get Current Time
        final Calendar c = Calendar.getInstance();
        final int mHour = c.get(Calendar.HOUR_OF_DAY);
        final int mMinute = c.get(Calendar.MINUTE);


        // Launch Time Picker Dialog
        TimePickerDialog timePickerDialog = new TimePickerDialog(this,R.style.picker1,
        new TimePickerDialog.OnTimeSetListener() {



        @Override
        public void onTimeSet(TimePicker view, int hourOfDay,int minute) {


        DateInput.setText(date_time+" "+String.format("%02d:%02d", hourOfDay, minute));

        Log.d("datenew",date_time + hourOfDay+":"+minute);
        }
        }, mHour, mMinute, false);
        timePickerDialog.show();
        }





        share|improve this answer












        use this date picker method for better performance.. its also suppored in min device.hope it will be useful to you.



          private void datePicker(){

        // Get Current Date
        final Calendar c = Calendar.getInstance();
        final int mYear = c.get(Calendar.YEAR);
        final int mMonth = c.get(Calendar.MONTH);
        final int mDay = c.get(Calendar.DAY_OF_MONTH);


        //get day Name
        SimpleDateFormat sdfday = new SimpleDateFormat("EEEE");
        Date d_name = new Date(mYear-1900,mMonth,mDay);
        final String dayOfTheWeek = sdfday.format(d_name);

        final DatePickerDialog datePickerDialog = new DatePickerDialog(this,R.style.picker1,
        new DatePickerDialog.OnDateSetListener() {


        @Override
        public void onDateSet(DatePicker view, int year,int monthOfYear, int dayOfMonth) {



        //get calendar format
        SimpleDateFormat sdf = new SimpleDateFormat("MM-dd-yyyy");
        final String formatedDate = sdf.format(new Date(year-1900, monthOfYear, dayOfMonth));

        date_time = formatedDate;

        //*************Call Time Picker Here ********************

        }
        }, mYear, mMonth, mDay);

        datePickerDialog.getDatePicker().setMinDate(c.getTimeInMillis());
        datePickerDialog.show();
        }



        private void timePicker(){
        // Get Current Time
        final Calendar c = Calendar.getInstance();
        final int mHour = c.get(Calendar.HOUR_OF_DAY);
        final int mMinute = c.get(Calendar.MINUTE);


        // Launch Time Picker Dialog
        TimePickerDialog timePickerDialog = new TimePickerDialog(this,R.style.picker1,
        new TimePickerDialog.OnTimeSetListener() {



        @Override
        public void onTimeSet(TimePicker view, int hourOfDay,int minute) {


        DateInput.setText(date_time+" "+String.format("%02d:%02d", hourOfDay, minute));

        Log.d("datenew",date_time + hourOfDay+":"+minute);
        }
        }, mHour, mMinute, false);
        timePickerDialog.show();
        }






        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Nov 13 '18 at 5:32









        Jameel Ahamed

        126




        126






























            draft saved

            draft discarded




















































            Thanks for contributing an answer to Stack Overflow!


            • Please be sure to answer the question. Provide details and share your research!

            But avoid



            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.


            To learn more, see our tips on writing great answers.





            Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


            Please pay close attention to the following guidance:


            • Please be sure to answer the question. Provide details and share your research!

            But avoid



            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.


            To learn more, see our tips on writing great answers.




            draft saved


            draft discarded














            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53271063%2fcant-use-date-and-time-picker-library%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            Popular posts from this blog

            Bressuire

            Vorschmack

            Quarantine