Кнопка onClick Создание PDF вызывает cra sh android - PullRequest
0 голосов
/ 16 февраля 2020

Я использую это git Депо Это приложение, которое позволяет захватывать или выбирать изображения из галереи и сохранять их в формате PDF.

Работает нормально, но когда я попытался интегрировать в свой модуль приложения (новый проект) и нажал на кнопку, чтобы начать действие, которое он кра sh. Я ничего не изменил, я добавил Logcat ниже

Я не уверен, связано ли это со стилем, который я использую

Есть идеи?

Примечание: я уже добавил активность в мой манифест.

MainActivity

private static final int INTENT_REQUEST_GET_IMAGES = 13;
private static final String LOG_ACTIVITY = "MainActivity";

Activity activity;
Image image;
String path, filename;

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

    Button btn = findViewById(R.id.btn);
    activity = this;

    FileUtils.folderApp();

    filename=new Date().toString();

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

            getImages();
        }
    });
}

private void getImages() {

    Config config = new Config();

    config.setToolbarTitleRes(R.string.str_bar_tool);
    //config.

    ImagePickerActivity.setConfig(config);

    Intent intent = new Intent(this, ImagePickerActivity.class);
    startActivityForResult(intent, INTENT_REQUEST_GET_IMAGES);

}

@Override
protected void onActivityResult(int requestCode, int resuleCode, Intent intent) {
    super.onActivityResult(requestCode, resuleCode, intent);

    if (requestCode == INTENT_REQUEST_GET_IMAGES && resuleCode == Activity.RESULT_OK) {

        ArrayList<Uri> image_uris = intent.getParcelableArrayListExtra(ImagePickerActivity.EXTRA_IMAGE_URIS);

        if(image_uris.size()!=0){

            ArrayList<String> tempUris = new ArrayList<>();

            for (Uri uri : image_uris) {

                tempUris.add(uri.getPath());
            }

            CallBackCreatePdf callBackCreatePdf = new CallBackCreatePdf() {
                @Override
                public void OnCallBackCreatePdf(String tPath) {

                    if(tPath!=""){

                     Toast.makeText(getBaseContext(),"Pdf Created",Toast.LENGTH_LONG).show();

                    }else{
                        Toast.makeText(getBaseContext(),"Error creating PDF",Toast.LENGTH_LONG).show();
                    }

                }
            };

            MaterialDialog.Builder builder = new MaterialDialog.Builder(activity)
                    .title("Creating PDF")
                    .content("one moment ...")
                    .cancelable(false)
                    .progress(true, 0);
            MaterialDialog dialog = builder.build();

            AsynCreatePdf asynCreatePdf = new AsynCreatePdf(activity,callBackCreatePdf,dialog,tempUris,"1",("pdf"+(new Date()).getSeconds()));

            asynCreatePdf.execute();
        }
        Log.d(LOG_ACTIVITY, "onActivityResult");
    }
}

трассировка стека

 2020-02-15 23:39:33.867 26002-26002/? E/age.capturedoc: Unknown bits set in runtime_flags: 0x8000
 2020-02-15 23:39:40.077 26002-26002/com.stage.capturedocf E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.stage.capturedocf, PID: 26002
java.lang.NoSuchMethodError: No virtual method load(Ljava/lang/String;)Lcom/bumptech/glide/DrawableTypeRequest; in class Lcom/bumptech/glide/RequestManager; or its super classes (declaration of 'com.bumptech.glide.RequestManager' appears in /data/app/com.stage.capturedocf-28QyGuuKtvjoKJnPtBbn8Q==/base.apk)
    at com.gun0912.tedpicker.GalleryFragment$ImageGalleryAdapter.getView(GalleryFragment.java:176)
    at android.widget.AbsListView.obtainView(AbsListView.java:2405)
    at android.widget.GridView.onMeasure(GridView.java:1085)
    at android.view.View.measure(View.java:24530)
    at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:6828)
    at android.widget.FrameLayout.onMeasure(FrameLayout.java:194)
    at android.view.View.measure(View.java:24530)
    at androidx.viewpager.widget.ViewPager.onMeasure(ViewPager.java:1638)
    at android.view.View.measure(View.java:24530)
    at android.widget.RelativeLayout.measureChildHorizontal(RelativeLayout.java:735)
    at android.widget.RelativeLayout.onMeasure(RelativeLayout.java:481)
    at android.view.View.measure(View.java:24530)
    at android.widget.RelativeLayout.measureChildHorizontal(RelativeLayout.java:735)
    at android.widget.RelativeLayout.onMeasure(RelativeLayout.java:481)
    at android.view.View.measure(View.java:24530)
    at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:6828)
    at android.widget.FrameLayout.onMeasure(FrameLayout.java:194)
    at androidx.appcompat.widget.ContentFrameLayout.onMeasure(ContentFrameLayout.java:143)
    at android.view.View.measure(View.java:24530)
    at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:6828)
    at android.widget.LinearLayout.measureChildBeforeLayout(LinearLayout.java:1552)
    at android.widget.LinearLayout.measureVertical(LinearLayout.java:842)
    at android.widget.LinearLayout.onMeasure(LinearLayout.java:721)
    at android.view.View.measure(View.java:24530)
    at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:6828)
    at android.widget.FrameLayout.onMeasure(FrameLayout.java:194)
    at android.view.View.measure(View.java:24530)
    at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:6828)
    at android.widget.LinearLayout.measureChildBeforeLayout(LinearLayout.java:1552)
    at android.widget.LinearLayout.measureVertical(LinearLayout.java:842)
    at android.widget.LinearLayout.onMeasure(LinearLayout.java:721)
    at android.view.View.measure(View.java:24530)
    at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:6828)
    at android.widget.FrameLayout.onMeasure(FrameLayout.java:194)
    at com.android.internal.policy.DecorView.onMeasure(DecorView.java:742)
    at android.view.View.measure(View.java:24530)
    at android.view.ViewRootImpl.performMeasure(ViewRootImpl.java:3006)
    at android.view.ViewRootImpl.measureHierarchy(ViewRootImpl.java:1833)
    at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:2122)
    at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1721)
    at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:7598)
    at android.view.Choreographer$CallbackRecord.run(Choreographer.java:966)
    at android.view.Choreographer.doCallbacks(Choreographer.java:790)
    at android.view.Choreographer.doFrame(Choreographer.java:725)
    at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:951)
    at android.os.Handler.handleCallback(Handler.java:883)
    at android.os.Handler.dispatchMessage(Handler.java:100)
    at android.os.Looper.loop(Looper.java:214)
    at android.app.ActivityThread.main(ActivityThread.java:7356)
    at java.lang.reflect.Method.invoke(Native Method)
    at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:492)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:930)
...