NativeScript / android

NativeScript for Android using v8
https://docs.nativescript.org/guide/android-marshalling
Apache License 2.0
525 stars 135 forks source link

Unable to get SBG to correctly process files #1306

Closed bradmartin closed 2 years ago

bradmartin commented 5 years ago

Environment Provide version numbers for the following components (information can be retrieved by running tns info in your project folder or by inspecting the package.json of the project):

Describe the bug Have 2 files that are using @JavaProxy and one of them is throwing the IOException with the warning to change the file name. I'm unsure why this is the case, they're not named the same so I'm unfamiliar with how that is being handled in the sbg source.

(node:72812) [DEP0005] DeprecationWarning: Buffer() is deprecated due to security and usability issues. Please use the Buffer.alloc(), Buffer
.allocUnsafe(), or Buffer.from() methods instead.
Warning: there already is an extend called com.nativescript.TNS_AdvertiseCallback.
Warning: The static binding generator will generate extend from:bundle.js implementation
Warning: there already is an extend called com.nativescript.TNS_BluetoothGattCallback.
Warning: The static binding generator will generate extend from:bundle.js implementation
Warning: there already is an extend called com.nativescript.TNS_BluetoothGattServerCallback.
Warning: The static binding generator will generate extend from:bundle.js implementation
Warning: there already is an extend called com.nativescript.TNS_BroadcastReceiver.
Warning: The static binding generator will generate extend from:bundle.js implementation
Warning: there already is an extend called com.nativescript.TNS_LeScanCallback.
Warning: The static binding generator will generate extend from:bundle.js implementation
Warning: there already is an extend called com.nativescript.TNS_ScanCallback.
Warning: The static binding generator will generate extend from:bundle.js implementation
Warning: there already is an extend called com.permobil.ComplicationTapBroadcastReceiver.
Warning: The static binding generator will generate extend from:vendor.js implementation
Exception in thread "main" java.io.IOException: File already exists. This may lead to undesired behavior.
Please change the name of one of the extended classes.
File:/Users/bradmartin/projects/permobil-wear/apps/smartdrive-app/platforms/android/app/src/main/java/com/permobil/ComplicationTapBroadcastRe
ceiver.java Class: com.permobil.ComplicationTapBroadcastReceiver
        at org.nativescript.staticbindinggenerator.Generator.writeBindings(Generator.java:82)
        at org.nativescript.staticbindinggenerator.Main.main(Main.java:47)

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:runSbg'.
> Process 'command '/Library/Java/JavaVirtualMachines/jdk1.8.0_131.jdk/Contents/Home/bin/java'' finished with non-zero exit value 1

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org

However, both files are being generated.

sbgissue

The receiver & service are both declared in the project manifest


        <service android:name="com.permobil.ComplicationProviderService" android:icon="@drawable/ic_watch_white" android:label="@string/complications_provider_service_label" android:permission="com.google.android.wearable.permission.BIND_COMPLICATION_PROVIDER">
            <intent-filter>
                <action android:name="android.support.wearable.complications.ACTION_COMPLICATION_UPDATE_REQUEST"/>
            </intent-filter>

            <meta-data android:name="android.support.wearable.complications.SUPPORTED_TYPES" android:value="SHORT_TEXT"/>

            <meta-data android:name="android.support.wearable.complications.UPDATE_PERIOD_SECONDS" android:value="0"/>
        </service>

        <receiver android:name="com.permobil.ComplicationTapBroadcastReceiver" />

and the functionality for the complication to work on WearOS is correct. This was all working until we starting bundling and everything works great, I just can't figure out why this exception is thrown by the SBG process even when the files are generated in the android project.

The project webpack.config modified:

  // Add your custom Activities, Services and other Android app components here.
  const appComponents = [
    'tns-core-modules/ui/frame',
    'tns-core-modules/ui/frame/activity',
    resolve(
      __dirname,
      'node_modules/nativescript-bluetooth/android/TNS_AdvertiseCallback.js'
    ),
    resolve(
      __dirname,
      'node_modules/nativescript-bluetooth/android/TNS_BluetoothGattCallback.js'
    ),
    resolve(
      __dirname,
      'node_modules/nativescript-bluetooth/android/TNS_BluetoothGattServerCallback.js'
    ),
    resolve(
      __dirname,
      'node_modules/nativescript-bluetooth/android/TNS_BroadcastReceiver.js'
    ),
    resolve(
      __dirname,
      'node_modules/nativescript-bluetooth/android/TNS_LeScanCallback.js'
    ),
    resolve(
      __dirname,
      'node_modules/nativescript-bluetooth/android/TNS_ScanCallback.js'
    ),
    resolve(__dirname, 'app/complications/complication_provider_service.js'),
    resolve(
      __dirname,
      'app/complications/complication_tap_broadcast_receiver.js'
    )
  ];

if you remove the 2 resolve pointing to the complications directory files the project will build and run. Granted, without running on a real device you'll have bluetooth warnings since emulators don't have bluetooth for testing. Just FYI.

To Reproduce

Clone the repo

git clone --branch sbg-issue-runtime https://github.com/Max-Mobility/permobil-wear/tree/sbg-issue-runtime

The README has steps to run which are:

cd permobil-wear && npm run setup && npm run smartdrive.start.android

All this will do is setup the project for tsc to run in some local directories (local plugin forks). smartdrive.start.android is no different than cd apps/smartdrive-app && tns run android --bundle if you prefer to navigate to the app directory.

The app is working perfectly fine when I don't include these files in the webpack.config.js, granted that leaves me without the generated java files to do the functionality I need.

Expected behavior

SBG produces the files in the android project and no error thrown during SBG process or at runtime trying to access the correct class.

Sample project https://github.com/Max-Mobility/permobil-wear/tree/sbg-issue-runtime

This branch has one private git repo dependency removed, so that anyone can run the app without dependency issues. That's the only diff between master.

bradmartin commented 5 years ago

sbg-bindings.txt:

android.bluetooth.le.AdvertiseCallback*****onInit,onStartSuccess,onStartFailure*com.nativescript.TNS_AdvertiseCallback*bundle.js*
android.bluetooth.BluetoothGattCallback*****onInit,onConnectionStateChange,onServicesDiscovered,onCharacteristicRead,onCharacteristicChanged,onCharacteristicWrite,onDescriptorRead,onDescriptorWrite,onReadRemoteRssi,onMtuChanged*com.nativescript.TNS_BluetoothGattCallback*bundle.js*
android.bluetooth.BluetoothGattServerCallback*****onInit,onCharacteristicReadRequest,onCharacteristicWriteRequest,onConnectionStateChange,onDescriptorReadRequest,onDescriptorWriteRequest,onExecuteWrite,onNotificationSent,onServiceAdded*com.nativescript.TNS_BluetoothGattServerCallback*bundle.js*
android.content.BroadcastReceiver*****onInit,onReceive*com.nativescript.TNS_BroadcastReceiver*bundle.js*
android.bluetooth.BluetoothAdapter.LeScanCallback*****onInit*com.nativescript.TNS_LeScanCallback*bundle.js*
android.bluetooth.le.ScanCallback*****onInit,onBatchScanResults,onScanFailed,onScanResult*com.nativescript.TNS_ScanCallback*bundle.js*
android.content.BroadcastReceiver*****onInit,onReceive*com.permobil.ComplicationTapBroadcastReceiver*bundle.js*
tns_core_modules_data_observable__WEBPACK_IMPORTED_MODULE_0__.*bundle*347*28*DeviceBase*motorTicksToMiles,caseTicksToMiles,versionStringToByte,versionByteToString,sendSettings,sendEvent,ota_start_event,ota_pause_event,ota_resume_event,ota_cancel_event,ota_force_event,ota_retry_event,ota_failed_event,ota_timeout_event***
_device_base__WEBPACK_IMPORTED_MODULE_2__.*bundle*476*28*PushTracker*toString,data,fromObject,isUpToDate,otaProgressToString,otaStateToString,onOTAActionTap,cancelOTA,performOTA,sendSettings,sendPacket,handlePaired,handleConnect,handleDisconnect,handlePacket,_handleVersionInfo,_handleErrorInfo,_handleDistance,_handleSettings,_handleDailyInfo,_handleReady,_handleOTAReady,OTAState,ServiceUUID,Characteristics,DataCharacteristicUUID,pushtracker_paired_event,pushtracker_connect_event,pushtracker_disconnect_event,pushtracker_version_event,pushtracker_error_event,pushtracker_distance_event,pushtracker_settings_event,pushtracker_daily_info_event,pushtracker_awake_event,pushtracker_ota_ready_event***
_device_base__WEBPACK_IMPORTED_MODULE_1__.*bundle*1047*28*SmartDrive*toString,data,fromObject,isMcuUpToDate,isBleUpToDate,isUpToDate,otaProgressToString,otaStateToString,onOTAActionTap,cancelOTA,performOTA,sendSettings,sendPacket,sendTap,stopMotor,stopNotifyCharacteristics,startNotifyCharacteristics,connect,disconnect,handleConnect,handleDisconnect,handleNotify,handlePacket,_handleDeviceInfo,_handleMotorInfo,_handleDistanceInfo,_handleOTAReady,OTAState,ServiceUUID,Characteristics,BLEOTADataCharacteristic,DataCharacteristic,ControlCharacteristic,BLEOTAControlCharacteristic,smartdrive_connect_event,smartdrive_disconnect_event,smartdrive_service_discovered_event,smartdrive_characteristic_discovered_event,smartdrive_ble_version_event,smartdrive_mcu_version_event,smartdrive_distance_event,smartdrive_motor_info_event,smartdrive_ota_ready_event,smartdrive_ota_ready_ble_event,smartdrive_ota_ready_mcu_event***
android.hardware.TriggerEventListener*bundle***SmartDriveTriggerListener*onTrigger***
_common__WEBPACK_IMPORTED_MODULE_2__.*bundle*28159*28*Bluetooth*coarseLocationPermissionGranted,requestCoarseLocationPermission,enable,disable,isBluetoothEnabled,startScanning,stopScanning,connect,disconnect,read,write,writeWithoutResponse,startNotifying,stopNotifying,getAdapter,removeBond,fetchUuidsWithSdp,stopGattServer,startGattServer,notifyCentrals,setDiscoverable,getAdvertiser,makeService,makeCharacteristic,makeDescriptor,addService,getServerService,offersService,clearServices,cancelServerConnection,getConnectedDevices,getConnectedDeviceState,getConnectedDevicesMatchingState,getServerConnectedDevices,getServerConnectedDeviceState,getServerConnectedDevicesMatchingState,startAdvertising,stopAdvertising,isPeripheralModeSupported,gattDisconnect,uuidToString,encodeValue,decodeValue,stringToUuid,extractManufacturerRawData,_findNotifyCharacteristic,_findCharacteristicOfType,_getWrapper,_isEnabled,_getContext,_getActivity***
tns_core_modules_data_observable__WEBPACK_IMPORTED_MODULE_0__.*bundle***BluetoothCommon*base64ToArrayBuffer,requestCoarseLocationPermission,hasCoarseLocationPermission,sendEvent,error_event,peripheral_connected_event,peripheral_disconnected_event,peripheral_failed_to_connect_event,centralmanager_updated_state_event,centralmanager_restore_state_event,peripheralmanager_restore_state_event,peripheralmanager_update_state_event,peripheralmanager_did_add_event,peripheralmanager_subscribe_characteristic_event,peripheralmanager_unsubscribe_characteristic_event,peripheralmanager_ready_update_subscribers_event,peripheralmanager_read_request_event,peripheralmanager_write_request_event,bluetooth_enabled_event,bluetooth_discoverable_event,bluetooth_advertise_success_event,bluetooth_advertise_failure_event,server_connection_state_changed_event,bond_status_change_event,device_discovered_event,device_name_change_event,device_uuid_change_event,device_acl_disconnected_event,characteristic_write_request_event,characteristic_read_request_event,descriptor_write_request_event,descriptor_read_request_event,execute_write_event,notification_sent_event***
tns_core_modules_data_observable__WEBPACK_IMPORTED_MODULE_7__.*bundle*29759*28*MainViewModel*toggleAccelerometer,onMotorInfo,onDistance,onSmartDriveVersion,onScanForSmartDrivesTap,onDisconnectTap,startHeartRate,onMainLayoutLoaded,onSettingsLayoutLoaded,onSettingsTap,onVoiceInputTap,_animateHeartIcon,_stopHeartAnimation,_trimAccelerometerData***
android.hardware.SensorEventListener*bundle*26589*22**onAccuracyChanged,onSensorChanged***
android.hardware.SensorEventListener*bundle*29928*55**onAccuracyChanged,onSensorChanged***
android.support.v7.app.AppCompatActivity*****onCreate,onNewIntent,onSaveInstanceState,onStart,onStop,onDestroy,onPostResume,onBackPressed,onRequestPermissionsResult,onActivityResult*com.tns.NativeScriptActivity*vendor.js*
org.nativescript.widgets.FragmentBase*****onHiddenChanged,onCreateAnimator,onStop,onCreate,onCreateView,onSaveInstanceState,onDestroyView,onDestroy,toString*com.tns.FragmentClass*vendor.js*
android.support.wearable.complications.ComplicationProviderService*****onComplicationActivated,onComplicationUpdate,onComplicationDeactivated,getToggleIntent*com.permobil.ComplicationProviderService*vendor.js*
android.content.BroadcastReceiver*****onInit,onReceive*com.permobil.ComplicationTapBroadcastReceiver*vendor.js*
_reflector_reader__WEBPACK_IMPORTED_MODULE_0__.*vendor***Reflector*updateCapabilities,factory,parameters,annotations,propMetadata,hasLifecycleHook,getter,setter,method,importUri,resourceUri,resolveIdentifier,resolveEnum***
e.lib.Base*vendor*2114*344892**init,reset,update,finalize***
c.cfg*vendor*2114*351512**mode,padding***
p.cfg*vendor*2114*353228**kdf***
o.Middleware*vendor*2114*475786*t*handle,cancel***
n.EventEmitter*vendor***t*open***
n.EventEmitter*vendor***t*open,close***
n.Color*vendor***t****
i.Client*vendor***t*init***
i.CommonFileStore*vendor***t*makeUploadRequest,getFileSize***
u.FileStore*vendor***t*upload,doesFileExist,getFileSize***
a.KinveyWorker*vendor***t*upload***
view_1.View*vendor***BoxInsetLayout*createNativeView,initNativeView,disposeNativeView,onLoaded,_addChildFromBuilder***
view_1.View*vendor***CircularProgressLayout*createNativeView,initNativeView,disposeNativeView,startTimer,stopTimer,onLoaded,_addChildFromBuilder***
android.support.wear.widget.WearableLinearLayoutManager.LayoutCallback*vendor***TNS_CustomScrollingLayoutCallback*onLayoutFinished,MAX_ICON_PROGRESS***
android.support.v7.widget.RecyclerView.Adapter*vendor*4020*32*TNS_WearOsListViewAdapter*onCreateViewHolder,onBindViewHolder,getItemId,getItemCount,getItemViewType***
android.support.v7.widget.RecyclerView.ViewHolder*vendor*4132*28*TNS_WearOsListViewHolder*isSelected,setIsSelected,onClick,onLongClick***android.view.View.OnClickListener,android.view.View.OnLongClickListener
android.support.wear.widget.WearableRecyclerView*vendor*4312*28*TNS_WearableRecyclerView*onLayout***
view_1.View*vendor*4382*28*WearOsListViewBase*onLayout,_getItemTemplate,_prepareItem,_getDefaultItemContent,_updateNativeItems,_getDataItem,knownFunctions,itemLoadingEvent,itemTapEvent,loadMoreItemsEvent,scrollEvent***
BASE.WearOsListViewBase*vendor*4634*28*WearOsListView*createNativeView,initNativeView,disposeNativeView,onLoaded,onLayout,refresh,scrollToIndex,scrollToIndexAnimated,eachChildView,_clearRealizedCells,,,itemLoadingEvent,itemTapEvent***
android.support.wear.widget.SwipeDismissFrameLayout.Callback*vendor*4795*28*TNS_SwipeDismissFrameLayoutCallback*onDismissed,onSwipeCanceled,onSwipeStarted***
view_1.View*vendor***SwipeDismissLayout*createNativeView,initNativeView,disposeNativeView,onLoaded,_addChildFromBuilder,dimissedEvent,swipeCanceledEvent,swipeStartedEvent***
view_1.View*vendor***WearOsLayout*createNativeView,initNativeView,disposeNativeView,onLoaded,_addChildFromBuilder,_adjustInset,SCALE_FACTOR***
application_common_1.Observable*vendor***AndroidApplication*init,_registerPendingReceivers,registerBroadcastReceiver,unregisterBroadcastReceiver,activityCreatedEvent,activityDestroyedEvent,activityStartedEvent,activityPausedEvent,activityResumedEvent,activityStoppedEvent,saveActivityStateEvent,activityResultEvent,activityBackPressedEvent,activityRequestPermissionsEvent***
android.content.BroadcastReceiver*vendor*6660*32*BroadcastReceiver*onReceive***
common.Color*vendor***Color****
observable.Observable*vendor*9261*28*ObservableArray*getItem,setItem,toString,toLocaleString,concat,join,pop,push,_notifyLengthChange,reverse,shift,slice,sort,splice,unshift,indexOf,lastIndexOf,every,some,forEach,map,filter,reduce,reduceRight,changeEvent***
observable.Observable*vendor*12202*28*ImageAsset*getImageAsync***
common.ImageAsset*vendor*12270*28*ImageAsset*getImageAsync***
view_1.ViewBase*vendor*15932*28*FormattedString*toString,_addArrayFromBuilder,_addChildFromBuilder,onSpansCollectionChanged,addPropertyChangeHandler,removePropertyChangeHandler,onPropertyChange,eachChild***
view_1.ViewBase*vendor***Span*_setTextInternal***
view_1.View*vendor*16506*28*ActionBarBase*update,_onTitlePropertyChanged,_addArrayFromBuilder,eachChildView,eachChild,_isEmpty***
view_1.ViewBase*vendor***ActionItemBase*onLoaded,_raiseTap,_addChildFromBuilder,_onVisibilityChanged,eachChild,tapEvent***
java.lang.Object*vendor*16829*32*MenuItemClickListenerImpl*onMenuItemClick***android.support.v7.widget.Toolbar.OnMenuItemClickListener
action_bar_common_1.ActionItemBase*vendor*16848*28*ActionItem*_getItemId***
action_bar_common_1.ActionBarBase*vendor*16917*28*ActionBar*_addChildFromBuilder,createNativeView,initNativeView,disposeNativeView,onLoaded,update,_onAndroidItemSelected,_updateNavigationButton,_updateIcon,_updateTitleAndTitleView,_addActionItems,_setOnClickListener,_onTitlePropertyChanged,_onIconPropertyChanged,_addViewToNativeVisualTree,_removeViewFromNativeVisualTree,,,***
view_1.View*vendor***ActivityIndicatorBase****
activity_indicator_common_1.ActivityIndicatorBase*vendor***ActivityIndicator*createNativeView,,,,,,***
animation_common_1.AnimationBase*vendor*17606*28*Animation*play,cancel,_resolveAnimationCurve,_play,_onAndroidAnimationEnd,_onAndroidAnimationCancel,_createAnimators,_getAndroidRepeatCount***
content_view_1.ContentView*vendor***Border*onMeasure,onLayout***
text_base_1.TextBase*vendor***ButtonBase*tapEvent***
java.lang.Object*vendor*19306*32*ClickListenerImpl*onClick***android.view.View.OnClickListener
button_common_1.ButtonBase*vendor*19326*28*Button*createNativeView,initNativeView,disposeNativeView,resetNativeView,_updateHandler,,,,,,,,,,***
view_1.CustomLayoutView*vendor***ContentView*_onContentChanged,_addChildFromBuilder,eachChildView,onMeasure,onLayout***
bindable_1.Observable*vendor*21287*28*ViewBase*getViewById,ensureDomNode,set,onLoaded,onUnloaded,_suspendNativeUpdates,_resumeNativeUpdates,_batchUpdate,setFlag,isFlagSet,callFunctionWithSuper,callLoaded,callUnloaded,notifyPseudoClassChanged,getAllAliasedStates,addPseudoClass,deletePseudoClass,bindingContextChanged,bind,unbind,requestLayout,eachChild,_addView,_addViewCore,loadView,unloadView,_removeView,_removeViewCore,createNativeView,disposeNativeView,initNativeView,resetNativeView,resetNativeViewInternal,_setupAsRootView,_setupUI,setNativeView,_tearDownUI,_childIndexToNativeChildIndex,_addViewToNativeVisualTree,_removeViewFromNativeVisualTree,_goToVisualState,_applyXmlAttribute,setInlineStyle,_parentChanged,onResumeNativeUpdates,toString,_onCssStateChange,_inheritStyleScope,showModal,closeModal,_dialogClosed,_onRootViewReset,loadedEvent,unloadedEvent***
view_base_1.ViewBase*vendor***ViewCommon*addCss,addCssFile,_updateStyleScope,setScopeProperty,_setupAsRootView,observe,getGestureObservers,addEventListener,removeEventListener,_onLivesync,onBackPressed,_getFragmentManager,getModalOptions,showModal,closeModal,_showNativeModalView,_raiseLayoutChangedEvent,_raiseShownModallyEvent,_raiseShowingModallyEvent,_isEvent,_disconnectGestureObservers,measure,layout,getMeasuredWidth,getMeasuredHeight,getMeasuredState,setMeasuredDimension,requestLayout,resolveSizeAndState,combineMeasuredStates,layoutChild,measureChild,getMeasureSpec,_setCurrentMeasureSpecs,_getCurrentLayoutBounds,_setCurrentLayoutBounds,eachChild,eachChildView,_getNativeViewsCount,_eachLayoutView,focus,getSafeAreaInsets,getLocationInWindow,getLocationOnScreen,getLocationRelativeTo,getActualSize,animate,createAnimation,_removeAnimation,resetNativeView,_setNativeViewFrame,_getValue,_setValue,_updateEffectiveLayoutValues,_setNativeClipToBounds,_redrawNativeBackground,_onAttachedToWindow,_onDetachedFromWindow,_hasAncestorView,layoutChangedEvent,shownModallyEvent,showingModallyEvent***
java.lang.Object*vendor*23003*32*TouchListenerImpl*onTouch***android.view.View.OnTouchListener
android.app.Dialog*vendor*23030*32*DialogImpl*onDetachedFromWindow,onBackPressed***
android.support.v4.app.DialogFragment*vendor*23061*32*DialogFragmentImpl*onCreateDialog,onCreateView,onStart,onDismiss,onDestroy***
view_common_1.ViewCommon*vendor***View*observe,on,off,_getChildFragmentManager,_getRootFragmentManager,_getFragmentManager,onLoaded,onUnloaded,onBackPressed,handleGestureTouch,hasGestureObservers,initNativeView,disposeNativeView,setOnTouchListener,setOnLayoutChangeListener,layoutNativeView,requestLayout,measure,layout,onMeasure,onLayout,_getCurrentLayoutBounds,getMeasuredWidth,getMeasuredHeight,focus,getLocationInWindow,getLocationOnScreen,getLocationRelativeTo,resolveSizeAndState,_showNativeModalView,_hideNativeModalView,,,,,,,,,,,,,,,,,,,,,,,,,,,,_redrawNativeBackground,androidBackPressedEvent***
view_1.View*vendor***DatePickerBase****
java.lang.Object*vendor*24038*32*DateChangedListenerImpl*onDateChanged***android.widget.DatePicker.OnDateChangedListener
date_picker_common_1.DatePickerBase*vendor***DatePicker*createNativeView,initNativeView,disposeNativeView,updateNativeDate,,,,,,,,***
text_base_1.TextBase*vendor***EditableTextBase*blurEvent,focusEvent***
java.lang.Object*vendor*24684*32*EditTextListenersImpl*beforeTextChanged,onTextChanged,afterTextChanged,onFocusChange,onEditorAction***android.text.TextWatcher,android.view.View.OnFocusChangeListener,android.widget.TextView.OnEditorActionListener
editable_text_base_common_1.EditableTextBase*vendor***EditableTextBase*_onReturnPress,createNativeView,initNativeView,disposeNativeView,resetNativeView,onUnloaded,dismissSoftInput,focus,_setInputType,,,,,,,,,,,,,,,,,***
java.lang.Object*vendor*25550*36*TransitionListenerImpl*onTransitionStart,onTransitionEnd,onTransitionResume,onTransitionPause,onTransitionCancel***android.transition.Transition.TransitionListener
java.lang.Object*vendor*25599*36*AnimationListenerImpl*onAnimationStart,onAnimationRepeat,onAnimationEnd,onAnimationCancel***android.animation.Animator.AnimatorListener
transition_1.Transition*vendor***NoTransition*createAndroidAnimator***
view_1.CustomLayoutView*vendor***FrameBase*_addChildFromBuilder,onLoaded,canGoBack,goBack,_removeEntry,navigate,isCurrent,setCurrent,_updateBackstack,isNestedWithin,raiseCurrentPageNavigatedEvents,_processNavigationQueue,_findEntryForTag,navigationQueueIsEmpty,_isEntryBackstackVisible,_updateActionBar,_processNextNavigationEntry,performNavigation,performGoBack,_goBackCore,_navigateCore,_onNavigatingTo,_pushInFrameStackRecursive,_pushInFrameStack,_popFromFrameStack,_removeFromFrameStack,_dialogClosed,_onRootViewReset,eachChildView,_getIsAnimatedNavigation,_getNavigationTransition,_getNavBarVisible,_addViewToNativeVisualTree,_removeViewFromNativeVisualTree,_printFrameBackStack,_backstackEntryTrace,_onLivesync,androidOptionSelectedEvent,defaultAnimatedNavigation***
java.lang.Object*vendor*26590*36*AttachListener*onViewAttachedToWindow,onViewDetachedFromWindow***android.view.View.OnAttachStateChangeListener
frame_common_1.FrameBase*vendor*26632*28*Frame*_onAttachedToWindow,_onDetachedFromWindow,_processNextNavigationEntry,_getChildFragmentManager,_onRootViewReset,onUnloaded,disposeCurrentFragment,createFragment,setCurrent,onBackPressed,_navigateCore,_goBackCore,_removeEntry,createNativeView,initNativeView,disposeNativeView,_popFromFrameStack,_getNavBarVisible,_saveFragmentsState***
frame_common_1.Observable*vendor*26980*28*AndroidFrame*canGoBack,fragmentForPage***
android.view.GestureDetector.SimpleOnGestureListener*vendor*27721*32*TapAndDoubleTapGestureListenerImpl*onSingleTapUp,onDoubleTap,onDown,onLongPress***
android.view.ScaleGestureDetector.SimpleOnScaleGestureListener*vendor*27762*32*PinchGestureListenerImpl*onScaleBegin,onScale,onScaleEnd***
android.view.GestureDetector.SimpleOnGestureListener*vendor*27796*32*SwipeGestureListenerImpl*onDown,onFling***
gestures_common_1.GesturesObserverBase*vendor***GesturesObserver*observe,disconnect,_detach,_attach,androidOnTouchEvent***
view_1.View*vendor***HtmlViewBase****
html_view_common_1.HtmlViewBase*vendor***HtmlView*createNativeView,initNativeView,resetNativeView,,***
view_1.View*vendor***ImageBase*_createImageSourceFromSrc***
java.lang.Object*vendor*28500*32*ImageLoadedListenerImpl*onImageLoaded***org.nativescript.widgets.image.Worker.OnImageLoadedListener
image_common_1.ImageBase*vendor***Image*createNativeView,initNativeView,disposeNativeView,resetNativeView,_createImageSourceFromSrc,_calculateKeepAspectRatio,,,,,,,,***
text_base_1.TextBase*vendor***Label*createNativeView,initNativeView,***
layout_base_1.LayoutBase*vendor***AbsoluteLayoutBase*getLeft,setLeft,getTop,setTop,onLeftChanged,onTopChanged***
absolute_layout_common_1.AbsoluteLayoutBase*vendor***AbsoluteLayout*createNativeView***
layout_base_1.LayoutBase*vendor***DockLayoutBase*getDock,setDock,onDockChanged***
dock_layout_common_1.DockLayoutBase*vendor***DockLayout*createNativeView,,***
layout_base_1.LayoutBase*vendor***FlexboxLayoutBase*setOrder,getOrder,setFlexGrow,getFlexGrow,setFlexShrink,getFlexShrink,setAlignSelf,getAlignSelf,setFlexWrapBefore,getFlexWrapBefore***
flexbox_layout_common_1.FlexboxLayoutBase*vendor*29369*28*FlexboxLayout*createNativeView,resetNativeView,,,,,,,,,,,_updateNativeLayoutParams,_setChildMinWidthNative,_setChildMinHeightNative***
layout_base_1.Observable*vendor*29503*28*ItemSpec*create,equals***
layout_base_1.LayoutBase*vendor***GridLayoutBase*getColumn,setColumn,getColumnSpan,setColumnSpan,getRow,setRow,getRowSpan,setRowSpan,addRow,addColumn,addChildAtCell,removeRow,removeColumn,removeColumns,removeRows,onRowChanged,onRowSpanChanged,onColumnChanged,onColumnSpanChanged,_onRowAdded,_onColumnAdded,_onRowRemoved,_onColumnRemoved,getColumns,getRows,invalidate***
grid_layout_common_1.ItemSpec*vendor***ItemSpec****
grid_layout_common_1.GridLayoutBase*vendor***GridLayout*createNativeView,initNativeView,resetNativeView,_onRowAdded,_onColumnAdded,_onRowRemoved,_onColumnRemoved,invalidate***
view_1.CustomLayoutView*vendor***LayoutBaseCommon*_addChildFromBuilder,getChildrenCount,getChildAt,getChildIndex,getChildById,_registerLayoutChild,_unregisterLayoutChild,addChild,insertChild,removeChild,removeChildren,_childIndexToNativeChildIndex,eachChildView,eachLayoutChild***
layout_base_common_1.LayoutBaseCommon*vendor***LayoutBase*,,,,,,,,,,***
layout_base_1.LayoutBase*vendor***StackLayoutBase****
stack_layout_common_1.StackLayoutBase*vendor***StackLayout*createNativeView,***
layout_base_1.LayoutBase*vendor***WrapLayoutBase****
wrap_layout_common_1.WrapLayoutBase*vendor***WrapLayout*createNativeView,,,***
view_1.View*vendor***ListPickerBase*_getItemAsString,parseItem,updateSelectedValue***
java.lang.Object*vendor*30369*32*FormatterImpl*format***android.widget.NumberPicker.Formatter
java.lang.Object*vendor*30384*32*ValueChangeListenerImpl*onValueChange***android.widget.NumberPicker.OnValueChangeListener
list_picker_common_1.ListPickerBase*vendor***ListPicker*createNativeView,initNativeView,disposeNativeView,_fixNumberPickerRendering,,,,,,***
view_1.ContainerView*vendor***ListViewBase*refresh,scrollToIndex,scrollToIndexAnimated,_getItemTemplate,_prepareItem,_getDataItem,_getDefaultItemContent,_onItemsChanged,_onRowHeightPropertyChanged,isItemAtIndexVisible,updateEffectiveRowHeight,itemLoadingEvent,itemTapEvent,loadMoreItemsEvent,knownFunctions***
java.lang.Object*vendor*30735*32*ItemClickListenerImpl*onItemClick***android.widget.AdapterView.OnItemClickListener
list_view_common_1.ListViewBase*vendor***ListView*createNativeView,initNativeView,disposeNativeView,onLoaded,refresh,scrollToIndex,scrollToIndexAnimated,eachChildView,_dumpRealizedTemplates,clearRealizedCells,isItemAtIndexVisible,,,,***
android.widget.BaseAdapter*vendor*30910*32*ListViewAdapter*getCount,getItem,getItemId,hasStableIds,getViewTypeCount,getItemViewType,getView***
content_view_1.ContentView*vendor***PageBase*_addChildFromBuilder,getKeyframeAnimationWithName,createNavigatedData,onNavigatingTo,onNavigatedTo,onNavigatingFrom,onNavigatedFrom,eachChildView,navigatingToEvent,navigatedToEvent,navigatingFromEvent,navigatedFromEvent***
page_common_1.PageBase*vendor***Page*createNativeView,initNativeView,_addViewToNativeVisualTree,onLoaded,updateActionBar,,,,,***
view_1.View*vendor***Placeholder*createNativeView,creatingViewEvent***
view_1.View*vendor***ProgressBase****
progress_common_1.ProgressBase*vendor***Progress*createNativeView,,,,,,,,,,***
layout_base_1.LayoutBase*vendor*31460*28*ProxyViewContainer*createNativeView,_getNativeViewsCount,_eachLayoutView,_addViewToNativeVisualTree,_removeViewFromNativeVisualTree,_registerLayoutChild,_unregisterLayoutChild,_parentChanged***
layout_base_1.CustomLayoutView*vendor*31601*28*Repeater*onLoaded,_requestRefresh,refresh,_onItemsChanged,_getDefaultItemContent,_getDataItem,eachChildView,onLayout,onMeasure***
content_view_1.ContentView*vendor***ScrollViewBase*addEventListener,removeEventListener,onLoaded,onUnloaded,attach,dettach,attachNative,dettachNative,scrollEvent***
scroll_view_common_1.ScrollViewBase*vendor***ScrollView*,,,,,scrollToVerticalOffset,scrollToHorizontalOffset,createNativeView,initNativeView,_onOrientationChanged,attachNative,_onScrollChanged,dettachNative***
view_1.View*vendor***SearchBarBase*submitEvent,clearEvent***
java.lang.Object*vendor*32073*32*CompatQueryTextListenerImpl*onQueryTextChange,onQueryTextSubmit***android.support.v7.widget.SearchView.OnQueryTextListener
java.lang.Object*vendor*32103*32*CompatCloseListenerImpl*onClose***android.support.v7.widget.SearchView.OnCloseListener
search_bar_common_1.SearchBarBase*vendor***SearchBar*dismissSoftInput,focus,createNativeView,initNativeView,disposeNativeView,,,,,,,,,,,,,,,,,,,,,_getTextView,_getSearchPlate***
view_1.ViewBase*vendor***SegmentedBarItemBase****
view_1.View*vendor***SegmentedBarBase*_addArrayFromBuilder,_addChildFromBuilder,onItemsChanged,eachChild,selectedIndexChangedEvent***
java.lang.Object*vendor*32466*32*TabChangeListenerImpl*onTabChanged***android.widget.TabHost.OnTabChangeListener
java.lang.Object*vendor*32484*32*TabContentFactoryImpl*createTabContent***android.widget.TabHost.TabContentFactory
android.widget.TabHost*vendor*32503*32*TabHostImpl*onAttachedToWindow***
segmented_bar_common_1.SegmentedBarItemBase*vendor***SegmentedBarItem*setupNativeView,_update,,,,,,,,***
segmented_bar_common_1.SegmentedBarBase*vendor***SegmentedBar*shouldChangeSelectedIndex,createNativeView,initNativeView,disposeNativeView,insertTab,,,,***
view_1.View*vendor***SliderBase****
java.lang.Object*vendor*32748*36*SeekBarChangeListenerImpl*onProgressChanged,onStartTrackingTouch,onStopTrackingTouch***android.widget.SeekBar.OnSeekBarChangeListener
slider_common_1.SliderBase*vendor***Slider*createNativeView,initNativeView,disposeNativeView,resetNativeView,setNativeValuesSilently,,,,,,,,,,***
font_common_1.Font*vendor***Font*withFontFamily,withFontStyle,withFontWeight,withFontSize,getAndroidTypeface,getUIFont,default***
observable_1.Observable*vendor*36094*28*Style*toString***
view_1.View*vendor***SwitchBase****
java.lang.Object*vendor*36157*32*CheckedChangeListenerImpl*onCheckedChanged***android.widget.CompoundButton.OnCheckedChangeListener
switch_common_1.SwitchBase*vendor***Switch*createNativeView,initNativeView,disposeNativeView,,,,,,,,***
view_1.ViewBase*vendor***TabViewItemBase*_addChildFromBuilder,eachChild,loadView***
view_1.View*vendor***TabViewBase*_addArrayFromBuilder,_addChildFromBuilder,eachChild,eachChildView,onItemsChanged,onSelectedIndexChanged,selectedIndexChangedEvent***
org.nativescript.widgets.FragmentBase*vendor*36556*32*TabFragmentImplementation*newInstance,onCreate,onCreateView***
android.support.v4.view.PagerAdapter*vendor*36587*32*FragmentPagerAdapter*getCount,getPageTitle,startUpdate,instantiateItem,getItemPosition,destroyItem,setPrimaryItem,finishUpdate,isViewFromObject,saveState,restoreState,getItemId,_commitCurrentTransaction***
tab_view_common_1.TabViewItemBase*vendor***TabViewItem*initNativeView,onLoaded,resetNativeView,disposeNativeView,createNativeView,_update,_getChildFragmentManager,,,,,,***
tab_view_common_1.TabViewBase*vendor*36842*28*TabView*onItemsChanged,createNativeView,initNativeView,_loadUnloadTabItems,onLoaded,onUnloaded,disposeNativeView,_onRootViewReset,disposeCurrentFragments,shouldUpdateAdapter,setAdapterItems,updateAndroidItemAt,,,,,,,,,,,,,,,***
view_1.View*vendor***TextBaseCommon*_onFormattedTextContentsChanged,_addChildFromBuilder,_requestLayoutOnTextChanged,eachChild,_setNativeText***
java.lang.Object*vendor*37390*32*TextTransformationImpl*getTransformation,onFocusChanged***android.text.method.TransformationMethod
text_base_common_1.TextBaseCommon*vendor***TextBase*initNativeView,resetNativeView,,,,,,,,,,,,,,,,,,,,,,,,,,,,_setNativeText***
editable_text_base_1.EditableTextBase*vendor***TextFieldBase*returnPressEvent***
text_field_common_1.TextFieldBase*vendor***TextField*_configureEditText,_onReturnPress,,,setSecureAndKeyboardType,,***
editable_text_base_1.EditableTextBase*vendor***TextView*_configureEditText,resetNativeView***
view_1.View*vendor***TimePickerBase****
java.lang.Object*vendor*38081*32*TimeChangedListenerImpl*onTimeChanged***android.widget.TimePicker.OnTimeChangedListener
time_picker_common_1.TimePickerBase*vendor***TimePicker*createNativeView,initNativeView,,***
transition_1.Transition*vendor***FadeTransition*createAndroidAnimator***
transition_1.Transition*vendor*38207*28*FlipTransition*createAndroidAnimator***
transition.Transition*vendor*38323*28*SlideTransition*createAndroidAnimator,toString***
view_1.ContainerView*vendor***WebViewBase*_onLoadFinished,_onLoadStarted,,,loadStartedEvent,loadFinishedEvent***
android.webkit.WebViewClient*vendor*38597*32*WebViewClientImpl*shouldOverrideUrlLoading,onPageStarted,onPageFinished,onReceivedError***
web_view_common_1.WebViewBase*vendor***WebView*createNativeView,initNativeView,disposeNativeView,_loadUrl,_loadData,stopLoading,goBack,goForward,reload***
android.support.wear.widget.CircularProgressLayout.OnTimerFinishedListener*vendor*3921*37**onTimerFinished***
android.view.ViewTreeObserver.OnGlobalLayoutListener*vendor*6561*39**onGlobalLayout***
android.app.Application.ActivityLifecycleCallbacks*vendor*6570*30**onActivityCreated,onActivityDestroyed,onActivityPaused,onActivityResumed,onActivitySaveInstanceState,onActivityStarted,onActivityStopped***
android.content.ComponentCallbacks2*vendor*6616*30**onLowMemory,onTrimMemory,onConfigurationChanged***
org.nativescript.widgets.Async.CompleteCallback*vendor*11933*24**onComplete,onError***
java.lang.Runnable*vendor*16229*20**run***
java.lang.Runnable*vendor*16262*20**run***
android.view.View.OnClickListener*vendor*17010*67**onClick***
android.view.View.OnClickListener*vendor*17088*52**onClick***
android.animation.Animator.AnimatorListener*vendor*17613*35**onAnimationStart,onAnimationRepeat,onAnimationEnd,onAnimationCancel***
android.animation.ValueAnimator.AnimatorUpdateListener*vendor*17789*44**onAnimationUpdate***
android.view.View.OnLayoutChangeListener*vendor*23275*70**onLayoutChange***
android.content.DialogInterface.OnClickListener*vendor*24341*55**onClick***
android.content.DialogInterface.OnClickListener*vendor*24349*59**onClick***
android.content.DialogInterface.OnClickListener*vendor*24357*59**onClick***
android.content.DialogInterface.OnDismissListener*vendor*24364*32**onDismiss***
android.content.DialogInterface.OnClickListener*vendor*24375*61**onClick***
android.content.DialogInterface.OnDismissListener*vendor*24381*42**onDismiss***
android.content.DialogInterface.OnClickListener*vendor*24563*51**onClick***
android.content.DialogInterface.OnClickListener*vendor*24570*69**onClick***
android.content.DialogInterface.OnDismissListener*vendor*24577*42**onDismiss***
android.view.ViewTreeObserver.OnScrollChangedListener*vendor*31977*24**onScrollChanged***

sbg-input-file.txt:

/Users/bradmartin/projects/permobil-wear/apps/smartdrive-app/platforms/android/app/src/main/assets/app

sbg-js-parsed-files.txt:

/Users/bradmartin/projects/permobil-wear/apps/smartdrive-app/platforms/android/app/src/main/assets/app/bundle.js
/Users/bradmartin/projects/permobil-wear/apps/smartdrive-app/platforms/android/app/src/main/assets/app/vendor.js
/Users/bradmartin/projects/permobil-wear/apps/smartdrive-app/platforms/android/app/src/main/assets/app/starter.js
/Users/bradmartin/projects/permobil-wear/apps/smartdrive-app/platforms/android/app/src/main/assets/app/tns-java-classes.js

sbg-output-file.txt:

/Users/bradmartin/projects/permobil-wear/apps/smartdrive-app/platforms/android/app/src/main/java

I noticed the classes are listed in the sbg-bindings.txt.

The ComplicationTapBroadcastReceiver class is listed in the bundle.js and vendor.js. I don't know if that is causing an issue or why that's being handled that way.

bradmartin commented 5 years ago

The IOException being thrown is here: https://github.com/NativeScript/android-runtime/blob/2ab7271d12d56a03e57880a2b1783b08206363ae/test-app/build-tools/static-binding-generator/src/main/java/org/nativescript/staticbindinggenerator/Generator.java#L82 for quick reference

bradmartin commented 5 years ago

After looking over things, I started to think the problem is that the ComplicationTapBroadcastReceiver file is being put into the bundle.js and vendor.js so possibly the SBG is trying to process this file twice. Which maybe explains why I have the .java files in the android project, but the second time it processes that file it throws since it's already been generated.

That's currently where I'm at. I've tried various approaches with the code and changing the imports to see if I can change the way this is resolved in the app. I'll make a slimmed down project to see if I can repro it regardless of the environment and share.

bradmartin commented 5 years ago

So a new tsc project I've been able to get it to work πŸŽ‰ but that leaves the project issue.

The difference from what I can tell is the new project doesn't end up with the broadcast receiver file in the bundle.js, it's only in the vendor.js so the IOException doesn't get thrown.

Will see what I can find configuration wise .

bradmartin commented 5 years ago

Okay, so I have gotten it to throw in a clean template project. So it's not my project specifically.

It's the way the directory and imports were on the JavaProxy files, so webpack included the receiver in the bundle.js and vendor.js causing the issues.

Maybe an improvement can be made to the SBG process to handle these scenarios and not process it twice, because the code works just fine when I'm not webpacking.

bradmartin commented 5 years ago

Test project repo: https://github.com/bradmartin/sbg-issue-webpack-1306

Going to explain the steps to get SBG to throw and then NOT throw and build succeed:

If you run the project as is on the master branch, it will fail because the webpack.config is looking to resolve the two files (https://github.com/bradmartin/sbg-issue-webpack-1306/blob/master/webpack.config.js#L43) in the complications directory inside app 😒

 "app/complications/complication_provider_service.js"

If you change the webpack.config to resolve those files in the complications-working directory inside the app it will succeed πŸŽ‰

 "app/complications-working/complication_provider_service.js"
bradmartin commented 5 years ago

Changes to the files between the directories are nothing major. Just no longer importing an enum and a method from one file to the other. So moving the enum to its own file and the method just being declared where needed. Then the receiver file doesn't end up in bundle.js.

bradmartin commented 5 years ago

Using the complications-working directory in my project also resolves the issue since the receiver class is no longer being put into bundle.js causing SBG to try and process it twice πŸ‘