V / FA (3102): бездействие, отключение от службы - PullRequest
0 голосов
/ 03 апреля 2020

Я использую эту библиотеку с потоком click the button, show permission and also accepted, open the storage, pick the pdf file, then showing the path and file name into a screen

Но после того, как я выбрал pdf file, теперь он показывает путь и имя файла и показывает журнал следующим образом:

I/FilePicker(20955): Custom file type: application/pdf
V/FA      (20955): Recording user engagement, ms: 10457
I/lifecycle(20955): MainActivity Paused
V/FA      (20955): Connecting to remote service
V/FA      (20955): Activity paused, time: 1253571737
D/ViewRootImpl@669c5b3[MainActivity](20955): MSG_WINDOW_FOCUS_CHANGED 0 1
D/InputMethodManager(20955): prepareNavigationBarInfo() DecorView@957c60e[MainActivity]
D/InputMethodManager(20955): getNavigationBarColor() -855310
D/FA      (20955): Logging event (FE): user_engagement(_e), Bundle[{firebase_event_origin(_o)=auto, engagement_time_msec(_et)=10457, firebase_screen_class(_sc)=Flutter, firebase_screen_id(_si)=4210851998422730911, firebase_screen(_sn)=/attachments_resume}]
V/FA      (20955): Connection attempt already in progress
D/FA      (20955): Connected to remote service
V/FA      (20955): Processing queued up service tasks: 2
D/SurfaceView(20955): onWindowVisibilityChanged(8) false io.flutter.view.FlutterView{3ee5b5d VFE...... ........ 0,0-720,1384} of ViewRootImpl@669c5b3[MainActivity]
D/SurfaceView(20955): show() Surface(name=SurfaceView - com.hireplace.speedinterviews.android/com.hireplace.speed_interviews.presentation.MainActivity@3ee5b5d@0[20955])/@0x2ba5059 io.flutter.view.FlutterView{3ee5b5d VFE...... ........ 0,0-720,1384}
D/SurfaceView(20955): surfaceDestroyed callback.size 1 #2 io.flutter.view.FlutterView{3ee5b5d VFE...... ........ 0,0-720,1384}
W/libEGL  (20955): EGLNativeWindowType 0xd0912008 disconnect failed
D/SurfaceView(20955): destroy() Surface(name=SurfaceView - com.hireplace.speedinterviews.android/com.hireplace.speed_interviews.presentation.MainActivity@3ee5b5d@0[20955])/@0x2ba5059 io.flutter.view.FlutterView{3ee5b5d VFE...... ........ 0,0-720,1384}
W/libEGL  (20955): EGLNativeWindowType 0xd0911808 disconnect failed
D/OpenGLRenderer(20955): eglDestroySurface = 0xe4862340, 0xd0911800
D/ViewRootImpl@669c5b3[MainActivity](20955): Relayout returned: old=[0,0][720,1480] new=[0,0][720,1480] result=0x5 surface={false 0} changed=true
W/erviews.androi(20955): Accessing hidden method Ldalvik/system/CloseGuard;->close()V (light greylist, linking)
D/InputTransport(20955): Input channel destroyed: fd=111
D/ViewRootImpl@669c5b3[MainActivity](20955): stopped(true) old=false
D/SurfaceView(20955): windowStopped(true) false io.flutter.view.FlutterView{3ee5b5d VFE...... ........ 0,0-720,1384} of ViewRootImpl@669c5b3[MainActivity]
I/flutter (20955): App is on background
D/SurfaceView(20955): onWindowVisibilityChanged(4) false io.flutter.view.FlutterView{3ee5b5d VFE...... ........ 0,0-720,1384} of ViewRootImpl@669c5b3[MainActivity]
D/ViewRootImpl@669c5b3[MainActivity](20955): Relayout returned: old=[0,0][720,1480] new=[0,0][720,1480] result=0x1 surface={false 0} changed=false
D/ViewRootImpl@669c5b3[MainActivity](20955): stopped(false) old=true
D/SurfaceView(20955): windowStopped(false) false io.flutter.view.FlutterView{3ee5b5d VFE...... ........ 0,0-720,1384} of ViewRootImpl@669c5b3[MainActivity]
D/ViewRootImpl@669c5b3[MainActivity](20955): stopped(false) old=false
I/lifecycle(20955): MainActivity Resumed
D/SurfaceView(20955): onWindowVisibilityChanged(0) true io.flutter.view.FlutterView{3ee5b5d VFE...... ........ 0,0-720,1384} of ViewRootImpl@669c5b3[MainActivity]
I/flutter (20955): Date time ----> 2020-04-03 23:36:05.494980
I/flutter (20955): App is on foreground
I/flutter (20955): _AppState.didChangeAppLifecycleState2
V/FA      (20955): Activity resumed, time: 1253575054
D/ViewRootImpl@669c5b3[MainActivity](20955): Relayout returned: old=[0,0][720,1480] new=[0,0][720,1480] result=0x7 surface={true 3499169792} changed=true
D/mali_winsys(20955): EGLint new_window_surface(egl_winsys_display *, void *, EGLSurface, EGLConfig, egl_winsys_surface **, EGLBoolean) returns 0x3000,  [720x1480]-format:1
D/OpenGLRenderer(20955): eglCreateWindowSurface = 0xe4862340, 0xd0911808
D/SurfaceView(20955): show() Surface(name=SurfaceView - com.hireplace.speedinterviews.android/com.hireplace.speed_interviews.presentation.MainActivity@3ee5b5d@1[20955])/@0x10fb18e io.flutter.view.FlutterView{3ee5b5d VFE...... ........ 0,0-720,1384}
D/SurfaceView(20955): surfaceCreated 1 #8 io.flutter.view.FlutterView{3ee5b5d VFE...... ........ 0,0-720,1384}
D/mali_winsys(20955): EGLint new_window_surface(egl_winsys_display *, void *, EGLSurface, EGLConfig, egl_winsys_surface **, EGLBoolean) returns 0x3000,  [720x1384]-format:1
D/SurfaceView(20955): surfaceChanged (720,1384) 1 #8 io.flutter.view.FlutterView{3ee5b5d VFE...... ........ 0,0-720,1384}
D/ViewRootImpl@669c5b3[MainActivity](20955): MSG_WINDOW_FOCUS_CHANGED 1 1
D/InputMethodManager(20955): prepareNavigationBarInfo() DecorView@957c60e[MainActivity]
D/InputMethodManager(20955): getNavigationBarColor() -855310
D/NetworkManagementSocketTagger(20955): tagSocket(106) with statsTag=0xffffffff, statsUid=-1
D/InputMethodManager(20955): prepareNavigationBarInfo() DecorView@957c60e[MainActivity]
D/InputMethodManager(20955): getNavigationBarColor() -855310
V/InputMethodManager(20955): Starting input: tba=com.hireplace.speedinterviews.android ic=null mNaviBarColor -855310 mIsGetNaviBarColorSuccess true , NavVisible : true , NavTrans : false
D/InputMethodManager(20955): startInputInner - Id : 0
I/InputMethodManager(20955): startInputInner - mService.startInputOrWindowGainedFocus
D/InputTransport(20955): Input channel constructed: fd=208
V/FA      (20955): Inactivity, disconnecting from the service

Затем я пытаюсь нажать кнопку again, теперь она показывает хранилище и выдает мне журнал, подобный этому:

I/FilePicker(20955): Custom file type: application/pdf
I/flutter (20955): [FilePicker] Platform exception: PlatformException(already_active, File picker is already active, null)
I/flutter (20955): Unsupported operationPlatformException(already_active, File picker is already active, null)

Детали версии Flutter

[✓] Flutter (Channel stable, v1.12.13+hotfix.8, on Mac OS X 10.15.2 19C57,
    locale en-US)
    • Flutter version 1.12.13+hotfix.8 at
      /Users/rrifafauzikomara/Documents/flutter
    • Framework revision 0b8abb4724 (7 weeks ago), 2020-02-11 11:44:36 -0800
    • Engine revision e1e6ced81d
    • Dart version 2.7.0


[✓] Android toolchain - develop for Android devices (Android SDK version 29.0.3)
    • Android SDK at /Users/rrifafauzikomara/Library/Android/sdk
    • Android NDK location not configured (optional; useful for native profiling
      support)
    • Platform android-29, build-tools 29.0.3
    • Java binary at: /Applications/Android
      Studio.app/Contents/jre/jdk/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build
      1.8.0_212-release-1586-b4-5784211)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 11.3.1)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Xcode 11.3.1, Build version 11C504
    • CocoaPods version 1.8.4

[✓] Android Studio (version 3.6)
    • Android Studio at /Applications/Android Studio.app/Contents
    • Flutter plugin version 44.0.2
    • Dart plugin version 192.7761
    • Java version OpenJDK Runtime Environment (build
      1.8.0_212-release-1586-b4-5784211)

[✓] VS Code (version 1.39.2)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension version 3.5.1

[✓] Connected device (1 available)
    • SM A600G • 5200e3e7f01e45f3 • android-arm • Android 9 (API 28)

• No issues found!

Примечание Я уже добавил android:requestLegacyExternalStorage="true" и <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />

Это мой код:


ThemeData _themeData;
var _attachmentNameController = TextEditingController();
String _fileName = '...';
String _path = '...';

  void _openFileExplorer() async {
    try {
      _path = await FilePicker.getFilePath(type: FileType.custom, fileExtension: "pdf");
    } on PlatformException catch (e) {
      print("Unsupported operation" + e.toString());
    }

    if (!mounted) return;

    setState(() {
      _fileName = _path != null ? _path.split('/').last : '...';
    });
  }

@override
  Widget build(BuildContext context) {
    _themeData = Theme.of(context);
    return Scaffold(
      appBar: AppBar(
        title: Text(
          "Attachments",
          style: SourceSansProStyle(
              fontSize: 24,
              fontWeight: FontWeight.w400,
              color: _themeData.textTheme.body1.color),
        ),
        actions: <Widget>[
          MaterialButton(
              child: Text(
                "Save",
                style: SourceSansProStyle(
                    fontSize: 18,
                    fontWeight: FontWeight.w400,
                    color: _themeData.accentColor),
              ),
              onPressed: () {
                Navigator.pop(context);
              })
        ],
      ),
      body: SingleChildScrollView(
        child: Form(
            child: Padding(
          padding: EdgeInsets.all(20),
          child: Column(
            crossAxisAlignment: CrossAxisAlignment.start,
            children: <Widget>[
              CustomEditText(
                label: "Attachment Name",
                inputType: TextInputType.text,
                hint: "Example: My_Resume.pdf",
                controller: _attachmentNameController,
              ),
              RoundedButton(
                "Upload File",
                onPressed: _openFileExplorer,
              ),
              Text(
                _path ?? '...',
                textAlign: TextAlign.center,
                softWrap: true,
                textScaleFactor: 0.85,
              ),
              Text(
                _fileName,
                textAlign: TextAlign.center,
              ),
            ],
          ),
        )),
      ),
    );
  }

Допустим, у меня есть 2 флаттера, A и B. И эта ошибка появляется на A, и я пытаюсь создать новый проект флаттера (B), и я создаю тот же code, manifest, gradle, это 100 % то же самое. Но если я попытаюсь запустить в проекте A, он показывает эту ошибку, но в проекте B он работает хорошо. Можете ли вы помочь мне решить эту проблему? Потому что я разрабатываю проект на A.

...