Popular New Releases in Camera
react-native-camera
v4.2.1
react-native-camera
v3.39.0
librealsense
Intel® RealSense™ SDK 2.0 (v2.50.0)
ParticleEffectForUGUI
3.3.10
webcamoid
9.0.0
Popular Libraries in Camera
by react-native-camera java
9549 NOASSERTION
A Camera component for React Native. Also supports barcode scanning!
by react-native-community java
8645 NOASSERTION
A Camera component for React Native. Also supports barcode scanning!
by IntelRealSense c++
5902 NOASSERTION
Intel® RealSense™ SDK
by CameraKit java
5077 MIT
Library for Android Camera 1 and 2 APIs. Massively increase stability and reliability of photo and video capture on all Android devices.
by wuhaoyu1990 java
5065
Real-time Filter Camera&VideoRecorder And ImageEditor With Face Beauty For Android---包含美颜等40余种实时滤镜相机,可拍照、录像、图片修改
by google java
4732 Apache-2.0
[DEPRECATED] Easily integrate Camera features into your Android app
by begeekmyfriend c
4482 MIT
RTMP live streaming client for Android
by RedApparat kotlin
3669 Apache-2.0
Making Camera for Android more friendly. 📸
by auduno javascript
3650
Javascript library for headtracking via webcam and WebRTC/getUserMedia
Trending New libraries in Camera
by googlevr csharp
1859 Apache-2.0
by AlexxIT javascript
513
Home Assistant custom component for viewing IP cameras RTSP stream in real time using WebRTC and MSE technology
by sdushantha shell
393 MIT
Recover old Snaps that have “disappeared” from Snapchat
by thirtythreeforty rust
389 AGPL-3.0
An RTSP bridge to Reolink IP cameras
by roleoroleo shell
340 MIT
Custom firmware for Yi 1080p camera based on Allwinner platform
by roleoroleo shell
305 MIT
Custom firmware for Yi 1080p camera based on Allwinner platform
by keijiro csharp
276 Unlicense
Remote depth camera with iPad Pro with LiDAR sensor
by tumblr swift
236 MPL-2.0
Kanvas: a creation tool for iOS
by letmaik c++
216 GPL-2.0
🎥 Send frames to a virtual camera from Python
Top Authors in Camera
1
11 Libraries
569
2
7 Libraries
92
3
6 Libraries
1295
4
6 Libraries
571
5
5 Libraries
87
6
4 Libraries
43
7
4 Libraries
23
8
4 Libraries
978
9
4 Libraries
63
10
4 Libraries
28
1
11 Libraries
569
2
7 Libraries
92
3
6 Libraries
1295
4
6 Libraries
571
5
5 Libraries
87
6
4 Libraries
43
7
4 Libraries
23
8
4 Libraries
978
9
4 Libraries
63
10
4 Libraries
28
Trending Kits in Camera
No Trending Kits are available at this moment for Camera
Trending Discussions on Camera
Error: require() of ES modules is not supported when importing node-fetch
Android Studio - Unable to capture video from Camera
PlatformException(multiple_request, Cancelled by a second request, null, null) in imagePicker
IndexError: tuple index out of range when I try to create an executable from a python script using auto-py-to-exe
android:exported needs to be explicitly specified for <activity>. Apps targeting Android 12 and higher are required to specify
CameraX is not configured properly. The most likely cause is you did not include a default implementation in your build such as 'camera-camera2
uploaded an APK which has an activity,activity alias,service or broadcast receiver with intentfilter, but without 'android : exported' property set
flutter permission Handler grant not showing on iOS
Execution failed for task ':camera:compileDebugJavaWithJavac'
Expo SDK 44 upgrade ERROR - App.js: [BABEL]: Unexpected token '.'
QUESTION
Error: require() of ES modules is not supported when importing node-fetch
Asked 2022-Mar-28 at 07:04I'm creating a program to analyze security camera streams and got stuck on the very first line. At the moment my .js file has nothing but the import of node-fetch and it gives me an error message. What am I doing wrong?
Running Ubuntu 20.04.2 LTS in Windows Subsystem for Linux.
Node version:
1user@MYLLYTIN:~/CAMSERVER$ node -v
2v14.17.6
3
node-fetch package version:
1user@MYLLYTIN:~/CAMSERVER$ node -v
2v14.17.6
3user@MYLLYTIN:~/CAMSERVER$ npm v node-fetch
4
5node-fetch@3.0.0 | MIT | deps: 2 | versions: 63
6A light-weight module that brings Fetch API to node.js
7https://github.com/node-fetch/node-fetch
8
9keywords: fetch, http, promise, request, curl, wget, xhr, whatwg
10
11dist
12.tarball: https://registry.npmjs.org/node-fetch/-/node-fetch-3.0.0.tgz
13.shasum: 79da7146a520036f2c5f644e4a26095f17e411ea
14.integrity: sha512-bKMI+C7/T/SPU1lKnbQbwxptpCrG9ashG+VkytmXCPZyuM9jB6VU+hY0oi4lC8LxTtAeWdckNCTa3nrGsAdA3Q==
15.unpackedSize: 75.9 kB
16
17dependencies:
18data-uri-to-buffer: ^3.0.1 fetch-blob: ^3.1.2
19
20maintainers:
21- endless <jimmy@warting.se>
22- bitinn <bitinn@gmail.com>
23- timothygu <timothygu99@gmail.com>
24- akepinski <npm@kepinski.ch>
25
26dist-tags:
27latest: 3.0.0 next: 3.0.0-beta.10
28
29published 3 days ago by endless <jimmy@warting.se>
30
esm package version:
1user@MYLLYTIN:~/CAMSERVER$ node -v
2v14.17.6
3user@MYLLYTIN:~/CAMSERVER$ npm v node-fetch
4
5node-fetch@3.0.0 | MIT | deps: 2 | versions: 63
6A light-weight module that brings Fetch API to node.js
7https://github.com/node-fetch/node-fetch
8
9keywords: fetch, http, promise, request, curl, wget, xhr, whatwg
10
11dist
12.tarball: https://registry.npmjs.org/node-fetch/-/node-fetch-3.0.0.tgz
13.shasum: 79da7146a520036f2c5f644e4a26095f17e411ea
14.integrity: sha512-bKMI+C7/T/SPU1lKnbQbwxptpCrG9ashG+VkytmXCPZyuM9jB6VU+hY0oi4lC8LxTtAeWdckNCTa3nrGsAdA3Q==
15.unpackedSize: 75.9 kB
16
17dependencies:
18data-uri-to-buffer: ^3.0.1 fetch-blob: ^3.1.2
19
20maintainers:
21- endless <jimmy@warting.se>
22- bitinn <bitinn@gmail.com>
23- timothygu <timothygu99@gmail.com>
24- akepinski <npm@kepinski.ch>
25
26dist-tags:
27latest: 3.0.0 next: 3.0.0-beta.10
28
29published 3 days ago by endless <jimmy@warting.se>
30user@MYLLYTIN:~/CAMSERVER$ npm v esm
31
32esm@3.2.25 | MIT | deps: none | versions: 140
33Tomorrow's ECMAScript modules today!
34https://github.com/standard-things/esm#readme
35
36keywords: commonjs, ecmascript, export, import, modules, node, require
37
38dist
39.tarball: https://registry.npmjs.org/esm/-/esm-3.2.25.tgz
40.shasum: 342c18c29d56157688ba5ce31f8431fbb795cc10
41.integrity: sha512-U1suiZ2oDVWv4zPO56S0NcR5QriEahGtdN2OR6FiOG4WJvcjBVFB0qI4+eKoWFH483PKGuLuu6V8Z4T5g63UVA==
42.unpackedSize: 308.6 kB
43
44maintainers:
45- jdalton <john.david.dalton@gmail.com>
46
47dist-tags:
48latest: 3.2.25
49
50published over a year ago by jdalton <john.david.dalton@gmail.com>
51
Contents of the .js file (literally nothing but the import):
1user@MYLLYTIN:~/CAMSERVER$ node -v
2v14.17.6
3user@MYLLYTIN:~/CAMSERVER$ npm v node-fetch
4
5node-fetch@3.0.0 | MIT | deps: 2 | versions: 63
6A light-weight module that brings Fetch API to node.js
7https://github.com/node-fetch/node-fetch
8
9keywords: fetch, http, promise, request, curl, wget, xhr, whatwg
10
11dist
12.tarball: https://registry.npmjs.org/node-fetch/-/node-fetch-3.0.0.tgz
13.shasum: 79da7146a520036f2c5f644e4a26095f17e411ea
14.integrity: sha512-bKMI+C7/T/SPU1lKnbQbwxptpCrG9ashG+VkytmXCPZyuM9jB6VU+hY0oi4lC8LxTtAeWdckNCTa3nrGsAdA3Q==
15.unpackedSize: 75.9 kB
16
17dependencies:
18data-uri-to-buffer: ^3.0.1 fetch-blob: ^3.1.2
19
20maintainers:
21- endless <jimmy@warting.se>
22- bitinn <bitinn@gmail.com>
23- timothygu <timothygu99@gmail.com>
24- akepinski <npm@kepinski.ch>
25
26dist-tags:
27latest: 3.0.0 next: 3.0.0-beta.10
28
29published 3 days ago by endless <jimmy@warting.se>
30user@MYLLYTIN:~/CAMSERVER$ npm v esm
31
32esm@3.2.25 | MIT | deps: none | versions: 140
33Tomorrow's ECMAScript modules today!
34https://github.com/standard-things/esm#readme
35
36keywords: commonjs, ecmascript, export, import, modules, node, require
37
38dist
39.tarball: https://registry.npmjs.org/esm/-/esm-3.2.25.tgz
40.shasum: 342c18c29d56157688ba5ce31f8431fbb795cc10
41.integrity: sha512-U1suiZ2oDVWv4zPO56S0NcR5QriEahGtdN2OR6FiOG4WJvcjBVFB0qI4+eKoWFH483PKGuLuu6V8Z4T5g63UVA==
42.unpackedSize: 308.6 kB
43
44maintainers:
45- jdalton <john.david.dalton@gmail.com>
46
47dist-tags:
48latest: 3.2.25
49
50published over a year ago by jdalton <john.david.dalton@gmail.com>
51user@MYLLYTIN:~/CAMSERVER$ cat server.js
52import fetch from "node-fetch";
53
Result:
1user@MYLLYTIN:~/CAMSERVER$ node -v
2v14.17.6
3user@MYLLYTIN:~/CAMSERVER$ npm v node-fetch
4
5node-fetch@3.0.0 | MIT | deps: 2 | versions: 63
6A light-weight module that brings Fetch API to node.js
7https://github.com/node-fetch/node-fetch
8
9keywords: fetch, http, promise, request, curl, wget, xhr, whatwg
10
11dist
12.tarball: https://registry.npmjs.org/node-fetch/-/node-fetch-3.0.0.tgz
13.shasum: 79da7146a520036f2c5f644e4a26095f17e411ea
14.integrity: sha512-bKMI+C7/T/SPU1lKnbQbwxptpCrG9ashG+VkytmXCPZyuM9jB6VU+hY0oi4lC8LxTtAeWdckNCTa3nrGsAdA3Q==
15.unpackedSize: 75.9 kB
16
17dependencies:
18data-uri-to-buffer: ^3.0.1 fetch-blob: ^3.1.2
19
20maintainers:
21- endless <jimmy@warting.se>
22- bitinn <bitinn@gmail.com>
23- timothygu <timothygu99@gmail.com>
24- akepinski <npm@kepinski.ch>
25
26dist-tags:
27latest: 3.0.0 next: 3.0.0-beta.10
28
29published 3 days ago by endless <jimmy@warting.se>
30user@MYLLYTIN:~/CAMSERVER$ npm v esm
31
32esm@3.2.25 | MIT | deps: none | versions: 140
33Tomorrow's ECMAScript modules today!
34https://github.com/standard-things/esm#readme
35
36keywords: commonjs, ecmascript, export, import, modules, node, require
37
38dist
39.tarball: https://registry.npmjs.org/esm/-/esm-3.2.25.tgz
40.shasum: 342c18c29d56157688ba5ce31f8431fbb795cc10
41.integrity: sha512-U1suiZ2oDVWv4zPO56S0NcR5QriEahGtdN2OR6FiOG4WJvcjBVFB0qI4+eKoWFH483PKGuLuu6V8Z4T5g63UVA==
42.unpackedSize: 308.6 kB
43
44maintainers:
45- jdalton <john.david.dalton@gmail.com>
46
47dist-tags:
48latest: 3.2.25
49
50published over a year ago by jdalton <john.david.dalton@gmail.com>
51user@MYLLYTIN:~/CAMSERVER$ cat server.js
52import fetch from "node-fetch";
53user@MYLLYTIN:~/CAMSERVER$ node -r esm server.js
54/home/user/CAMSERVER/node_modules/node-fetch/src/index.js:1
55Error [ERR_REQUIRE_ESM]: Must use import to load ES Module: /home/user/CAMSERVER/node_modules/node-fetch/src/index.js
56require() of ES modules is not supported.
57require() of /home/user/CAMSERVER/node_modules/node-fetch/src/index.js from /home/user/CAMSERVER/server.js is an ES module file as it is a .js file whose nearest parent package.json contains "type": "module" which defines all .js files in that package scope as ES modules.
58Instead rename index.js to end in .cjs, change the requiring code to use import(), or remove "type": "module" from /home/user/CAMSERVER/node_modules/node-fetch/package.json.
59
60 at Object.Module._extensions..js (internal/modules/cjs/loader.js:1089:13) {
61 code: 'ERR_REQUIRE_ESM'
62}
63user@MYLLYTIN:~/CAMSERVER$
64
ANSWER
Answered 2022-Feb-25 at 00:00Use ESM syntax, also use one of these methods before running the file.
- specify
"type":"module"
inpackage.json
- Or use this flag
--input-type=module
when running the file - Or use
.mjs
file extension
QUESTION
Android Studio - Unable to capture video from Camera
Asked 2022-Mar-23 at 22:41I am trying to capture video via Gallery or via Camera. I am able to successfully fetch the video from Gallery. However when I try to record the video from camera it loses the track and I am unable to fetch the path. It does save the video on path. The log give following error/warning. Why is is losing track of the video recorder? Where am I going wrong?
12022-03-15 07:32:08.683 14318-14318/com.example.locationfetcher_v2 W/MirrorManager: this model don't Support
22022-03-15 07:32:13.864 14318-14318/com.example.locationfetcher_v2 D/DecorView: createDecorCaptionView windowingMode:1 mWindowMode 1 isFullscreen: true
32022-03-15 07:32:14.875 14318-14318/com.example.locationfetcher_v2 I/Timeline: Timeline: Activity_launch_request time:174742145
42022-03-15 07:32:14.912 14318-14395/com.example.locationfetcher_v2 D/OpenGLRenderer: endAllActiveAnimators on 0xb400007e4ade6e00 (AlertController$RecycleListView) with handle 0xb400007e52639220
52022-03-15 07:32:20.913 14318-14339/com.example.locationfetcher_v2 W/System: A resource failed to call close
6
Here is my code:
12022-03-15 07:32:08.683 14318-14318/com.example.locationfetcher_v2 W/MirrorManager: this model don't Support
22022-03-15 07:32:13.864 14318-14318/com.example.locationfetcher_v2 D/DecorView: createDecorCaptionView windowingMode:1 mWindowMode 1 isFullscreen: true
32022-03-15 07:32:14.875 14318-14318/com.example.locationfetcher_v2 I/Timeline: Timeline: Activity_launch_request time:174742145
42022-03-15 07:32:14.912 14318-14395/com.example.locationfetcher_v2 D/OpenGLRenderer: endAllActiveAnimators on 0xb400007e4ade6e00 (AlertController$RecycleListView) with handle 0xb400007e52639220
52022-03-15 07:32:20.913 14318-14339/com.example.locationfetcher_v2 W/System: A resource failed to call close
6public void showPictureDialog(View view){
7 AlertDialog.Builder pictureDialog = new AlertDialog.Builder(this);
8 pictureDialog.setTitle("Select Action");
9 String[] pictureDialogItems = {
10 "Select video from gallery",
11 "Record video from camera" };
12 pictureDialog.setItems(pictureDialogItems,
13 new DialogInterface.OnClickListener() {
14 @Override
15 public void onClick(DialogInterface dialog, int which) {
16 switch (which) {
17 case 0:
18 chooseVideoFromGallery();
19 break;
20 case 1:
21 takeVideoFromCamera();
22 break;
23 }
24 }
25 });
26 pictureDialog.show();
27 }
28
29
30 public void chooseVideoFromGallery() {
31 Intent galleryIntent = new Intent(Intent.ACTION_PICK,
32 android.provider.MediaStore.Video.Media.EXTERNAL_CONTENT_URI);
33
34 startActivityForResult(galleryIntent, PICK_VIDEO_GALLERY);
35 }
36
37 private void takeVideoFromCamera() {
38 Intent intent = new Intent(MediaStore.ACTION_VIDEO_CAPTURE);
39 intent.putExtra(MediaStore.EXTRA_VIDEO_QUALITY, 1);
40 startActivity(intent);
41 }
42
43 public String getPath(Uri uri) {
44 String[] projection = { MediaStore.Video.Media.DATA };
45 Cursor cursor = getContentResolver().query(uri, projection, null, null, null);
46 if (cursor != null) {
47 // HERE YOU WILL GET A NULLPOINTER IF CURSOR IS NULL
48 // THIS CAN BE, IF YOU USED OI FILE MANAGER FOR PICKING THE MEDIA
49 int column_index = cursor
50 .getColumnIndexOrThrow(MediaStore.Video.Media.DATA);
51 cursor.moveToFirst();
52 return cursor.getString(column_index);
53 } else
54 return null;
55 }
56
57 private void saveVideoToInternalStorage (String filePath) {
58
59 File newfile;
60
61 try {
62
63 File currentFile = new File(filePath);
64// show_notification("New File Video:" + Environment.getExternalStorageDirectory());
65 File wallpaperDirectory = new File(Environment.getExternalStorageDirectory() + VIDEO_DIRECTORY);
66 newfile = new File(wallpaperDirectory, Calendar.getInstance().getTimeInMillis() + ".mp4");
67
68 if (!wallpaperDirectory.exists()) {
69 wallpaperDirectory.mkdirs();
70 }
71
72 if(currentFile.exists()){
73
74 InputStream in = new FileInputStream(currentFile);
75 OutputStream out = new FileOutputStream(newfile);
76
77 // Copy the bits from instream to outstream
78 byte[] buf = new byte[1024];
79 int len;
80
81 while ((len = in.read(buf)) > 0) {
82 out.write(buf, 0, len);
83 }
84 in.close();
85 out.close();
86 show_notification("Video file saved successfully.");
87 }else{
88 show_notification("Video saving failed. Source file missing.");
89 }
90 } catch (Exception e) {
91 show_notification(e.toString());
92 e.printStackTrace();
93 }
94
95@RequiresApi(api = Build.VERSION_CODES.Q)
96 @Override
97 public void onActivityResult(int requestCode, int resultCode, Intent data) {
98 super.onActivityResult(requestCode, resultCode, data);
99 inputStreamImg = null;
100 if (requestCode == PICK_VIDEO_GALLERY){
101 if (data != null) {
102 Uri contentURI = data.getData();
103
104 String selectedVideoPath = getPath(contentURI);
105 Log.d("path",selectedVideoPath);
106// show_notification("Saving...");
107 saveVideoToInternalStorage(selectedVideoPath);
108 vidView.setVideoURI(contentURI);
109 vidView.requestFocus();
110 vidView.start();
111 videoPath = selectedVideoPath;
112 show_notification("video Gallery - " + videoPath);
113 } else if (requestCode == PICK_VIDEO_CAMERA) {
114 Uri contentURI = data.getData();
115 show_notification(contentURI.getPath());
116 String recordedVideoPath = getPath(contentURI);
117 show_notification(recordedVideoPath);
118 saveVideoToInternalStorage(recordedVideoPath);
119
120 videoPath = recordedVideoPath;
121
122 vidView.setVideoURI(contentURI);
123 vidView.requestFocus();
124 vidView.start();
125 show_notification("video Camera - " + videoPath);
126 }
127 }
128 }
129
ANSWER
Answered 2022-Mar-22 at 18:12I don't know if it will help but maybe you should do startActivityForResult or ActivtyResultLauncher. I would comment that if I had enough reputation.
QUESTION
PlatformException(multiple_request, Cancelled by a second request, null, null) in imagePicker
Asked 2022-Mar-21 at 21:48I am using a riverpod provider class to handle picking of image from gallery. However, once an image is picked, I get the error: PlatformException(multiple_request, Cancelled by a second request null, null). Not sure where a second request is coming from. More importantly, no image is applied to my placeholder (CircleAvartar) due to this unknown cancellation. Here are the two dart files in question and thanks for the help.
imageProvider file:
1final myImageProvider =
2 ChangeNotifierProvider<ImageNotifier>((ref) => ImageNotifier());
3
4class ImageNotifier extends ChangeNotifier {
5 ImageNotifier() : super();
6 final file = useState<File?>(null);
7 final imageFile = useState<XFile?>(null);
8 final imagePicker = ImagePicker();
9
10 Future<void> _pickImage(int type) async {
11 try {
12 XFile? userImage = await imagePicker.pickImage(
13 source: type == 1 ? ImageSource.gallery : ImageSource.camera,
14 imageQuality: 50,
15 );
16 imageFile.value = userImage;
17 // imageFile.value = XFile(userImage!.path);
18 } catch (e) {
19 print(e);
20 }
21 notifyListeners();
22 }
23
24 void showPicker(context) {
25 showModalBottomSheet(
26 backgroundColor: Theme.of(context).primaryColor,
27 context: context,
28 builder: (BuildContext bc) {
29 return SafeArea(
30 child: Wrap(
31 children: [
32 ListTile(
33 leading: const Icon(
34 Icons.photo_library,
35 color: Colors.white,
36 ),
37 title: const Text(
38 'Photo Gallery',
39 style: TextStyle(fontSize: 22),
40 ),
41 onTap: () => _pickImage(1),
42 ),
43 ListTile(
44 leading: const Icon(
45 Icons.photo_camera,
46 color: Colors.white,
47 ),
48 title: const Text(
49 'Camera',
50 style: TextStyle(fontSize: 22),
51 ),
52 onTap: () => _pickImage(2),
53 ),
54 ListTile(
55 leading: const Icon(
56 Icons.close,
57 color: Colors.white,
58 ),
59 title: const Text(
60 'Cancel',
61 style: TextStyle(fontSize: 22),
62 ),
63 onTap: () {
64 imageFile.value = null;
65 Navigator.of(context).pop();
66 },
67 ),
68 ],
69 ),
70 );
71 },
72 );
73 notifyListeners();
74 }
75
AuthScreen dart file:
1final myImageProvider =
2 ChangeNotifierProvider<ImageNotifier>((ref) => ImageNotifier());
3
4class ImageNotifier extends ChangeNotifier {
5 ImageNotifier() : super();
6 final file = useState<File?>(null);
7 final imageFile = useState<XFile?>(null);
8 final imagePicker = ImagePicker();
9
10 Future<void> _pickImage(int type) async {
11 try {
12 XFile? userImage = await imagePicker.pickImage(
13 source: type == 1 ? ImageSource.gallery : ImageSource.camera,
14 imageQuality: 50,
15 );
16 imageFile.value = userImage;
17 // imageFile.value = XFile(userImage!.path);
18 } catch (e) {
19 print(e);
20 }
21 notifyListeners();
22 }
23
24 void showPicker(context) {
25 showModalBottomSheet(
26 backgroundColor: Theme.of(context).primaryColor,
27 context: context,
28 builder: (BuildContext bc) {
29 return SafeArea(
30 child: Wrap(
31 children: [
32 ListTile(
33 leading: const Icon(
34 Icons.photo_library,
35 color: Colors.white,
36 ),
37 title: const Text(
38 'Photo Gallery',
39 style: TextStyle(fontSize: 22),
40 ),
41 onTap: () => _pickImage(1),
42 ),
43 ListTile(
44 leading: const Icon(
45 Icons.photo_camera,
46 color: Colors.white,
47 ),
48 title: const Text(
49 'Camera',
50 style: TextStyle(fontSize: 22),
51 ),
52 onTap: () => _pickImage(2),
53 ),
54 ListTile(
55 leading: const Icon(
56 Icons.close,
57 color: Colors.white,
58 ),
59 title: const Text(
60 'Cancel',
61 style: TextStyle(fontSize: 22),
62 ),
63 onTap: () {
64 imageFile.value = null;
65 Navigator.of(context).pop();
66 },
67 ),
68 ],
69 ),
70 );
71 },
72 );
73 notifyListeners();
74 }
75Widget build(BuildContext context, WidgetRef ref) {
76 final _passwordController = useTextEditingController();
77 final _passwordFocusScope = useFocusNode();
78 final _emailFocusScope = useFocusNode();
79 final _phoneFocusScope = useFocusNode();
80 final _confirmFocusScope = useFocusNode();
81 final _isVisible = useState<bool>(true);
82 var _authMode = useState<AuthMode>(AuthMode.login);
83 final imageProviderState = ref.watch(myImageProvider.notifier);
84 final deviceSize = MediaQuery.of(context).size;
85 final authMode = ModalRoute.of(context)?.settings.arguments as String;
86
87 switch (authMode) {
88 case 'login':
89 _authMode.value = AuthMode.login;
90 break;
91 case 'register':
92 _authMode.value = AuthMode.register;
93 break;
94 case 'google':
95 _authMode.value = AuthMode.google;
96 break;
97 case 'guest':
98 _authMode.value = AuthMode.guest;
99 break;
100 }
101
102 return Scaffold(
103 body: Stack(
104 children: [
105
106 Padding(
107 padding: const EdgeInsets.all(8.0),
108 child: Form(
109 key: _formKey,
110 child: SingleChildScrollView(
111 child: Column(
112 mainAxisAlignment: MainAxisAlignment.start,
113 children: [
114 const SizedBox(
115 height: 80,
116 ),
117 Center(
118 child: _authMode.value == AuthMode.login
119 ? const Text(
120 'Access Your Account',
121 style: TextStyle(
122 fontSize: 25,
123 ),
124 )
125 : Row(
126 children: [
127 InkWell(
128 onTap: () =>
129 imageProviderState.showPicker(context),
130 // () => ref
131 // .read(myImageProvider.notifier)
132 // .showPicker(context),
133 child: CircleAvatar(
134 radius: 50,
135 backgroundImage:
136 imageProviderState.imageFile.value !=
137 null
138 ? FileImage(
139 // File(ref
140 // .read(imageProvider.notifier)
141 // .imageFile
142 // .value!
143 // .path),
144 // )
145 File(imageProviderState
146 .imageFile.value!.path),
147 )
148 : null,
149 child: imageProviderState.imageFile.value ==
150 null
151 ? const Icon(
152 Icons.camera,
153 // Icons.add_photo_alternate,
154 size: 30,
155 color: Colors.white,
156 )
157 : null,
158 ),
159 ),
160
ANSWER
Answered 2022-Mar-03 at 15:00Hi please have a look at this discussion: https://github.com/flutter/flutter/issues/70436
- on on the image picker package site we can see that it is a well known apple simulator issue. I would say that it should work for you on real devices (or try to test it only with particular pictures from iOS simulator photos)
QUESTION
IndexError: tuple index out of range when I try to create an executable from a python script using auto-py-to-exe
Asked 2022-Feb-24 at 15:03I have been trying out an open-sourced personal AI assistant script. The script works fine but I want to create an executable so that I can gift the executable to one of my friends. However, when I try to create the executable using the auto-py-to-exe, it states the below error:
1Running auto-py-to-exe v2.10.1
2Building directory: C:\Users\Tarun\AppData\Local\Temp\tmpjaw1ky1x
3Provided command: pyinstaller --noconfirm --onedir --console --no-embed-manifest "C:/Users/Tarun/AppData/Local/Programs/Python/Python310/AI_Ass.py"
4Recursion Limit is set to 5000
5Executing: pyinstaller --noconfirm --onedir --console --no-embed-manifest C:/Users/Tarun/AppData/Local/Programs/Python/Python310/AI_Ass.py --distpath C:\Users\Tarun\AppData\Local\Temp\tmpjaw1ky1x\application --workpath C:\Users\Tarun\AppData\Local\Temp\tmpjaw1ky1x\build --specpath C:\Users\Tarun\AppData\Local\Temp\tmpjaw1ky1x
6
742681 INFO: PyInstaller: 4.6
842690 INFO: Python: 3.10.0
942732 INFO: Platform: Windows-10-10.0.19042-SP0
1042744 INFO: wrote C:\Users\Tarun\AppData\Local\Temp\tmpjaw1ky1x\AI_Ass.spec
1142764 INFO: UPX is not available.
1242772 INFO: Extending PYTHONPATH with paths
13['C:\\Users\\Tarun\\AppData\\Local\\Programs\\Python\\Python310']
1443887 INFO: checking Analysis
1543891 INFO: Building Analysis because Analysis-00.toc is non existent
1643895 INFO: Initializing module dependency graph...
1743915 INFO: Caching module graph hooks...
1843975 INFO: Analyzing base_library.zip ...
1954298 INFO: Processing pre-find module path hook distutils from 'C:\\Users\\Tarun\\AppData\\Local\\Programs\\Python\\Python310\\lib\\site-packages\\PyInstaller\\hooks\\pre_find_module_path\\hook-distutils.py'.
2054306 INFO: distutils: retargeting to non-venv dir 'C:\\Users\\Tarun\\AppData\\Local\\Programs\\Python\\Python310\\lib'
2157474 INFO: Caching module dependency graph...
2258088 INFO: running Analysis Analysis-00.toc
2358132 INFO: Adding Microsoft.Windows.Common-Controls to dependent assemblies of final executable
24 required by C:\Users\Tarun\AppData\Local\Programs\Python\Python310\python.exe
2558365 INFO: Analyzing C:\Users\Tarun\AppData\Local\Programs\Python\Python310\AI_Ass.py
2659641 INFO: Processing pre-safe import module hook urllib3.packages.six.moves from 'C:\\Users\\Tarun\\AppData\\Local\\Programs\\Python\\Python310\\lib\\site-packages\\PyInstaller\\hooks\\pre_safe_import_module\\hook-urllib3.packages.six.moves.py'.
27An error occurred while packaging
28Traceback (most recent call last):
29 File "C:\Users\Tarun\AppData\Local\Programs\Python\Python310\lib\site-packages\auto_py_to_exe\packaging.py", line 131, in package
30 run_pyinstaller()
31 File "C:\Users\Tarun\AppData\Local\Programs\Python\Python310\lib\site-packages\PyInstaller\__main__.py", line 124, in run
32 run_build(pyi_config, spec_file, **vars(args))
33 File "C:\Users\Tarun\AppData\Local\Programs\Python\Python310\lib\site-packages\PyInstaller\__main__.py", line 58, in run_build
34 PyInstaller.building.build_main.main(pyi_config, spec_file, **kwargs)
35 File "C:\Users\Tarun\AppData\Local\Programs\Python\Python310\lib\site-packages\PyInstaller\building\build_main.py", line 782, in main
36 build(specfile, kw.get('distpath'), kw.get('workpath'), kw.get('clean_build'))
37 File "C:\Users\Tarun\AppData\Local\Programs\Python\Python310\lib\site-packages\PyInstaller\building\build_main.py", line 714, in build
38 exec(code, spec_namespace)
39 File "C:\Users\Tarun\AppData\Local\Temp\tmpjaw1ky1x\AI_Ass.spec", line 7, in <module>
40 a = Analysis(['C:/Users/Tarun/AppData/Local/Programs/Python/Python310/AI_Ass.py'],
41 File "C:\Users\Tarun\AppData\Local\Programs\Python\Python310\lib\site-packages\PyInstaller\building\build_main.py", line 277, in __init__
42 self.__postinit__()
43 File "C:\Users\Tarun\AppData\Local\Programs\Python\Python310\lib\site-packages\PyInstaller\building\datastruct.py", line 155, in __postinit__
44 self.assemble()
45 File "C:\Users\Tarun\AppData\Local\Programs\Python\Python310\lib\site-packages\PyInstaller\building\build_main.py", line 439, in assemble
46 priority_scripts.append(self.graph.add_script(script))
47 File "C:\Users\Tarun\AppData\Local\Programs\Python\Python310\lib\site-packages\PyInstaller\depend\analysis.py", line 265, in add_script
48 self._top_script_node = super().add_script(pathname)
49 File "C:\Users\Tarun\AppData\Local\Programs\Python\Python310\lib\site-packages\PyInstaller\lib\modulegraph\modulegraph.py", line 1433, in add_script
50 self._process_imports(n)
51 File "C:\Users\Tarun\AppData\Local\Programs\Python\Python310\lib\site-packages\PyInstaller\lib\modulegraph\modulegraph.py", line 2850, in _process_imports
52 target_module = self._safe_import_hook(*import_info, **kwargs)[0]
53 File "C:\Users\Tarun\AppData\Local\Programs\Python\Python310\lib\site-packages\PyInstaller\lib\modulegraph\modulegraph.py", line 2301, in _safe_import_hook
54 target_modules = self.import_hook(
55 File "C:\Users\Tarun\AppData\Local\Programs\Python\Python310\lib\site-packages\PyInstaller\lib\modulegraph\modulegraph.py", line 1505, in import_hook
56 target_package, target_module_partname = self._find_head_package(
57 File "C:\Users\Tarun\AppData\Local\Programs\Python\Python310\lib\site-packages\PyInstaller\lib\modulegraph\modulegraph.py", line 1684, in _find_head_package
58 target_package = self._safe_import_module(
59 File "C:\Users\Tarun\AppData\Local\Programs\Python\Python310\lib\site-packages\PyInstaller\depend\analysis.py", line 387, in _safe_import_module
60 return super()._safe_import_module(module_basename, module_name, parent_package)
61 File "C:\Users\Tarun\AppData\Local\Programs\Python\Python310\lib\site-packages\PyInstaller\lib\modulegraph\modulegraph.py", line 2062, in _safe_import_module
62 self._process_imports(n)
63 File "C:\Users\Tarun\AppData\Local\Programs\Python\Python310\lib\site-packages\PyInstaller\lib\modulegraph\modulegraph.py", line 2850, in _process_imports
64 target_module = self._safe_import_hook(*import_info, **kwargs)[0]
65 File "C:\Users\Tarun\AppData\Local\Programs\Python\Python310\lib\site-packages\PyInstaller\lib\modulegraph\modulegraph.py", line 2301, in _safe_import_hook
66 target_modules = self.import_hook(
67 File "C:\Users\Tarun\AppData\Local\Programs\Python\Python310\lib\site-packages\PyInstaller\lib\modulegraph\modulegraph.py", line 1505, in import_hook
68 target_package, target_module_partname = self._find_head_package(
69 File "C:\Users\Tarun\AppData\Local\Programs\Python\Python310\lib\site-packages\PyInstaller\lib\modulegraph\modulegraph.py", line 1684, in _find_head_package
70 target_package = self._safe_import_module(
71 File "C:\Users\Tarun\AppData\Local\Programs\Python\Python310\lib\site-packages\PyInstaller\depend\analysis.py", line 387, in _safe_import_module
72 return super()._safe_import_module(module_basename, module_name, parent_package)
73 File "C:\Users\Tarun\AppData\Local\Programs\Python\Python310\lib\site-packages\PyInstaller\lib\modulegraph\modulegraph.py", line 2062, in _safe_import_module
74 self._process_imports(n)
75 File "C:\Users\Tarun\AppData\Local\Programs\Python\Python310\lib\site-packages\PyInstaller\lib\modulegraph\modulegraph.py", line 2850, in _process_imports
76 target_module = self._safe_import_hook(*import_info, **kwargs)[0]
77 File "C:\Users\Tarun\AppData\Local\Programs\Python\Python310\lib\site-packages\PyInstaller\lib\modulegraph\modulegraph.py", line 2301, in _safe_import_hook
78 target_modules = self.import_hook(
79 File "C:\Users\Tarun\AppData\Local\Programs\Python\Python310\lib\site-packages\PyInstaller\lib\modulegraph\modulegraph.py", line 1505, in import_hook
80 target_package, target_module_partname = self._find_head_package(
81 File "C:\Users\Tarun\AppData\Local\Programs\Python\Python310\lib\site-packages\PyInstaller\lib\modulegraph\modulegraph.py", line 1684, in _find_head_package
82 target_package = self._safe_import_module(
83 File "C:\Users\Tarun\AppData\Local\Programs\Python\Python310\lib\site-packages\PyInstaller\depend\analysis.py", line 387, in _safe_import_module
84 return super()._safe_import_module(module_basename, module_name, parent_package)
85 File "C:\Users\Tarun\AppData\Local\Programs\Python\Python310\lib\site-packages\PyInstaller\lib\modulegraph\modulegraph.py", line 2062, in _safe_import_module
86 self._process_imports(n)
87 File "C:\Users\Tarun\AppData\Local\Programs\Python\Python310\lib\site-packages\PyInstaller\lib\modulegraph\modulegraph.py", line 2850, in _process_imports
88 target_module = self._safe_import_hook(*import_info, **kwargs)[0]
89 File "C:\Users\Tarun\AppData\Local\Programs\Python\Python310\lib\site-packages\PyInstaller\lib\modulegraph\modulegraph.py", line 2301, in _safe_import_hook
90 target_modules = self.import_hook(
91 File "C:\Users\Tarun\AppData\Local\Programs\Python\Python310\lib\site-packages\PyInstaller\lib\modulegraph\modulegraph.py", line 1505, in import_hook
92 target_package, target_module_partname = self._find_head_package(
93 File "C:\Users\Tarun\AppData\Local\Programs\Python\Python310\lib\site-packages\PyInstaller\lib\modulegraph\modulegraph.py", line 1684, in _find_head_package
94 target_package = self._safe_import_module(
95 File "C:\Users\Tarun\AppData\Local\Programs\Python\Python310\lib\site-packages\PyInstaller\depend\analysis.py", line 387, in _safe_import_module
96 return super()._safe_import_module(module_basename, module_name, parent_package)
97 File "C:\Users\Tarun\AppData\Local\Programs\Python\Python310\lib\site-packages\PyInstaller\lib\modulegraph\modulegraph.py", line 2062, in _safe_import_module
98 self._process_imports(n)
99 File "C:\Users\Tarun\AppData\Local\Programs\Python\Python310\lib\site-packages\PyInstaller\lib\modulegraph\modulegraph.py", line 2850, in _process_imports
100 target_module = self._safe_import_hook(*import_info, **kwargs)[0]
101 File "C:\Users\Tarun\AppData\Local\Programs\Python\Python310\lib\site-packages\PyInstaller\lib\modulegraph\modulegraph.py", line 2301, in _safe_import_hook
102 target_modules = self.import_hook(
103 File "C:\Users\Tarun\AppData\Local\Programs\Python\Python310\lib\site-packages\PyInstaller\lib\modulegraph\modulegraph.py", line 1518, in import_hook
104 submodule = self._safe_import_module(head, mname, submodule)
105 File "C:\Users\Tarun\AppData\Local\Programs\Python\Python310\lib\site-packages\PyInstaller\depend\analysis.py", line 387, in _safe_import_module
106 return super()._safe_import_module(module_basename, module_name, parent_package)
107 File "C:\Users\Tarun\AppData\Local\Programs\Python\Python310\lib\site-packages\PyInstaller\lib\modulegraph\modulegraph.py", line 2062, in _safe_import_module
108 self._process_imports(n)
109 File "C:\Users\Tarun\AppData\Local\Programs\Python\Python310\lib\site-packages\PyInstaller\lib\modulegraph\modulegraph.py", line 2850, in _process_imports
110 target_module = self._safe_import_hook(*import_info, **kwargs)[0]
111 File "C:\Users\Tarun\AppData\Local\Programs\Python\Python310\lib\site-packages\PyInstaller\lib\modulegraph\modulegraph.py", line 2301, in _safe_import_hook
112 target_modules = self.import_hook(
113 File "C:\Users\Tarun\AppData\Local\Programs\Python\Python310\lib\site-packages\PyInstaller\lib\modulegraph\modulegraph.py", line 1518, in import_hook
114 submodule = self._safe_import_module(head, mname, submodule)
115 File "C:\Users\Tarun\AppData\Local\Programs\Python\Python310\lib\site-packages\PyInstaller\depend\analysis.py", line 387, in _safe_import_module
116 return super()._safe_import_module(module_basename, module_name, parent_package)
117 File "C:\Users\Tarun\AppData\Local\Programs\Python\Python310\lib\site-packages\PyInstaller\lib\modulegraph\modulegraph.py", line 2062, in _safe_import_module
118 self._process_imports(n)
119 File "C:\Users\Tarun\AppData\Local\Programs\Python\Python310\lib\site-packages\PyInstaller\lib\modulegraph\modulegraph.py", line 2850, in _process_imports
120 target_module = self._safe_import_hook(*import_info, **kwargs)[0]
121 File "C:\Users\Tarun\AppData\Local\Programs\Python\Python310\lib\site-packages\PyInstaller\lib\modulegraph\modulegraph.py", line 2301, in _safe_import_hook
122 target_modules = self.import_hook(
123 File "C:\Users\Tarun\AppData\Local\Programs\Python\Python310\lib\site-packages\PyInstaller\lib\modulegraph\modulegraph.py", line 1518, in import_hook
124 submodule = self._safe_import_module(head, mname, submodule)
125 File "C:\Users\Tarun\AppData\Local\Programs\Python\Python310\lib\site-packages\PyInstaller\depend\analysis.py", line 387, in _safe_import_module
126 return super()._safe_import_module(module_basename, module_name, parent_package)
127 File "C:\Users\Tarun\AppData\Local\Programs\Python\Python310\lib\site-packages\PyInstaller\lib\modulegraph\modulegraph.py", line 2061, in _safe_import_module
128 n = self._scan_code(module, co, co_ast)
129 File "C:\Users\Tarun\AppData\Local\Programs\Python\Python310\lib\site-packages\PyInstaller\lib\modulegraph\modulegraph.py", line 2645, in _scan_code
130 self._scan_bytecode(
131 File "C:\Users\Tarun\AppData\Local\Programs\Python\Python310\lib\site-packages\PyInstaller\lib\modulegraph\modulegraph.py", line 2749, in _scan_bytecode
132 for inst in util.iterate_instructions(module_code_object):
133 File "C:\Users\Tarun\AppData\Local\Programs\Python\Python310\lib\site-packages\PyInstaller\lib\modulegraph\util.py", line 147, in iterate_instructions
134 yield from iterate_instructions(constant)
135 File "C:\Users\Tarun\AppData\Local\Programs\Python\Python310\lib\site-packages\PyInstaller\lib\modulegraph\util.py", line 139, in iterate_instructions
136 yield from get_instructions(code_object)
137 File "C:\Users\Tarun\AppData\Local\Programs\Python\Python310\lib\dis.py", line 338, in _get_instructions_bytes
138 argval, argrepr = _get_const_info(arg, constants)
139 File "C:\Users\Tarun\AppData\Local\Programs\Python\Python310\lib\dis.py", line 292, in _get_const_info
140 argval = const_list[const_index]
141IndexError: tuple index out of range
142
143Project output will not be moved to output folder
144Complete.
145
I understand that there is a thread already about similar issue but it still doesn't solve the issue. Hence seeking out help
I really have no idea why is the error occurring and how to resolve it. I am pasting the script below for your reference. Can some one please help? Thank you in advance
1Running auto-py-to-exe v2.10.1
2Building directory: C:\Users\Tarun\AppData\Local\Temp\tmpjaw1ky1x
3Provided command: pyinstaller --noconfirm --onedir --console --no-embed-manifest "C:/Users/Tarun/AppData/Local/Programs/Python/Python310/AI_Ass.py"
4Recursion Limit is set to 5000
5Executing: pyinstaller --noconfirm --onedir --console --no-embed-manifest C:/Users/Tarun/AppData/Local/Programs/Python/Python310/AI_Ass.py --distpath C:\Users\Tarun\AppData\Local\Temp\tmpjaw1ky1x\application --workpath C:\Users\Tarun\AppData\Local\Temp\tmpjaw1ky1x\build --specpath C:\Users\Tarun\AppData\Local\Temp\tmpjaw1ky1x
6
742681 INFO: PyInstaller: 4.6
842690 INFO: Python: 3.10.0
942732 INFO: Platform: Windows-10-10.0.19042-SP0
1042744 INFO: wrote C:\Users\Tarun\AppData\Local\Temp\tmpjaw1ky1x\AI_Ass.spec
1142764 INFO: UPX is not available.
1242772 INFO: Extending PYTHONPATH with paths
13['C:\\Users\\Tarun\\AppData\\Local\\Programs\\Python\\Python310']
1443887 INFO: checking Analysis
1543891 INFO: Building Analysis because Analysis-00.toc is non existent
1643895 INFO: Initializing module dependency graph...
1743915 INFO: Caching module graph hooks...
1843975 INFO: Analyzing base_library.zip ...
1954298 INFO: Processing pre-find module path hook distutils from 'C:\\Users\\Tarun\\AppData\\Local\\Programs\\Python\\Python310\\lib\\site-packages\\PyInstaller\\hooks\\pre_find_module_path\\hook-distutils.py'.
2054306 INFO: distutils: retargeting to non-venv dir 'C:\\Users\\Tarun\\AppData\\Local\\Programs\\Python\\Python310\\lib'
2157474 INFO: Caching module dependency graph...
2258088 INFO: running Analysis Analysis-00.toc
2358132 INFO: Adding Microsoft.Windows.Common-Controls to dependent assemblies of final executable
24 required by C:\Users\Tarun\AppData\Local\Programs\Python\Python310\python.exe
2558365 INFO: Analyzing C:\Users\Tarun\AppData\Local\Programs\Python\Python310\AI_Ass.py
2659641 INFO: Processing pre-safe import module hook urllib3.packages.six.moves from 'C:\\Users\\Tarun\\AppData\\Local\\Programs\\Python\\Python310\\lib\\site-packages\\PyInstaller\\hooks\\pre_safe_import_module\\hook-urllib3.packages.six.moves.py'.
27An error occurred while packaging
28Traceback (most recent call last):
29 File "C:\Users\Tarun\AppData\Local\Programs\Python\Python310\lib\site-packages\auto_py_to_exe\packaging.py", line 131, in package
30 run_pyinstaller()
31 File "C:\Users\Tarun\AppData\Local\Programs\Python\Python310\lib\site-packages\PyInstaller\__main__.py", line 124, in run
32 run_build(pyi_config, spec_file, **vars(args))
33 File "C:\Users\Tarun\AppData\Local\Programs\Python\Python310\lib\site-packages\PyInstaller\__main__.py", line 58, in run_build
34 PyInstaller.building.build_main.main(pyi_config, spec_file, **kwargs)
35 File "C:\Users\Tarun\AppData\Local\Programs\Python\Python310\lib\site-packages\PyInstaller\building\build_main.py", line 782, in main
36 build(specfile, kw.get('distpath'), kw.get('workpath'), kw.get('clean_build'))
37 File "C:\Users\Tarun\AppData\Local\Programs\Python\Python310\lib\site-packages\PyInstaller\building\build_main.py", line 714, in build
38 exec(code, spec_namespace)
39 File "C:\Users\Tarun\AppData\Local\Temp\tmpjaw1ky1x\AI_Ass.spec", line 7, in <module>
40 a = Analysis(['C:/Users/Tarun/AppData/Local/Programs/Python/Python310/AI_Ass.py'],
41 File "C:\Users\Tarun\AppData\Local\Programs\Python\Python310\lib\site-packages\PyInstaller\building\build_main.py", line 277, in __init__
42 self.__postinit__()
43 File "C:\Users\Tarun\AppData\Local\Programs\Python\Python310\lib\site-packages\PyInstaller\building\datastruct.py", line 155, in __postinit__
44 self.assemble()
45 File "C:\Users\Tarun\AppData\Local\Programs\Python\Python310\lib\site-packages\PyInstaller\building\build_main.py", line 439, in assemble
46 priority_scripts.append(self.graph.add_script(script))
47 File "C:\Users\Tarun\AppData\Local\Programs\Python\Python310\lib\site-packages\PyInstaller\depend\analysis.py", line 265, in add_script
48 self._top_script_node = super().add_script(pathname)
49 File "C:\Users\Tarun\AppData\Local\Programs\Python\Python310\lib\site-packages\PyInstaller\lib\modulegraph\modulegraph.py", line 1433, in add_script
50 self._process_imports(n)
51 File "C:\Users\Tarun\AppData\Local\Programs\Python\Python310\lib\site-packages\PyInstaller\lib\modulegraph\modulegraph.py", line 2850, in _process_imports
52 target_module = self._safe_import_hook(*import_info, **kwargs)[0]
53 File "C:\Users\Tarun\AppData\Local\Programs\Python\Python310\lib\site-packages\PyInstaller\lib\modulegraph\modulegraph.py", line 2301, in _safe_import_hook
54 target_modules = self.import_hook(
55 File "C:\Users\Tarun\AppData\Local\Programs\Python\Python310\lib\site-packages\PyInstaller\lib\modulegraph\modulegraph.py", line 1505, in import_hook
56 target_package, target_module_partname = self._find_head_package(
57 File "C:\Users\Tarun\AppData\Local\Programs\Python\Python310\lib\site-packages\PyInstaller\lib\modulegraph\modulegraph.py", line 1684, in _find_head_package
58 target_package = self._safe_import_module(
59 File "C:\Users\Tarun\AppData\Local\Programs\Python\Python310\lib\site-packages\PyInstaller\depend\analysis.py", line 387, in _safe_import_module
60 return super()._safe_import_module(module_basename, module_name, parent_package)
61 File "C:\Users\Tarun\AppData\Local\Programs\Python\Python310\lib\site-packages\PyInstaller\lib\modulegraph\modulegraph.py", line 2062, in _safe_import_module
62 self._process_imports(n)
63 File "C:\Users\Tarun\AppData\Local\Programs\Python\Python310\lib\site-packages\PyInstaller\lib\modulegraph\modulegraph.py", line 2850, in _process_imports
64 target_module = self._safe_import_hook(*import_info, **kwargs)[0]
65 File "C:\Users\Tarun\AppData\Local\Programs\Python\Python310\lib\site-packages\PyInstaller\lib\modulegraph\modulegraph.py", line 2301, in _safe_import_hook
66 target_modules = self.import_hook(
67 File "C:\Users\Tarun\AppData\Local\Programs\Python\Python310\lib\site-packages\PyInstaller\lib\modulegraph\modulegraph.py", line 1505, in import_hook
68 target_package, target_module_partname = self._find_head_package(
69 File "C:\Users\Tarun\AppData\Local\Programs\Python\Python310\lib\site-packages\PyInstaller\lib\modulegraph\modulegraph.py", line 1684, in _find_head_package
70 target_package = self._safe_import_module(
71 File "C:\Users\Tarun\AppData\Local\Programs\Python\Python310\lib\site-packages\PyInstaller\depend\analysis.py", line 387, in _safe_import_module
72 return super()._safe_import_module(module_basename, module_name, parent_package)
73 File "C:\Users\Tarun\AppData\Local\Programs\Python\Python310\lib\site-packages\PyInstaller\lib\modulegraph\modulegraph.py", line 2062, in _safe_import_module
74 self._process_imports(n)
75 File "C:\Users\Tarun\AppData\Local\Programs\Python\Python310\lib\site-packages\PyInstaller\lib\modulegraph\modulegraph.py", line 2850, in _process_imports
76 target_module = self._safe_import_hook(*import_info, **kwargs)[0]
77 File "C:\Users\Tarun\AppData\Local\Programs\Python\Python310\lib\site-packages\PyInstaller\lib\modulegraph\modulegraph.py", line 2301, in _safe_import_hook
78 target_modules = self.import_hook(
79 File "C:\Users\Tarun\AppData\Local\Programs\Python\Python310\lib\site-packages\PyInstaller\lib\modulegraph\modulegraph.py", line 1505, in import_hook
80 target_package, target_module_partname = self._find_head_package(
81 File "C:\Users\Tarun\AppData\Local\Programs\Python\Python310\lib\site-packages\PyInstaller\lib\modulegraph\modulegraph.py", line 1684, in _find_head_package
82 target_package = self._safe_import_module(
83 File "C:\Users\Tarun\AppData\Local\Programs\Python\Python310\lib\site-packages\PyInstaller\depend\analysis.py", line 387, in _safe_import_module
84 return super()._safe_import_module(module_basename, module_name, parent_package)
85 File "C:\Users\Tarun\AppData\Local\Programs\Python\Python310\lib\site-packages\PyInstaller\lib\modulegraph\modulegraph.py", line 2062, in _safe_import_module
86 self._process_imports(n)
87 File "C:\Users\Tarun\AppData\Local\Programs\Python\Python310\lib\site-packages\PyInstaller\lib\modulegraph\modulegraph.py", line 2850, in _process_imports
88 target_module = self._safe_import_hook(*import_info, **kwargs)[0]
89 File "C:\Users\Tarun\AppData\Local\Programs\Python\Python310\lib\site-packages\PyInstaller\lib\modulegraph\modulegraph.py", line 2301, in _safe_import_hook
90 target_modules = self.import_hook(
91 File "C:\Users\Tarun\AppData\Local\Programs\Python\Python310\lib\site-packages\PyInstaller\lib\modulegraph\modulegraph.py", line 1505, in import_hook
92 target_package, target_module_partname = self._find_head_package(
93 File "C:\Users\Tarun\AppData\Local\Programs\Python\Python310\lib\site-packages\PyInstaller\lib\modulegraph\modulegraph.py", line 1684, in _find_head_package
94 target_package = self._safe_import_module(
95 File "C:\Users\Tarun\AppData\Local\Programs\Python\Python310\lib\site-packages\PyInstaller\depend\analysis.py", line 387, in _safe_import_module
96 return super()._safe_import_module(module_basename, module_name, parent_package)
97 File "C:\Users\Tarun\AppData\Local\Programs\Python\Python310\lib\site-packages\PyInstaller\lib\modulegraph\modulegraph.py", line 2062, in _safe_import_module
98 self._process_imports(n)
99 File "C:\Users\Tarun\AppData\Local\Programs\Python\Python310\lib\site-packages\PyInstaller\lib\modulegraph\modulegraph.py", line 2850, in _process_imports
100 target_module = self._safe_import_hook(*import_info, **kwargs)[0]
101 File "C:\Users\Tarun\AppData\Local\Programs\Python\Python310\lib\site-packages\PyInstaller\lib\modulegraph\modulegraph.py", line 2301, in _safe_import_hook
102 target_modules = self.import_hook(
103 File "C:\Users\Tarun\AppData\Local\Programs\Python\Python310\lib\site-packages\PyInstaller\lib\modulegraph\modulegraph.py", line 1518, in import_hook
104 submodule = self._safe_import_module(head, mname, submodule)
105 File "C:\Users\Tarun\AppData\Local\Programs\Python\Python310\lib\site-packages\PyInstaller\depend\analysis.py", line 387, in _safe_import_module
106 return super()._safe_import_module(module_basename, module_name, parent_package)
107 File "C:\Users\Tarun\AppData\Local\Programs\Python\Python310\lib\site-packages\PyInstaller\lib\modulegraph\modulegraph.py", line 2062, in _safe_import_module
108 self._process_imports(n)
109 File "C:\Users\Tarun\AppData\Local\Programs\Python\Python310\lib\site-packages\PyInstaller\lib\modulegraph\modulegraph.py", line 2850, in _process_imports
110 target_module = self._safe_import_hook(*import_info, **kwargs)[0]
111 File "C:\Users\Tarun\AppData\Local\Programs\Python\Python310\lib\site-packages\PyInstaller\lib\modulegraph\modulegraph.py", line 2301, in _safe_import_hook
112 target_modules = self.import_hook(
113 File "C:\Users\Tarun\AppData\Local\Programs\Python\Python310\lib\site-packages\PyInstaller\lib\modulegraph\modulegraph.py", line 1518, in import_hook
114 submodule = self._safe_import_module(head, mname, submodule)
115 File "C:\Users\Tarun\AppData\Local\Programs\Python\Python310\lib\site-packages\PyInstaller\depend\analysis.py", line 387, in _safe_import_module
116 return super()._safe_import_module(module_basename, module_name, parent_package)
117 File "C:\Users\Tarun\AppData\Local\Programs\Python\Python310\lib\site-packages\PyInstaller\lib\modulegraph\modulegraph.py", line 2062, in _safe_import_module
118 self._process_imports(n)
119 File "C:\Users\Tarun\AppData\Local\Programs\Python\Python310\lib\site-packages\PyInstaller\lib\modulegraph\modulegraph.py", line 2850, in _process_imports
120 target_module = self._safe_import_hook(*import_info, **kwargs)[0]
121 File "C:\Users\Tarun\AppData\Local\Programs\Python\Python310\lib\site-packages\PyInstaller\lib\modulegraph\modulegraph.py", line 2301, in _safe_import_hook
122 target_modules = self.import_hook(
123 File "C:\Users\Tarun\AppData\Local\Programs\Python\Python310\lib\site-packages\PyInstaller\lib\modulegraph\modulegraph.py", line 1518, in import_hook
124 submodule = self._safe_import_module(head, mname, submodule)
125 File "C:\Users\Tarun\AppData\Local\Programs\Python\Python310\lib\site-packages\PyInstaller\depend\analysis.py", line 387, in _safe_import_module
126 return super()._safe_import_module(module_basename, module_name, parent_package)
127 File "C:\Users\Tarun\AppData\Local\Programs\Python\Python310\lib\site-packages\PyInstaller\lib\modulegraph\modulegraph.py", line 2061, in _safe_import_module
128 n = self._scan_code(module, co, co_ast)
129 File "C:\Users\Tarun\AppData\Local\Programs\Python\Python310\lib\site-packages\PyInstaller\lib\modulegraph\modulegraph.py", line 2645, in _scan_code
130 self._scan_bytecode(
131 File "C:\Users\Tarun\AppData\Local\Programs\Python\Python310\lib\site-packages\PyInstaller\lib\modulegraph\modulegraph.py", line 2749, in _scan_bytecode
132 for inst in util.iterate_instructions(module_code_object):
133 File "C:\Users\Tarun\AppData\Local\Programs\Python\Python310\lib\site-packages\PyInstaller\lib\modulegraph\util.py", line 147, in iterate_instructions
134 yield from iterate_instructions(constant)
135 File "C:\Users\Tarun\AppData\Local\Programs\Python\Python310\lib\site-packages\PyInstaller\lib\modulegraph\util.py", line 139, in iterate_instructions
136 yield from get_instructions(code_object)
137 File "C:\Users\Tarun\AppData\Local\Programs\Python\Python310\lib\dis.py", line 338, in _get_instructions_bytes
138 argval, argrepr = _get_const_info(arg, constants)
139 File "C:\Users\Tarun\AppData\Local\Programs\Python\Python310\lib\dis.py", line 292, in _get_const_info
140 argval = const_list[const_index]
141IndexError: tuple index out of range
142
143Project output will not be moved to output folder
144Complete.
145#importing libraries
146
147import speech_recognition as sr
148import pyttsx3
149import datetime
150import wikipedia
151import webbrowser
152import os
153import time
154import subprocess
155from ecapture import ecapture as ec
156import wolframalpha
157import json
158import requests
159
160#setting up speech engine
161engine=pyttsx3.init('sapi5')
162voices=engine.getProperty('voices')
163engine.setProperty('voice','voices[1].id')
164
165def speak(text):
166 engine.say(text)
167 engine.runAndWait()
168
169#Greet user
170def wishMe():
171 hour=datetime.datetime.now().hour
172 if hour>=0 and hour<12:
173 speak("Hello,Good Morning")
174 print("Hello,Good Morning")
175 elif hour>=12 and hour<18:
176 speak("Hello,Good Afternoon")
177 print("Hello,Good Afternoon")
178 else:
179 speak("Hello,Good Evening")
180 print("Hello,Good Evening")
181
182#Setting up the command function for your AI assistant
183def takeCommand():
184 r=sr.Recognizer()
185 with sr.Microphone() as source:
186 print("Listening...")
187 audio=r.listen(source)
188
189 try:
190 statement=r.recognize_google(audio,language='en-in')
191 print(f"user said:{statement}\n")
192
193 except Exception as e:
194 speak("Pardon me, please say that again")
195 return "None"
196 return statement
197
198print("Loading your AI personal assistant Friday")
199speak("Loading your AI personal assistant Friday")
200wishMe()
201
202#main function
203if __name__=='__main__':
204
205
206 while True:
207 speak("Tell me how can I help you now?")
208 statement = takeCommand().lower()
209 if statement==0:
210 continue
211
212 if "good bye" in statement or "ok bye" in statement or "stop" in statement:
213 speak('your personal assistant Friday is shutting down,Good bye')
214 print('your personal assistant Friday is shutting down,Good bye')
215 break
216
217
218 if 'wikipedia' in statement:
219 speak('Searching Wikipedia...')
220 statement =statement.replace("wikipedia", "")
221 results = wikipedia.summary(statement, sentences=10)
222 webbrowser.open_new_tab("https://en.wikipedia.org/wiki/"+ statement)
223 speak("According to Wikipedia")
224 print(results)
225 speak(results)
226
227 elif 'open youtube' in statement:
228 webbrowser.register('chrome', None,
229 webbrowser.BackgroundBrowser("C://Program Files (x86)//Google//Chrome//Application//chrome.exe"))
230 webbrowser.get('chrome').open_new_tab("https://www.youtube.com")
231 #webbrowser.open_new_tab("https://www.youtube.com")
232 speak("youtube is open now")
233 time.sleep(5)
234
235 elif 'open google' in statement:
236 webbrowser.open_new_tab("https://www.google.com")
237 speak("Google chrome is open now")
238 time.sleep(5)
239
240 elif 'open gmail' in statement:
241 webbrowser.open_new_tab("gmail.com")
242 speak("Google Mail open now")
243 time.sleep(5)
244
245 elif 'time' in statement:
246 strTime=datetime.datetime.now().strftime("%H:%M:%S")
247 speak(f"the time is {strTime}")
248
249 elif 'news' in statement:
250 news = webbrowser.open_new_tab("https://timesofindia.indiatimes.com/home/headlines")
251 speak('Here are some headlines from the Times of India,Happy reading')
252 time.sleep(6)
253
254 elif "camera" in statement or "take a photo" in statement:
255 ec.capture(0,"robo camera","img.jpg")
256
257 elif 'search' in statement:
258 statement = statement.replace("search", "")
259 webbrowser.open_new_tab(statement)
260 time.sleep(5)
261
262 elif 'who are you' in statement or 'what can you do' in statement:
263 speak('I am Friday version 1 point O your personal assistant. I am programmed to minor tasks like'
264 'opening youtube,google chrome, gmail and stackoverflow ,predict time,take a photo,search wikipedia,predict weather'
265 'In different cities, get top headline news from times of india and you can ask me computational or geographical questions too!')
266
267
268 elif "who made you" in statement or "who created you" in statement or "who discovered you" in statement:
269 speak("I was built by Mirthula")
270 print("I was built by Mirthula")
271
272 elif "log off" in statement or "sign out" in statement:
273 speak("Ok , your pc will log off in 10 sec make sure you exit from all applications")
274 subprocess.call(["shutdown", "/l"])
275
276time.sleep(3)
277
ANSWER
Answered 2021-Nov-05 at 02:201Running auto-py-to-exe v2.10.1
2Building directory: C:\Users\Tarun\AppData\Local\Temp\tmpjaw1ky1x
3Provided command: pyinstaller --noconfirm --onedir --console --no-embed-manifest "C:/Users/Tarun/AppData/Local/Programs/Python/Python310/AI_Ass.py"
4Recursion Limit is set to 5000
5Executing: pyinstaller --noconfirm --onedir --console --no-embed-manifest C:/Users/Tarun/AppData/Local/Programs/Python/Python310/AI_Ass.py --distpath C:\Users\Tarun\AppData\Local\Temp\tmpjaw1ky1x\application --workpath C:\Users\Tarun\AppData\Local\Temp\tmpjaw1ky1x\build --specpath C:\Users\Tarun\AppData\Local\Temp\tmpjaw1ky1x
6
742681 INFO: PyInstaller: 4.6
842690 INFO: Python: 3.10.0
942732 INFO: Platform: Windows-10-10.0.19042-SP0
1042744 INFO: wrote C:\Users\Tarun\AppData\Local\Temp\tmpjaw1ky1x\AI_Ass.spec
1142764 INFO: UPX is not available.
1242772 INFO: Extending PYTHONPATH with paths
13['C:\\Users\\Tarun\\AppData\\Local\\Programs\\Python\\Python310']
1443887 INFO: checking Analysis
1543891 INFO: Building Analysis because Analysis-00.toc is non existent
1643895 INFO: Initializing module dependency graph...
1743915 INFO: Caching module graph hooks...
1843975 INFO: Analyzing base_library.zip ...
1954298 INFO: Processing pre-find module path hook distutils from 'C:\\Users\\Tarun\\AppData\\Local\\Programs\\Python\\Python310\\lib\\site-packages\\PyInstaller\\hooks\\pre_find_module_path\\hook-distutils.py'.
2054306 INFO: distutils: retargeting to non-venv dir 'C:\\Users\\Tarun\\AppData\\Local\\Programs\\Python\\Python310\\lib'
2157474 INFO: Caching module dependency graph...
2258088 INFO: running Analysis Analysis-00.toc
2358132 INFO: Adding Microsoft.Windows.Common-Controls to dependent assemblies of final executable
24 required by C:\Users\Tarun\AppData\Local\Programs\Python\Python310\python.exe
2558365 INFO: Analyzing C:\Users\Tarun\AppData\Local\Programs\Python\Python310\AI_Ass.py
2659641 INFO: Processing pre-safe import module hook urllib3.packages.six.moves from 'C:\\Users\\Tarun\\AppData\\Local\\Programs\\Python\\Python310\\lib\\site-packages\\PyInstaller\\hooks\\pre_safe_import_module\\hook-urllib3.packages.six.moves.py'.
27An error occurred while packaging
28Traceback (most recent call last):
29 File "C:\Users\Tarun\AppData\Local\Programs\Python\Python310\lib\site-packages\auto_py_to_exe\packaging.py", line 131, in package
30 run_pyinstaller()
31 File "C:\Users\Tarun\AppData\Local\Programs\Python\Python310\lib\site-packages\PyInstaller\__main__.py", line 124, in run
32 run_build(pyi_config, spec_file, **vars(args))
33 File "C:\Users\Tarun\AppData\Local\Programs\Python\Python310\lib\site-packages\PyInstaller\__main__.py", line 58, in run_build
34 PyInstaller.building.build_main.main(pyi_config, spec_file, **kwargs)
35 File "C:\Users\Tarun\AppData\Local\Programs\Python\Python310\lib\site-packages\PyInstaller\building\build_main.py", line 782, in main
36 build(specfile, kw.get('distpath'), kw.get('workpath'), kw.get('clean_build'))
37 File "C:\Users\Tarun\AppData\Local\Programs\Python\Python310\lib\site-packages\PyInstaller\building\build_main.py", line 714, in build
38 exec(code, spec_namespace)
39 File "C:\Users\Tarun\AppData\Local\Temp\tmpjaw1ky1x\AI_Ass.spec", line 7, in <module>
40 a = Analysis(['C:/Users/Tarun/AppData/Local/Programs/Python/Python310/AI_Ass.py'],
41 File "C:\Users\Tarun\AppData\Local\Programs\Python\Python310\lib\site-packages\PyInstaller\building\build_main.py", line 277, in __init__
42 self.__postinit__()
43 File "C:\Users\Tarun\AppData\Local\Programs\Python\Python310\lib\site-packages\PyInstaller\building\datastruct.py", line 155, in __postinit__
44 self.assemble()
45 File "C:\Users\Tarun\AppData\Local\Programs\Python\Python310\lib\site-packages\PyInstaller\building\build_main.py", line 439, in assemble
46 priority_scripts.append(self.graph.add_script(script))
47 File "C:\Users\Tarun\AppData\Local\Programs\Python\Python310\lib\site-packages\PyInstaller\depend\analysis.py", line 265, in add_script
48 self._top_script_node = super().add_script(pathname)
49 File "C:\Users\Tarun\AppData\Local\Programs\Python\Python310\lib\site-packages\PyInstaller\lib\modulegraph\modulegraph.py", line 1433, in add_script
50 self._process_imports(n)
51 File "C:\Users\Tarun\AppData\Local\Programs\Python\Python310\lib\site-packages\PyInstaller\lib\modulegraph\modulegraph.py", line 2850, in _process_imports
52 target_module = self._safe_import_hook(*import_info, **kwargs)[0]
53 File "C:\Users\Tarun\AppData\Local\Programs\Python\Python310\lib\site-packages\PyInstaller\lib\modulegraph\modulegraph.py", line 2301, in _safe_import_hook
54 target_modules = self.import_hook(
55 File "C:\Users\Tarun\AppData\Local\Programs\Python\Python310\lib\site-packages\PyInstaller\lib\modulegraph\modulegraph.py", line 1505, in import_hook
56 target_package, target_module_partname = self._find_head_package(
57 File "C:\Users\Tarun\AppData\Local\Programs\Python\Python310\lib\site-packages\PyInstaller\lib\modulegraph\modulegraph.py", line 1684, in _find_head_package
58 target_package = self._safe_import_module(
59 File "C:\Users\Tarun\AppData\Local\Programs\Python\Python310\lib\site-packages\PyInstaller\depend\analysis.py", line 387, in _safe_import_module
60 return super()._safe_import_module(module_basename, module_name, parent_package)
61 File "C:\Users\Tarun\AppData\Local\Programs\Python\Python310\lib\site-packages\PyInstaller\lib\modulegraph\modulegraph.py", line 2062, in _safe_import_module
62 self._process_imports(n)
63 File "C:\Users\Tarun\AppData\Local\Programs\Python\Python310\lib\site-packages\PyInstaller\lib\modulegraph\modulegraph.py", line 2850, in _process_imports
64 target_module = self._safe_import_hook(*import_info, **kwargs)[0]
65 File "C:\Users\Tarun\AppData\Local\Programs\Python\Python310\lib\site-packages\PyInstaller\lib\modulegraph\modulegraph.py", line 2301, in _safe_import_hook
66 target_modules = self.import_hook(
67 File "C:\Users\Tarun\AppData\Local\Programs\Python\Python310\lib\site-packages\PyInstaller\lib\modulegraph\modulegraph.py", line 1505, in import_hook
68 target_package, target_module_partname = self._find_head_package(
69 File "C:\Users\Tarun\AppData\Local\Programs\Python\Python310\lib\site-packages\PyInstaller\lib\modulegraph\modulegraph.py", line 1684, in _find_head_package
70 target_package = self._safe_import_module(
71 File "C:\Users\Tarun\AppData\Local\Programs\Python\Python310\lib\site-packages\PyInstaller\depend\analysis.py", line 387, in _safe_import_module
72 return super()._safe_import_module(module_basename, module_name, parent_package)
73 File "C:\Users\Tarun\AppData\Local\Programs\Python\Python310\lib\site-packages\PyInstaller\lib\modulegraph\modulegraph.py", line 2062, in _safe_import_module
74 self._process_imports(n)
75 File "C:\Users\Tarun\AppData\Local\Programs\Python\Python310\lib\site-packages\PyInstaller\lib\modulegraph\modulegraph.py", line 2850, in _process_imports
76 target_module = self._safe_import_hook(*import_info, **kwargs)[0]
77 File "C:\Users\Tarun\AppData\Local\Programs\Python\Python310\lib\site-packages\PyInstaller\lib\modulegraph\modulegraph.py", line 2301, in _safe_import_hook
78 target_modules = self.import_hook(
79 File "C:\Users\Tarun\AppData\Local\Programs\Python\Python310\lib\site-packages\PyInstaller\lib\modulegraph\modulegraph.py", line 1505, in import_hook
80 target_package, target_module_partname = self._find_head_package(
81 File "C:\Users\Tarun\AppData\Local\Programs\Python\Python310\lib\site-packages\PyInstaller\lib\modulegraph\modulegraph.py", line 1684, in _find_head_package
82 target_package = self._safe_import_module(
83 File "C:\Users\Tarun\AppData\Local\Programs\Python\Python310\lib\site-packages\PyInstaller\depend\analysis.py", line 387, in _safe_import_module
84 return super()._safe_import_module(module_basename, module_name, parent_package)
85 File "C:\Users\Tarun\AppData\Local\Programs\Python\Python310\lib\site-packages\PyInstaller\lib\modulegraph\modulegraph.py", line 2062, in _safe_import_module
86 self._process_imports(n)
87 File "C:\Users\Tarun\AppData\Local\Programs\Python\Python310\lib\site-packages\PyInstaller\lib\modulegraph\modulegraph.py", line 2850, in _process_imports
88 target_module = self._safe_import_hook(*import_info, **kwargs)[0]
89 File "C:\Users\Tarun\AppData\Local\Programs\Python\Python310\lib\site-packages\PyInstaller\lib\modulegraph\modulegraph.py", line 2301, in _safe_import_hook
90 target_modules = self.import_hook(
91 File "C:\Users\Tarun\AppData\Local\Programs\Python\Python310\lib\site-packages\PyInstaller\lib\modulegraph\modulegraph.py", line 1505, in import_hook
92 target_package, target_module_partname = self._find_head_package(
93 File "C:\Users\Tarun\AppData\Local\Programs\Python\Python310\lib\site-packages\PyInstaller\lib\modulegraph\modulegraph.py", line 1684, in _find_head_package
94 target_package = self._safe_import_module(
95 File "C:\Users\Tarun\AppData\Local\Programs\Python\Python310\lib\site-packages\PyInstaller\depend\analysis.py", line 387, in _safe_import_module
96 return super()._safe_import_module(module_basename, module_name, parent_package)
97 File "C:\Users\Tarun\AppData\Local\Programs\Python\Python310\lib\site-packages\PyInstaller\lib\modulegraph\modulegraph.py", line 2062, in _safe_import_module
98 self._process_imports(n)
99 File "C:\Users\Tarun\AppData\Local\Programs\Python\Python310\lib\site-packages\PyInstaller\lib\modulegraph\modulegraph.py", line 2850, in _process_imports
100 target_module = self._safe_import_hook(*import_info, **kwargs)[0]
101 File "C:\Users\Tarun\AppData\Local\Programs\Python\Python310\lib\site-packages\PyInstaller\lib\modulegraph\modulegraph.py", line 2301, in _safe_import_hook
102 target_modules = self.import_hook(
103 File "C:\Users\Tarun\AppData\Local\Programs\Python\Python310\lib\site-packages\PyInstaller\lib\modulegraph\modulegraph.py", line 1518, in import_hook
104 submodule = self._safe_import_module(head, mname, submodule)
105 File "C:\Users\Tarun\AppData\Local\Programs\Python\Python310\lib\site-packages\PyInstaller\depend\analysis.py", line 387, in _safe_import_module
106 return super()._safe_import_module(module_basename, module_name, parent_package)
107 File "C:\Users\Tarun\AppData\Local\Programs\Python\Python310\lib\site-packages\PyInstaller\lib\modulegraph\modulegraph.py", line 2062, in _safe_import_module
108 self._process_imports(n)
109 File "C:\Users\Tarun\AppData\Local\Programs\Python\Python310\lib\site-packages\PyInstaller\lib\modulegraph\modulegraph.py", line 2850, in _process_imports
110 target_module = self._safe_import_hook(*import_info, **kwargs)[0]
111 File "C:\Users\Tarun\AppData\Local\Programs\Python\Python310\lib\site-packages\PyInstaller\lib\modulegraph\modulegraph.py", line 2301, in _safe_import_hook
112 target_modules = self.import_hook(
113 File "C:\Users\Tarun\AppData\Local\Programs\Python\Python310\lib\site-packages\PyInstaller\lib\modulegraph\modulegraph.py", line 1518, in import_hook
114 submodule = self._safe_import_module(head, mname, submodule)
115 File "C:\Users\Tarun\AppData\Local\Programs\Python\Python310\lib\site-packages\PyInstaller\depend\analysis.py", line 387, in _safe_import_module
116 return super()._safe_import_module(module_basename, module_name, parent_package)
117 File "C:\Users\Tarun\AppData\Local\Programs\Python\Python310\lib\site-packages\PyInstaller\lib\modulegraph\modulegraph.py", line 2062, in _safe_import_module
118 self._process_imports(n)
119 File "C:\Users\Tarun\AppData\Local\Programs\Python\Python310\lib\site-packages\PyInstaller\lib\modulegraph\modulegraph.py", line 2850, in _process_imports
120 target_module = self._safe_import_hook(*import_info, **kwargs)[0]
121 File "C:\Users\Tarun\AppData\Local\Programs\Python\Python310\lib\site-packages\PyInstaller\lib\modulegraph\modulegraph.py", line 2301, in _safe_import_hook
122 target_modules = self.import_hook(
123 File "C:\Users\Tarun\AppData\Local\Programs\Python\Python310\lib\site-packages\PyInstaller\lib\modulegraph\modulegraph.py", line 1518, in import_hook
124 submodule = self._safe_import_module(head, mname, submodule)
125 File "C:\Users\Tarun\AppData\Local\Programs\Python\Python310\lib\site-packages\PyInstaller\depend\analysis.py", line 387, in _safe_import_module
126 return super()._safe_import_module(module_basename, module_name, parent_package)
127 File "C:\Users\Tarun\AppData\Local\Programs\Python\Python310\lib\site-packages\PyInstaller\lib\modulegraph\modulegraph.py", line 2061, in _safe_import_module
128 n = self._scan_code(module, co, co_ast)
129 File "C:\Users\Tarun\AppData\Local\Programs\Python\Python310\lib\site-packages\PyInstaller\lib\modulegraph\modulegraph.py", line 2645, in _scan_code
130 self._scan_bytecode(
131 File "C:\Users\Tarun\AppData\Local\Programs\Python\Python310\lib\site-packages\PyInstaller\lib\modulegraph\modulegraph.py", line 2749, in _scan_bytecode
132 for inst in util.iterate_instructions(module_code_object):
133 File "C:\Users\Tarun\AppData\Local\Programs\Python\Python310\lib\site-packages\PyInstaller\lib\modulegraph\util.py", line 147, in iterate_instructions
134 yield from iterate_instructions(constant)
135 File "C:\Users\Tarun\AppData\Local\Programs\Python\Python310\lib\site-packages\PyInstaller\lib\modulegraph\util.py", line 139, in iterate_instructions
136 yield from get_instructions(code_object)
137 File "C:\Users\Tarun\AppData\Local\Programs\Python\Python310\lib\dis.py", line 338, in _get_instructions_bytes
138 argval, argrepr = _get_const_info(arg, constants)
139 File "C:\Users\Tarun\AppData\Local\Programs\Python\Python310\lib\dis.py", line 292, in _get_const_info
140 argval = const_list[const_index]
141IndexError: tuple index out of range
142
143Project output will not be moved to output folder
144Complete.
145#importing libraries
146
147import speech_recognition as sr
148import pyttsx3
149import datetime
150import wikipedia
151import webbrowser
152import os
153import time
154import subprocess
155from ecapture import ecapture as ec
156import wolframalpha
157import json
158import requests
159
160#setting up speech engine
161engine=pyttsx3.init('sapi5')
162voices=engine.getProperty('voices')
163engine.setProperty('voice','voices[1].id')
164
165def speak(text):
166 engine.say(text)
167 engine.runAndWait()
168
169#Greet user
170def wishMe():
171 hour=datetime.datetime.now().hour
172 if hour>=0 and hour<12:
173 speak("Hello,Good Morning")
174 print("Hello,Good Morning")
175 elif hour>=12 and hour<18:
176 speak("Hello,Good Afternoon")
177 print("Hello,Good Afternoon")
178 else:
179 speak("Hello,Good Evening")
180 print("Hello,Good Evening")
181
182#Setting up the command function for your AI assistant
183def takeCommand():
184 r=sr.Recognizer()
185 with sr.Microphone() as source:
186 print("Listening...")
187 audio=r.listen(source)
188
189 try:
190 statement=r.recognize_google(audio,language='en-in')
191 print(f"user said:{statement}\n")
192
193 except Exception as e:
194 speak("Pardon me, please say that again")
195 return "None"
196 return statement
197
198print("Loading your AI personal assistant Friday")
199speak("Loading your AI personal assistant Friday")
200wishMe()
201
202#main function
203if __name__=='__main__':
204
205
206 while True:
207 speak("Tell me how can I help you now?")
208 statement = takeCommand().lower()
209 if statement==0:
210 continue
211
212 if "good bye" in statement or "ok bye" in statement or "stop" in statement:
213 speak('your personal assistant Friday is shutting down,Good bye')
214 print('your personal assistant Friday is shutting down,Good bye')
215 break
216
217
218 if 'wikipedia' in statement:
219 speak('Searching Wikipedia...')
220 statement =statement.replace("wikipedia", "")
221 results = wikipedia.summary(statement, sentences=10)
222 webbrowser.open_new_tab("https://en.wikipedia.org/wiki/"+ statement)
223 speak("According to Wikipedia")
224 print(results)
225 speak(results)
226
227 elif 'open youtube' in statement:
228 webbrowser.register('chrome', None,
229 webbrowser.BackgroundBrowser("C://Program Files (x86)//Google//Chrome//Application//chrome.exe"))
230 webbrowser.get('chrome').open_new_tab("https://www.youtube.com")
231 #webbrowser.open_new_tab("https://www.youtube.com")
232 speak("youtube is open now")
233 time.sleep(5)
234
235 elif 'open google' in statement:
236 webbrowser.open_new_tab("https://www.google.com")
237 speak("Google chrome is open now")
238 time.sleep(5)
239
240 elif 'open gmail' in statement:
241 webbrowser.open_new_tab("gmail.com")
242 speak("Google Mail open now")
243 time.sleep(5)
244
245 elif 'time' in statement:
246 strTime=datetime.datetime.now().strftime("%H:%M:%S")
247 speak(f"the time is {strTime}")
248
249 elif 'news' in statement:
250 news = webbrowser.open_new_tab("https://timesofindia.indiatimes.com/home/headlines")
251 speak('Here are some headlines from the Times of India,Happy reading')
252 time.sleep(6)
253
254 elif "camera" in statement or "take a photo" in statement:
255 ec.capture(0,"robo camera","img.jpg")
256
257 elif 'search' in statement:
258 statement = statement.replace("search", "")
259 webbrowser.open_new_tab(statement)
260 time.sleep(5)
261
262 elif 'who are you' in statement or 'what can you do' in statement:
263 speak('I am Friday version 1 point O your personal assistant. I am programmed to minor tasks like'
264 'opening youtube,google chrome, gmail and stackoverflow ,predict time,take a photo,search wikipedia,predict weather'
265 'In different cities, get top headline news from times of india and you can ask me computational or geographical questions too!')
266
267
268 elif "who made you" in statement or "who created you" in statement or "who discovered you" in statement:
269 speak("I was built by Mirthula")
270 print("I was built by Mirthula")
271
272 elif "log off" in statement or "sign out" in statement:
273 speak("Ok , your pc will log off in 10 sec make sure you exit from all applications")
274 subprocess.call(["shutdown", "/l"])
275
276time.sleep(3)
27742681 INFO: PyInstaller: 4.6
27842690 INFO: Python: 3.10.0
279
There's the issue. Python 3.10.0 has a bug with PyInstaller 4.6. The problem isn't you or PyInstaller. Try converting it using Python 3.9.7 instead. Ironic, considering 3.10.0 was suppose to be a bugfix update.
QUESTION
android:exported needs to be explicitly specified for <activity>. Apps targeting Android 12 and higher are required to specify
Asked 2022-Feb-23 at 14:13After upgrading to android 12, the application is not compiling. It shows
"Manifest merger failed with multiple errors, see logs"
Error showing in Merged manifest:
Merging Errors: Error: android:exported needs to be explicitly specified for . Apps targeting Android 12 and higher are required to specify an explicit value for
android:exported
when the corresponding component has an intent filter defined. See https://developer.android.com/guide/topics/manifest/activity-element#exported for details. main manifest (this file)
I have set all the activity with android:exported="false"
. But it is still showing this issue.
My manifest file:
1<?xml version="1.0" encoding="utf-8"?>
2<manifest xmlns:android="http://schemas.android.com/apk/res/android"
3 xmlns:tools="http://schemas.android.com/tools"
4 package="eu.siacs.conversations">
5
6 <uses-sdk tools:overrideLibrary="net.ypresto.androidtranscoder" />
7
8 <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
9 <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
10 <uses-permission android:name="android.permission.READ_CONTACTS" />
11 <uses-permission android:name="android.permission.READ_PROFILE" />
12 <uses-permission
13 android:name="android.permission.READ_PHONE_STATE"
14 android:maxSdkVersion="22" />
15 <uses-permission android:name="android.permission.INTERNET" />
16 <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
17 <uses-permission android:name="android.permission.WAKE_LOCK" />
18 <uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
19 <uses-permission android:name="android.permission.VIBRATE" />
20 <uses-permission android:name="android.permission.REQUEST_IGNORE_BATTERY_OPTIMIZATIONS" />
21 <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
22 <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
23 <uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
24 <uses-permission android:name="android.permission.FOREGROUND_SERVICE" />
25 <uses-permission android:name="android.permission.REQUEST_INSTALL_PACKAGES" />
26
27 <uses-feature
28 android:name="android.hardware.location"
29 android:required="false" />
30 <uses-feature
31 android:name="android.hardware.location.gps"
32 android:required="false" />
33 <uses-feature
34 android:name="android.hardware.location.network"
35 android:required="false" />
36
37 <uses-permission android:name="android.permission.CAMERA" />
38 <uses-permission android:name="android.permission.RECORD_AUDIO" />
39 <uses-permission android:name="android.permission.BLUETOOTH" />
40 <uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS" />
41 <uses-permission android:name="android.permission.USE_FULL_SCREEN_INTENT" />
42 <uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW" />
43
44 <uses-feature
45 android:name="android.hardware.camera"
46 android:required="false" />
47 <uses-feature
48 android:name="android.hardware.camera.autofocus"
49 android:required="false" />
50 <uses-feature
51 android:name="android.hardware.microphone"
52 android:required="false" />
53
54 <application
55 android:name=".Application"
56 android:allowBackup="false"
57 android:allowClearUserData="true"
58 android:appCategory="social"
59 android:hardwareAccelerated="true"
60 android:icon="@mipmap/ic_app_launch"
61 android:label="@string/app_name"
62 android:largeHeap="true"
63 android:networkSecurityConfig="@xml/network_security_configuration"
64 android:requestLegacyExternalStorage="true"
65 android:roundIcon="@mipmap/ic_app_launch_round"
66 android:theme="@style/ConversationsTheme"
67 android:usesCleartextTraffic="true"
68 android:windowSoftInputMode="adjustPan|adjustResize"
69 tools:replace="android:label"
70 tools:targetApi="q">
71 <activity
72 android:name=".ui.search.GroupSearchActivity"
73 android:exported="true" />
74 <activity
75 android:name=".ui.profileUpdating.FavouritesActivity"
76 android:exported="true" />
77 <activity
78 android:name=".ui.profileUpdating.NameActivity"
79 android:exported="true" />
80 <activity
81 android:name=".ui.CompulsoryUpdateActivity"
82 android:exported="true" />
83 <activity android:name=".ui.payments.doPayment.DoPaymentActivity"
84 android:exported="true" />
85 <activity android:name=".ui.individualList.IndividualListActivity"
86 android:exported="true" />
87 <activity android:name=".ui.payments.setPayment.SetPaymentActivity"
88 android:exported="true" />
89 <activity android:name=".ui.login.otpActivity.OTPActivity"
90 android:exported="true" />
91 <activity android:name=".ui.login.loginActivity.LoginActivity"
92 android:exported="true" />
93
94 <service android:name=".services.XmppConnectionService" android:exported="true" />
95
96 <receiver android:name=".services.EventReceiver"
97 android:exported="true">
98 <intent-filter>
99 <action android:name="android.intent.action.BOOT_COMPLETED" />
100 <action android:name="android.net.conn.CONNECTIVITY_CHANGE" />
101 <action android:name="android.intent.action.ACTION_SHUTDOWN" />
102 <action android:name="android.media.RINGER_MODE_CHANGED" />
103 </intent-filter>
104 </receiver>
105
106 <activity
107 android:name=".ui.ShareLocationActivity"
108 android:label="@string/title_activity_share_location"
109 android:exported="true"/>
110 <activity
111 android:name=".ui.SearchActivity"
112 android:label="@string/search_messages"
113 android:exported="true" />
114 <activity
115 android:name=".ui.RecordingActivity"
116 android:configChanges="orientation|screenSize"
117 android:theme="@style/ConversationsTheme.Dialog"
118 android:exported="true" />
119 <activity
120 android:name=".ui.ShowLocationActivity"
121 android:label="@string/title_activity_show_location"
122 android:exported="true" />
123 <activity
124 android:name=".ui.SplashActivity"
125 android:theme="@style/SplashTheme"
126 android:exported="true">
127 <intent-filter>
128 <action android:name="android.intent.action.MAIN" />
129
130 <category android:name="android.intent.category.LAUNCHER" />
131 </intent-filter>
132 </activity>
133 <activity
134 android:name=".ui.ConversationsActivity"
135 android:label="@string/app_name"
136 android:launchMode="singleTask"
137 android:minWidth="300dp"
138 android:minHeight="300dp"
139 android:exported="true"
140 android:windowSoftInputMode="stateHidden" />
141 <activity
142 android:name=".ui.ScanActivity"
143 android:screenOrientation="portrait"
144 android:exported="true"
145 android:theme="@style/ConversationsTheme.FullScreen"
146 android:windowSoftInputMode="stateAlwaysHidden" />
147 <activity
148 android:name=".ui.UriHandlerActivity"
149 android:label="@string/app_name"
150 android:exported="true">
151 <intent-filter>
152 <action android:name="android.intent.action.VIEW" />
153
154 <category android:name="android.intent.category.DEFAULT" />
155 <category android:name="android.intent.category.BROWSABLE" />
156
157 <data android:scheme="xmpp" />
158 </intent-filter>
159 <intent-filter android:autoVerify="true">
160 <action android:name="android.intent.action.VIEW" />
161
162 <category android:name="android.intent.category.DEFAULT" />
163 <category android:name="android.intent.category.BROWSABLE" />
164
165 <data android:scheme="https" />
166 <data android:host="im.app.in" />
167 <data android:pathPrefix="/i/" />
168 <data android:pathPrefix="/j/" />
169 </intent-filter>
170 <intent-filter>
171 <action android:name="android.intent.action.SENDTO" />
172
173 <category android:name="android.intent.category.DEFAULT" />
174
175 <data android:scheme="imto" />
176 <data android:host="jabber" />
177 </intent-filter>
178 </activity>
179 <activity
180 android:name=".ui.StartConversationActivity"
181 android:label="@string/title_activity_start_conversation"
182 android:launchMode="singleTop"
183 android:exported="true">
184 <intent-filter>
185 <action android:name="android.intent.action.VIEW" />
186 </intent-filter>
187 </activity>
188 <activity
189 android:name=".ui.SettingsActivity"
190 android:label="@string/title_activity_settings"
191 android:exported="true">
192 <intent-filter>
193 <action android:name="android.intent.action.MAIN" />
194
195 <category android:name="android.intent.category.NOTIFICATION_PREFERENCES" />
196 </intent-filter>
197 </activity>
198 <activity
199 android:name=".ui.ChooseContactActivity"
200 android:label="@string/title_activity_choose_contact"
201 android:exported="true" />
202 <activity
203 android:name=".ui.BlocklistActivity"
204 android:label="@string/title_activity_block_list"
205 android:exported="true"/>
206 <activity
207 android:name=".ui.ChangePasswordActivity"
208 android:label="@string/change_password_on_server"
209 android:exported="true"/>
210 <activity
211 android:name=".ui.ChooseAccountForProfilePictureActivity"
212 android:enabled="false"
213 android:label="@string/choose_account"
214 android:exported="true">
215 <intent-filter android:label="@string/set_profile_picture">
216 <action android:name="android.intent.action.ATTACH_DATA" />
217
218 <category android:name="android.intent.category.DEFAULT" />
219
220 <data android:mimeType="image/*" />
221 </intent-filter>
222 </activity>
223 <activity
224 android:name=".ui.ShareViaAccountActivity"
225 android:label="@string/title_activity_share_via_account"
226 android:launchMode="singleTop"
227 android:exported="true" />
228 <activity
229 android:name=".ui.EditAccountActivity"
230 android:launchMode="singleTop"
231 android:exported="true"
232 android:windowSoftInputMode="stateHidden|adjustResize" />
233 <activity
234 android:name=".ui.ConferenceDetailsActivity"
235 android:label="@string/action_muc_details"
236 android:exported="true"
237 android:windowSoftInputMode="stateHidden" />
238 <activity
239 android:name=".ui.ContactDetailsActivity"
240 android:exported="true"
241 android:windowSoftInputMode="stateHidden" />
242 <activity
243 android:name=".ui.PublishProfilePictureActivity"
244 android:label="@string/mgmt_account_publish_avatar"
245 android:exported="true"
246 android:windowSoftInputMode="stateHidden" />
247 <activity
248 android:name=".ui.PublishGroupChatProfilePictureActivity"
249 android:exported="true"
250 android:label="@string/group_chat_avatar" />
251 <activity
252 android:name=".ui.ShareWithActivity"
253 android:label="@string/app_name"
254 android:launchMode="singleTop"
255 android:exported="true">
256 <intent-filter>
257 <action android:name="android.intent.action.SEND" />
258 <action android:name="android.intent.action.SEND_MULTIPLE" />
259
260 <category android:name="android.intent.category.DEFAULT" />
261
262 <data android:mimeType="text/plain" />
263 </intent-filter>
264 <intent-filter>
265 <action android:name="android.intent.action.SEND" />
266 <action android:name="android.intent.action.SEND_MULTIPLE" />
267
268 <category android:name="android.intent.category.DEFAULT" />
269
270 <data android:mimeType="*/*" />
271 </intent-filter>
272
273 <!-- the value here needs to be the full class name; independent of the configured applicationId -->
274 <meta-data
275 android:name="android.service.chooser.chooser_target_service"
276 android:value="eu.siacs.conversations.services.ContactChooserTargetService" />
277 </activity>
278 <activity
279 android:name=".ui.TrustKeysActivity"
280 android:label="@string/trust_omemo_fingerprints"
281 android:exported="true"
282 android:windowSoftInputMode="stateAlwaysHidden" />
283 <activity
284 android:name="com.theartofdev.edmodo.cropper.CropImageActivity"
285 android:exported="true"
286 android:theme="@style/Base.Theme.AppCompat" />
287 <activity android:name=".ui.MemorizingActivity"
288 android:exported="true" />
289 <activity
290 android:name=".ui.MediaBrowserActivity"
291 android:exported="true"
292 android:label="@string/media_browser" />
293
294 <service android:name=".services.ExportBackupService" android:exported="true"/>
295 <service android:name=".services.ImportBackupService" android:exported="true"/>
296 <service
297 android:name=".services.ContactChooserTargetService"
298 android:permission="android.permission.BIND_CHOOSER_TARGET_SERVICE"
299 android:exported="true">
300 <intent-filter>
301 <action android:name="android.service.chooser.ChooserTargetService" />
302 </intent-filter>
303 </service>
304 <service android:name=".services.CompulsoryUpdateService" android:exported="true"/>
305
306 <provider
307 android:name="androidx.core.content.FileProvider"
308 android:authorities="${applicationId}.files"
309 android:exported="false"
310 android:grantUriPermissions="true">
311 <meta-data
312 android:name="android.support.FILE_PROVIDER_PATHS"
313 android:resource="@xml/file_paths" />
314 </provider>
315 <provider
316 android:name=".services.BarcodeProvider"
317 android:authorities="${applicationId}.barcodes"
318 android:exported="false"
319 android:grantUriPermissions="true" />
320
321 <activity
322 android:name=".ui.ShortcutActivity"
323 android:label="@string/contact"
324 android:exported="true">
325 <intent-filter>
326 <action android:name="android.intent.action.CREATE_SHORTCUT" />
327 </intent-filter>
328 </activity>
329 <activity
330 android:name=".ui.MucUsersActivity"
331 android:exported="true"
332 android:label="@string/group_chat_members" />
333 <activity
334 android:name=".ui.ChannelDiscoveryActivity"
335 android:exported="true"
336 android:label="@string/discover_channels" />
337 <activity
338 android:name=".ui.RtpSessionActivity"
339 android:autoRemoveFromRecents="true"
340 android:exported="true"
341 android:launchMode="singleInstance"
342 android:supportsPictureInPicture="true" />
343 </application>
344
345</manifest>
346
My second manifest file:
1<?xml version="1.0" encoding="utf-8"?>
2<manifest xmlns:android="http://schemas.android.com/apk/res/android"
3 xmlns:tools="http://schemas.android.com/tools"
4 package="eu.siacs.conversations">
5
6 <uses-sdk tools:overrideLibrary="net.ypresto.androidtranscoder" />
7
8 <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
9 <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
10 <uses-permission android:name="android.permission.READ_CONTACTS" />
11 <uses-permission android:name="android.permission.READ_PROFILE" />
12 <uses-permission
13 android:name="android.permission.READ_PHONE_STATE"
14 android:maxSdkVersion="22" />
15 <uses-permission android:name="android.permission.INTERNET" />
16 <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
17 <uses-permission android:name="android.permission.WAKE_LOCK" />
18 <uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
19 <uses-permission android:name="android.permission.VIBRATE" />
20 <uses-permission android:name="android.permission.REQUEST_IGNORE_BATTERY_OPTIMIZATIONS" />
21 <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
22 <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
23 <uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
24 <uses-permission android:name="android.permission.FOREGROUND_SERVICE" />
25 <uses-permission android:name="android.permission.REQUEST_INSTALL_PACKAGES" />
26
27 <uses-feature
28 android:name="android.hardware.location"
29 android:required="false" />
30 <uses-feature
31 android:name="android.hardware.location.gps"
32 android:required="false" />
33 <uses-feature
34 android:name="android.hardware.location.network"
35 android:required="false" />
36
37 <uses-permission android:name="android.permission.CAMERA" />
38 <uses-permission android:name="android.permission.RECORD_AUDIO" />
39 <uses-permission android:name="android.permission.BLUETOOTH" />
40 <uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS" />
41 <uses-permission android:name="android.permission.USE_FULL_SCREEN_INTENT" />
42 <uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW" />
43
44 <uses-feature
45 android:name="android.hardware.camera"
46 android:required="false" />
47 <uses-feature
48 android:name="android.hardware.camera.autofocus"
49 android:required="false" />
50 <uses-feature
51 android:name="android.hardware.microphone"
52 android:required="false" />
53
54 <application
55 android:name=".Application"
56 android:allowBackup="false"
57 android:allowClearUserData="true"
58 android:appCategory="social"
59 android:hardwareAccelerated="true"
60 android:icon="@mipmap/ic_app_launch"
61 android:label="@string/app_name"
62 android:largeHeap="true"
63 android:networkSecurityConfig="@xml/network_security_configuration"
64 android:requestLegacyExternalStorage="true"
65 android:roundIcon="@mipmap/ic_app_launch_round"
66 android:theme="@style/ConversationsTheme"
67 android:usesCleartextTraffic="true"
68 android:windowSoftInputMode="adjustPan|adjustResize"
69 tools:replace="android:label"
70 tools:targetApi="q">
71 <activity
72 android:name=".ui.search.GroupSearchActivity"
73 android:exported="true" />
74 <activity
75 android:name=".ui.profileUpdating.FavouritesActivity"
76 android:exported="true" />
77 <activity
78 android:name=".ui.profileUpdating.NameActivity"
79 android:exported="true" />
80 <activity
81 android:name=".ui.CompulsoryUpdateActivity"
82 android:exported="true" />
83 <activity android:name=".ui.payments.doPayment.DoPaymentActivity"
84 android:exported="true" />
85 <activity android:name=".ui.individualList.IndividualListActivity"
86 android:exported="true" />
87 <activity android:name=".ui.payments.setPayment.SetPaymentActivity"
88 android:exported="true" />
89 <activity android:name=".ui.login.otpActivity.OTPActivity"
90 android:exported="true" />
91 <activity android:name=".ui.login.loginActivity.LoginActivity"
92 android:exported="true" />
93
94 <service android:name=".services.XmppConnectionService" android:exported="true" />
95
96 <receiver android:name=".services.EventReceiver"
97 android:exported="true">
98 <intent-filter>
99 <action android:name="android.intent.action.BOOT_COMPLETED" />
100 <action android:name="android.net.conn.CONNECTIVITY_CHANGE" />
101 <action android:name="android.intent.action.ACTION_SHUTDOWN" />
102 <action android:name="android.media.RINGER_MODE_CHANGED" />
103 </intent-filter>
104 </receiver>
105
106 <activity
107 android:name=".ui.ShareLocationActivity"
108 android:label="@string/title_activity_share_location"
109 android:exported="true"/>
110 <activity
111 android:name=".ui.SearchActivity"
112 android:label="@string/search_messages"
113 android:exported="true" />
114 <activity
115 android:name=".ui.RecordingActivity"
116 android:configChanges="orientation|screenSize"
117 android:theme="@style/ConversationsTheme.Dialog"
118 android:exported="true" />
119 <activity
120 android:name=".ui.ShowLocationActivity"
121 android:label="@string/title_activity_show_location"
122 android:exported="true" />
123 <activity
124 android:name=".ui.SplashActivity"
125 android:theme="@style/SplashTheme"
126 android:exported="true">
127 <intent-filter>
128 <action android:name="android.intent.action.MAIN" />
129
130 <category android:name="android.intent.category.LAUNCHER" />
131 </intent-filter>
132 </activity>
133 <activity
134 android:name=".ui.ConversationsActivity"
135 android:label="@string/app_name"
136 android:launchMode="singleTask"
137 android:minWidth="300dp"
138 android:minHeight="300dp"
139 android:exported="true"
140 android:windowSoftInputMode="stateHidden" />
141 <activity
142 android:name=".ui.ScanActivity"
143 android:screenOrientation="portrait"
144 android:exported="true"
145 android:theme="@style/ConversationsTheme.FullScreen"
146 android:windowSoftInputMode="stateAlwaysHidden" />
147 <activity
148 android:name=".ui.UriHandlerActivity"
149 android:label="@string/app_name"
150 android:exported="true">
151 <intent-filter>
152 <action android:name="android.intent.action.VIEW" />
153
154 <category android:name="android.intent.category.DEFAULT" />
155 <category android:name="android.intent.category.BROWSABLE" />
156
157 <data android:scheme="xmpp" />
158 </intent-filter>
159 <intent-filter android:autoVerify="true">
160 <action android:name="android.intent.action.VIEW" />
161
162 <category android:name="android.intent.category.DEFAULT" />
163 <category android:name="android.intent.category.BROWSABLE" />
164
165 <data android:scheme="https" />
166 <data android:host="im.app.in" />
167 <data android:pathPrefix="/i/" />
168 <data android:pathPrefix="/j/" />
169 </intent-filter>
170 <intent-filter>
171 <action android:name="android.intent.action.SENDTO" />
172
173 <category android:name="android.intent.category.DEFAULT" />
174
175 <data android:scheme="imto" />
176 <data android:host="jabber" />
177 </intent-filter>
178 </activity>
179 <activity
180 android:name=".ui.StartConversationActivity"
181 android:label="@string/title_activity_start_conversation"
182 android:launchMode="singleTop"
183 android:exported="true">
184 <intent-filter>
185 <action android:name="android.intent.action.VIEW" />
186 </intent-filter>
187 </activity>
188 <activity
189 android:name=".ui.SettingsActivity"
190 android:label="@string/title_activity_settings"
191 android:exported="true">
192 <intent-filter>
193 <action android:name="android.intent.action.MAIN" />
194
195 <category android:name="android.intent.category.NOTIFICATION_PREFERENCES" />
196 </intent-filter>
197 </activity>
198 <activity
199 android:name=".ui.ChooseContactActivity"
200 android:label="@string/title_activity_choose_contact"
201 android:exported="true" />
202 <activity
203 android:name=".ui.BlocklistActivity"
204 android:label="@string/title_activity_block_list"
205 android:exported="true"/>
206 <activity
207 android:name=".ui.ChangePasswordActivity"
208 android:label="@string/change_password_on_server"
209 android:exported="true"/>
210 <activity
211 android:name=".ui.ChooseAccountForProfilePictureActivity"
212 android:enabled="false"
213 android:label="@string/choose_account"
214 android:exported="true">
215 <intent-filter android:label="@string/set_profile_picture">
216 <action android:name="android.intent.action.ATTACH_DATA" />
217
218 <category android:name="android.intent.category.DEFAULT" />
219
220 <data android:mimeType="image/*" />
221 </intent-filter>
222 </activity>
223 <activity
224 android:name=".ui.ShareViaAccountActivity"
225 android:label="@string/title_activity_share_via_account"
226 android:launchMode="singleTop"
227 android:exported="true" />
228 <activity
229 android:name=".ui.EditAccountActivity"
230 android:launchMode="singleTop"
231 android:exported="true"
232 android:windowSoftInputMode="stateHidden|adjustResize" />
233 <activity
234 android:name=".ui.ConferenceDetailsActivity"
235 android:label="@string/action_muc_details"
236 android:exported="true"
237 android:windowSoftInputMode="stateHidden" />
238 <activity
239 android:name=".ui.ContactDetailsActivity"
240 android:exported="true"
241 android:windowSoftInputMode="stateHidden" />
242 <activity
243 android:name=".ui.PublishProfilePictureActivity"
244 android:label="@string/mgmt_account_publish_avatar"
245 android:exported="true"
246 android:windowSoftInputMode="stateHidden" />
247 <activity
248 android:name=".ui.PublishGroupChatProfilePictureActivity"
249 android:exported="true"
250 android:label="@string/group_chat_avatar" />
251 <activity
252 android:name=".ui.ShareWithActivity"
253 android:label="@string/app_name"
254 android:launchMode="singleTop"
255 android:exported="true">
256 <intent-filter>
257 <action android:name="android.intent.action.SEND" />
258 <action android:name="android.intent.action.SEND_MULTIPLE" />
259
260 <category android:name="android.intent.category.DEFAULT" />
261
262 <data android:mimeType="text/plain" />
263 </intent-filter>
264 <intent-filter>
265 <action android:name="android.intent.action.SEND" />
266 <action android:name="android.intent.action.SEND_MULTIPLE" />
267
268 <category android:name="android.intent.category.DEFAULT" />
269
270 <data android:mimeType="*/*" />
271 </intent-filter>
272
273 <!-- the value here needs to be the full class name; independent of the configured applicationId -->
274 <meta-data
275 android:name="android.service.chooser.chooser_target_service"
276 android:value="eu.siacs.conversations.services.ContactChooserTargetService" />
277 </activity>
278 <activity
279 android:name=".ui.TrustKeysActivity"
280 android:label="@string/trust_omemo_fingerprints"
281 android:exported="true"
282 android:windowSoftInputMode="stateAlwaysHidden" />
283 <activity
284 android:name="com.theartofdev.edmodo.cropper.CropImageActivity"
285 android:exported="true"
286 android:theme="@style/Base.Theme.AppCompat" />
287 <activity android:name=".ui.MemorizingActivity"
288 android:exported="true" />
289 <activity
290 android:name=".ui.MediaBrowserActivity"
291 android:exported="true"
292 android:label="@string/media_browser" />
293
294 <service android:name=".services.ExportBackupService" android:exported="true"/>
295 <service android:name=".services.ImportBackupService" android:exported="true"/>
296 <service
297 android:name=".services.ContactChooserTargetService"
298 android:permission="android.permission.BIND_CHOOSER_TARGET_SERVICE"
299 android:exported="true">
300 <intent-filter>
301 <action android:name="android.service.chooser.ChooserTargetService" />
302 </intent-filter>
303 </service>
304 <service android:name=".services.CompulsoryUpdateService" android:exported="true"/>
305
306 <provider
307 android:name="androidx.core.content.FileProvider"
308 android:authorities="${applicationId}.files"
309 android:exported="false"
310 android:grantUriPermissions="true">
311 <meta-data
312 android:name="android.support.FILE_PROVIDER_PATHS"
313 android:resource="@xml/file_paths" />
314 </provider>
315 <provider
316 android:name=".services.BarcodeProvider"
317 android:authorities="${applicationId}.barcodes"
318 android:exported="false"
319 android:grantUriPermissions="true" />
320
321 <activity
322 android:name=".ui.ShortcutActivity"
323 android:label="@string/contact"
324 android:exported="true">
325 <intent-filter>
326 <action android:name="android.intent.action.CREATE_SHORTCUT" />
327 </intent-filter>
328 </activity>
329 <activity
330 android:name=".ui.MucUsersActivity"
331 android:exported="true"
332 android:label="@string/group_chat_members" />
333 <activity
334 android:name=".ui.ChannelDiscoveryActivity"
335 android:exported="true"
336 android:label="@string/discover_channels" />
337 <activity
338 android:name=".ui.RtpSessionActivity"
339 android:autoRemoveFromRecents="true"
340 android:exported="true"
341 android:launchMode="singleInstance"
342 android:supportsPictureInPicture="true" />
343 </application>
344
345</manifest>
346<?xml version="1.0" encoding="utf-8"?>
347<manifest xmlns:android="http://schemas.android.com/apk/res/android"
348 xmlns:tools="http://schemas.android.com/tools"
349 package="eu.siacs.conversations">
350
351 <application tools:ignore="GoogleAppIndexingWarning">
352 <activity
353 android:name=".ui.ManageAccountActivity"
354 android:label="@string/title_activity_manage_accounts"
355 android:launchMode="singleTask"
356 android:exported="true"/>
357 <activity
358 android:name=".ui.MagicCreateActivity"
359 android:label="@string/create_new_account"
360 android:launchMode="singleTask"
361 android:exported="true"/>
362 <activity
363 android:name=".ui.EasyOnboardingInviteActivity"
364 android:label="@string/invite_to_app"
365 android:launchMode="singleTask" />
366 <activity
367 android:name=".ui.ImportBackupActivity"
368 android:label="@string/restore_backup"
369 android:launchMode="singleTask"
370 android:exported="true">
371 <intent-filter>
372 <action android:name="android.intent.action.VIEW" />
373 <category android:name="android.intent.category.DEFAULT" />
374
375 <data android:mimeType="application/vnd.conversations.backup" />
376 <data android:scheme="content" />
377 </intent-filter>
378 <intent-filter>
379 <action android:name="android.intent.action.VIEW" />
380 <category android:name="android.intent.category.DEFAULT" />
381
382 <data android:mimeType="application/vnd.conversations.backup" />
383 <data android:scheme="file" />
384 </intent-filter>
385 <intent-filter>
386 <action android:name="android.intent.action.VIEW" />
387
388 <category android:name="android.intent.category.DEFAULT" />
389 <category android:name="android.intent.category.BROWSABLE" />
390
391 <data android:scheme="content" />
392 <data android:host="*" />
393 <data android:mimeType="*/*" />
394 <data android:pathPattern=".*\\.ceb" />
395 <data android:pathPattern=".*\\..*\\.ceb" />
396 <data android:pathPattern=".*\\..*\\..*\\.ceb" />
397 <data android:pathPattern=".*\\..*\\..*\\..*\\.ceb" />
398 <data android:pathPattern=".*\\..*\\..*\\..*\\..*\\.ceb" />
399 <data android:pathPattern=".*\\..*\\..*\\..*\\..*\\..*\\.ceb" />
400 <data android:pathPattern=".*\\..*\\..*\\..*\\..*\\..*\\..*\\.ceb" />
401 </intent-filter>
402 <intent-filter>
403 <action android:name="android.intent.action.VIEW" />
404
405 <category android:name="android.intent.category.DEFAULT" />
406 <category android:name="android.intent.category.BROWSABLE" />
407
408 <data android:scheme="file" />
409 <data android:host="*" />
410 <data android:mimeType="*/*" />
411 <data android:pathPattern=".*\\.ceb" />
412 <data android:pathPattern=".*\\..*\\.ceb" />
413 <data android:pathPattern=".*\\..*\\..*\\.ceb" />
414 <data android:pathPattern=".*\\..*\\..*\\..*\\.ceb" />
415 <data android:pathPattern=".*\\..*\\..*\\..*\\..*\\.ceb" />
416 <data android:pathPattern=".*\\..*\\..*\\..*\\..*\\..*\\.ceb" />
417 <data android:pathPattern=".*\\..*\\..*\\..*\\..*\\..*\\..*\\.ceb" />
418 </intent-filter>
419 </activity>
420 </application>
421</manifest>
422
423
My gradle file:
1<?xml version="1.0" encoding="utf-8"?>
2<manifest xmlns:android="http://schemas.android.com/apk/res/android"
3 xmlns:tools="http://schemas.android.com/tools"
4 package="eu.siacs.conversations">
5
6 <uses-sdk tools:overrideLibrary="net.ypresto.androidtranscoder" />
7
8 <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
9 <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
10 <uses-permission android:name="android.permission.READ_CONTACTS" />
11 <uses-permission android:name="android.permission.READ_PROFILE" />
12 <uses-permission
13 android:name="android.permission.READ_PHONE_STATE"
14 android:maxSdkVersion="22" />
15 <uses-permission android:name="android.permission.INTERNET" />
16 <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
17 <uses-permission android:name="android.permission.WAKE_LOCK" />
18 <uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
19 <uses-permission android:name="android.permission.VIBRATE" />
20 <uses-permission android:name="android.permission.REQUEST_IGNORE_BATTERY_OPTIMIZATIONS" />
21 <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
22 <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
23 <uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
24 <uses-permission android:name="android.permission.FOREGROUND_SERVICE" />
25 <uses-permission android:name="android.permission.REQUEST_INSTALL_PACKAGES" />
26
27 <uses-feature
28 android:name="android.hardware.location"
29 android:required="false" />
30 <uses-feature
31 android:name="android.hardware.location.gps"
32 android:required="false" />
33 <uses-feature
34 android:name="android.hardware.location.network"
35 android:required="false" />
36
37 <uses-permission android:name="android.permission.CAMERA" />
38 <uses-permission android:name="android.permission.RECORD_AUDIO" />
39 <uses-permission android:name="android.permission.BLUETOOTH" />
40 <uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS" />
41 <uses-permission android:name="android.permission.USE_FULL_SCREEN_INTENT" />
42 <uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW" />
43
44 <uses-feature
45 android:name="android.hardware.camera"
46 android:required="false" />
47 <uses-feature
48 android:name="android.hardware.camera.autofocus"
49 android:required="false" />
50 <uses-feature
51 android:name="android.hardware.microphone"
52 android:required="false" />
53
54 <application
55 android:name=".Application"
56 android:allowBackup="false"
57 android:allowClearUserData="true"
58 android:appCategory="social"
59 android:hardwareAccelerated="true"
60 android:icon="@mipmap/ic_app_launch"
61 android:label="@string/app_name"
62 android:largeHeap="true"
63 android:networkSecurityConfig="@xml/network_security_configuration"
64 android:requestLegacyExternalStorage="true"
65 android:roundIcon="@mipmap/ic_app_launch_round"
66 android:theme="@style/ConversationsTheme"
67 android:usesCleartextTraffic="true"
68 android:windowSoftInputMode="adjustPan|adjustResize"
69 tools:replace="android:label"
70 tools:targetApi="q">
71 <activity
72 android:name=".ui.search.GroupSearchActivity"
73 android:exported="true" />
74 <activity
75 android:name=".ui.profileUpdating.FavouritesActivity"
76 android:exported="true" />
77 <activity
78 android:name=".ui.profileUpdating.NameActivity"
79 android:exported="true" />
80 <activity
81 android:name=".ui.CompulsoryUpdateActivity"
82 android:exported="true" />
83 <activity android:name=".ui.payments.doPayment.DoPaymentActivity"
84 android:exported="true" />
85 <activity android:name=".ui.individualList.IndividualListActivity"
86 android:exported="true" />
87 <activity android:name=".ui.payments.setPayment.SetPaymentActivity"
88 android:exported="true" />
89 <activity android:name=".ui.login.otpActivity.OTPActivity"
90 android:exported="true" />
91 <activity android:name=".ui.login.loginActivity.LoginActivity"
92 android:exported="true" />
93
94 <service android:name=".services.XmppConnectionService" android:exported="true" />
95
96 <receiver android:name=".services.EventReceiver"
97 android:exported="true">
98 <intent-filter>
99 <action android:name="android.intent.action.BOOT_COMPLETED" />
100 <action android:name="android.net.conn.CONNECTIVITY_CHANGE" />
101 <action android:name="android.intent.action.ACTION_SHUTDOWN" />
102 <action android:name="android.media.RINGER_MODE_CHANGED" />
103 </intent-filter>
104 </receiver>
105
106 <activity
107 android:name=".ui.ShareLocationActivity"
108 android:label="@string/title_activity_share_location"
109 android:exported="true"/>
110 <activity
111 android:name=".ui.SearchActivity"
112 android:label="@string/search_messages"
113 android:exported="true" />
114 <activity
115 android:name=".ui.RecordingActivity"
116 android:configChanges="orientation|screenSize"
117 android:theme="@style/ConversationsTheme.Dialog"
118 android:exported="true" />
119 <activity
120 android:name=".ui.ShowLocationActivity"
121 android:label="@string/title_activity_show_location"
122 android:exported="true" />
123 <activity
124 android:name=".ui.SplashActivity"
125 android:theme="@style/SplashTheme"
126 android:exported="true">
127 <intent-filter>
128 <action android:name="android.intent.action.MAIN" />
129
130 <category android:name="android.intent.category.LAUNCHER" />
131 </intent-filter>
132 </activity>
133 <activity
134 android:name=".ui.ConversationsActivity"
135 android:label="@string/app_name"
136 android:launchMode="singleTask"
137 android:minWidth="300dp"
138 android:minHeight="300dp"
139 android:exported="true"
140 android:windowSoftInputMode="stateHidden" />
141 <activity
142 android:name=".ui.ScanActivity"
143 android:screenOrientation="portrait"
144 android:exported="true"
145 android:theme="@style/ConversationsTheme.FullScreen"
146 android:windowSoftInputMode="stateAlwaysHidden" />
147 <activity
148 android:name=".ui.UriHandlerActivity"
149 android:label="@string/app_name"
150 android:exported="true">
151 <intent-filter>
152 <action android:name="android.intent.action.VIEW" />
153
154 <category android:name="android.intent.category.DEFAULT" />
155 <category android:name="android.intent.category.BROWSABLE" />
156
157 <data android:scheme="xmpp" />
158 </intent-filter>
159 <intent-filter android:autoVerify="true">
160 <action android:name="android.intent.action.VIEW" />
161
162 <category android:name="android.intent.category.DEFAULT" />
163 <category android:name="android.intent.category.BROWSABLE" />
164
165 <data android:scheme="https" />
166 <data android:host="im.app.in" />
167 <data android:pathPrefix="/i/" />
168 <data android:pathPrefix="/j/" />
169 </intent-filter>
170 <intent-filter>
171 <action android:name="android.intent.action.SENDTO" />
172
173 <category android:name="android.intent.category.DEFAULT" />
174
175 <data android:scheme="imto" />
176 <data android:host="jabber" />
177 </intent-filter>
178 </activity>
179 <activity
180 android:name=".ui.StartConversationActivity"
181 android:label="@string/title_activity_start_conversation"
182 android:launchMode="singleTop"
183 android:exported="true">
184 <intent-filter>
185 <action android:name="android.intent.action.VIEW" />
186 </intent-filter>
187 </activity>
188 <activity
189 android:name=".ui.SettingsActivity"
190 android:label="@string/title_activity_settings"
191 android:exported="true">
192 <intent-filter>
193 <action android:name="android.intent.action.MAIN" />
194
195 <category android:name="android.intent.category.NOTIFICATION_PREFERENCES" />
196 </intent-filter>
197 </activity>
198 <activity
199 android:name=".ui.ChooseContactActivity"
200 android:label="@string/title_activity_choose_contact"
201 android:exported="true" />
202 <activity
203 android:name=".ui.BlocklistActivity"
204 android:label="@string/title_activity_block_list"
205 android:exported="true"/>
206 <activity
207 android:name=".ui.ChangePasswordActivity"
208 android:label="@string/change_password_on_server"
209 android:exported="true"/>
210 <activity
211 android:name=".ui.ChooseAccountForProfilePictureActivity"
212 android:enabled="false"
213 android:label="@string/choose_account"
214 android:exported="true">
215 <intent-filter android:label="@string/set_profile_picture">
216 <action android:name="android.intent.action.ATTACH_DATA" />
217
218 <category android:name="android.intent.category.DEFAULT" />
219
220 <data android:mimeType="image/*" />
221 </intent-filter>
222 </activity>
223 <activity
224 android:name=".ui.ShareViaAccountActivity"
225 android:label="@string/title_activity_share_via_account"
226 android:launchMode="singleTop"
227 android:exported="true" />
228 <activity
229 android:name=".ui.EditAccountActivity"
230 android:launchMode="singleTop"
231 android:exported="true"
232 android:windowSoftInputMode="stateHidden|adjustResize" />
233 <activity
234 android:name=".ui.ConferenceDetailsActivity"
235 android:label="@string/action_muc_details"
236 android:exported="true"
237 android:windowSoftInputMode="stateHidden" />
238 <activity
239 android:name=".ui.ContactDetailsActivity"
240 android:exported="true"
241 android:windowSoftInputMode="stateHidden" />
242 <activity
243 android:name=".ui.PublishProfilePictureActivity"
244 android:label="@string/mgmt_account_publish_avatar"
245 android:exported="true"
246 android:windowSoftInputMode="stateHidden" />
247 <activity
248 android:name=".ui.PublishGroupChatProfilePictureActivity"
249 android:exported="true"
250 android:label="@string/group_chat_avatar" />
251 <activity
252 android:name=".ui.ShareWithActivity"
253 android:label="@string/app_name"
254 android:launchMode="singleTop"
255 android:exported="true">
256 <intent-filter>
257 <action android:name="android.intent.action.SEND" />
258 <action android:name="android.intent.action.SEND_MULTIPLE" />
259
260 <category android:name="android.intent.category.DEFAULT" />
261
262 <data android:mimeType="text/plain" />
263 </intent-filter>
264 <intent-filter>
265 <action android:name="android.intent.action.SEND" />
266 <action android:name="android.intent.action.SEND_MULTIPLE" />
267
268 <category android:name="android.intent.category.DEFAULT" />
269
270 <data android:mimeType="*/*" />
271 </intent-filter>
272
273 <!-- the value here needs to be the full class name; independent of the configured applicationId -->
274 <meta-data
275 android:name="android.service.chooser.chooser_target_service"
276 android:value="eu.siacs.conversations.services.ContactChooserTargetService" />
277 </activity>
278 <activity
279 android:name=".ui.TrustKeysActivity"
280 android:label="@string/trust_omemo_fingerprints"
281 android:exported="true"
282 android:windowSoftInputMode="stateAlwaysHidden" />
283 <activity
284 android:name="com.theartofdev.edmodo.cropper.CropImageActivity"
285 android:exported="true"
286 android:theme="@style/Base.Theme.AppCompat" />
287 <activity android:name=".ui.MemorizingActivity"
288 android:exported="true" />
289 <activity
290 android:name=".ui.MediaBrowserActivity"
291 android:exported="true"
292 android:label="@string/media_browser" />
293
294 <service android:name=".services.ExportBackupService" android:exported="true"/>
295 <service android:name=".services.ImportBackupService" android:exported="true"/>
296 <service
297 android:name=".services.ContactChooserTargetService"
298 android:permission="android.permission.BIND_CHOOSER_TARGET_SERVICE"
299 android:exported="true">
300 <intent-filter>
301 <action android:name="android.service.chooser.ChooserTargetService" />
302 </intent-filter>
303 </service>
304 <service android:name=".services.CompulsoryUpdateService" android:exported="true"/>
305
306 <provider
307 android:name="androidx.core.content.FileProvider"
308 android:authorities="${applicationId}.files"
309 android:exported="false"
310 android:grantUriPermissions="true">
311 <meta-data
312 android:name="android.support.FILE_PROVIDER_PATHS"
313 android:resource="@xml/file_paths" />
314 </provider>
315 <provider
316 android:name=".services.BarcodeProvider"
317 android:authorities="${applicationId}.barcodes"
318 android:exported="false"
319 android:grantUriPermissions="true" />
320
321 <activity
322 android:name=".ui.ShortcutActivity"
323 android:label="@string/contact"
324 android:exported="true">
325 <intent-filter>
326 <action android:name="android.intent.action.CREATE_SHORTCUT" />
327 </intent-filter>
328 </activity>
329 <activity
330 android:name=".ui.MucUsersActivity"
331 android:exported="true"
332 android:label="@string/group_chat_members" />
333 <activity
334 android:name=".ui.ChannelDiscoveryActivity"
335 android:exported="true"
336 android:label="@string/discover_channels" />
337 <activity
338 android:name=".ui.RtpSessionActivity"
339 android:autoRemoveFromRecents="true"
340 android:exported="true"
341 android:launchMode="singleInstance"
342 android:supportsPictureInPicture="true" />
343 </application>
344
345</manifest>
346<?xml version="1.0" encoding="utf-8"?>
347<manifest xmlns:android="http://schemas.android.com/apk/res/android"
348 xmlns:tools="http://schemas.android.com/tools"
349 package="eu.siacs.conversations">
350
351 <application tools:ignore="GoogleAppIndexingWarning">
352 <activity
353 android:name=".ui.ManageAccountActivity"
354 android:label="@string/title_activity_manage_accounts"
355 android:launchMode="singleTask"
356 android:exported="true"/>
357 <activity
358 android:name=".ui.MagicCreateActivity"
359 android:label="@string/create_new_account"
360 android:launchMode="singleTask"
361 android:exported="true"/>
362 <activity
363 android:name=".ui.EasyOnboardingInviteActivity"
364 android:label="@string/invite_to_app"
365 android:launchMode="singleTask" />
366 <activity
367 android:name=".ui.ImportBackupActivity"
368 android:label="@string/restore_backup"
369 android:launchMode="singleTask"
370 android:exported="true">
371 <intent-filter>
372 <action android:name="android.intent.action.VIEW" />
373 <category android:name="android.intent.category.DEFAULT" />
374
375 <data android:mimeType="application/vnd.conversations.backup" />
376 <data android:scheme="content" />
377 </intent-filter>
378 <intent-filter>
379 <action android:name="android.intent.action.VIEW" />
380 <category android:name="android.intent.category.DEFAULT" />
381
382 <data android:mimeType="application/vnd.conversations.backup" />
383 <data android:scheme="file" />
384 </intent-filter>
385 <intent-filter>
386 <action android:name="android.intent.action.VIEW" />
387
388 <category android:name="android.intent.category.DEFAULT" />
389 <category android:name="android.intent.category.BROWSABLE" />
390
391 <data android:scheme="content" />
392 <data android:host="*" />
393 <data android:mimeType="*/*" />
394 <data android:pathPattern=".*\\.ceb" />
395 <data android:pathPattern=".*\\..*\\.ceb" />
396 <data android:pathPattern=".*\\..*\\..*\\.ceb" />
397 <data android:pathPattern=".*\\..*\\..*\\..*\\.ceb" />
398 <data android:pathPattern=".*\\..*\\..*\\..*\\..*\\.ceb" />
399 <data android:pathPattern=".*\\..*\\..*\\..*\\..*\\..*\\.ceb" />
400 <data android:pathPattern=".*\\..*\\..*\\..*\\..*\\..*\\..*\\.ceb" />
401 </intent-filter>
402 <intent-filter>
403 <action android:name="android.intent.action.VIEW" />
404
405 <category android:name="android.intent.category.DEFAULT" />
406 <category android:name="android.intent.category.BROWSABLE" />
407
408 <data android:scheme="file" />
409 <data android:host="*" />
410 <data android:mimeType="*/*" />
411 <data android:pathPattern=".*\\.ceb" />
412 <data android:pathPattern=".*\\..*\\.ceb" />
413 <data android:pathPattern=".*\\..*\\..*\\.ceb" />
414 <data android:pathPattern=".*\\..*\\..*\\..*\\.ceb" />
415 <data android:pathPattern=".*\\..*\\..*\\..*\\..*\\.ceb" />
416 <data android:pathPattern=".*\\..*\\..*\\..*\\..*\\..*\\.ceb" />
417 <data android:pathPattern=".*\\..*\\..*\\..*\\..*\\..*\\..*\\.ceb" />
418 </intent-filter>
419 </activity>
420 </application>
421</manifest>
422
423import com.android.build.OutputFile
424
425// Top-level build file where you can add configuration options common to all
426// sub-projects/modules.
427buildscript {
428 ext.kotlin_version = "1.5.21"
429 repositories {
430 google()
431 mavenCentral()
432 maven { url 'https://jitpack.io' }
433 gradlePluginPortal()
434 }
435 dependencies {
436 classpath 'com.android.tools.build:gradle:4.2.2'
437 classpath 'com.google.gms:google-services:4.3.8'
438 classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
439 }
440}
441
442apply plugin: 'com.android.application'
443apply plugin: 'kotlin-android'
444apply plugin: 'kotlin-kapt'
445apply plugin: 'com.google.gms.google-services'
446
447repositories {
448 google()
449 mavenCentral()
450 jcenter()
451 maven { url 'https://jitpack.io' }
452}
453
454configurations {
455 conversationsFreeCompatImplementation
456}
457
458dependencies {
459 implementation 'androidx.viewpager:viewpager:1.0.0'
460 implementation 'androidx.constraintlayout:constraintlayout:2.0.4'
461
462 implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
463
464 implementation 'org.sufficientlysecure:openpgp-api:10.0'
465 implementation 'com.theartofdev.edmodo:android-image-cropper:2.8.0'
466 implementation 'androidx.appcompat:appcompat:1.3.1'
467 implementation 'androidx.exifinterface:exifinterface:1.3.2'
468 implementation 'androidx.cardview:cardview:1.0.0'
469 implementation 'androidx.swiperefreshlayout:swiperefreshlayout:1.1.0'
470 implementation 'androidx.emoji:emoji:1.1.0'
471 implementation 'com.google.android.material:material:1.4.0'
472 conversationsFreeCompatImplementation 'androidx.emoji:emoji-bundled:1.1.0'
473 implementation 'org.bouncycastle:bcmail-jdk15on:1.64'
474 //zxing stopped supporting Java 7 so we have to stick with 3.3.3
475 //https://github.com/zxing/zxing/issues/1170
476 implementation 'com.google.zxing:core:3.4.1'
477 implementation 'de.measite.minidns:minidns-hla:0.2.4'
478 implementation 'me.leolin:ShortcutBadger:1.1.22@aar'
479 implementation 'org.whispersystems:signal-protocol-java:2.8.1'
480 implementation 'com.makeramen:roundedimageview:2.3.0'
481 implementation "com.wefika:flowlayout:0.4.1"
482 implementation 'net.ypresto.androidtranscoder:android-transcoder:0.3.0'
483 implementation 'org.jxmpp:jxmpp-jid:1.0.1'
484 implementation 'org.osmdroid:osmdroid-android:6.1.10'
485 implementation 'org.hsluv:hsluv:0.2'
486 implementation 'org.conscrypt:conscrypt-android:2.5.2'
487 implementation 'me.drakeet.support:toastcompat:1.1.0'
488 implementation "com.leinardi.android:speed-dial:3.2.0"
489
490 implementation "com.squareup.retrofit2:retrofit:2.9.0"
491 implementation "com.squareup.retrofit2:converter-gson:2.9.0"
492 implementation "com.squareup.okhttp3:okhttp:5.0.0-alpha.2"
493 implementation 'com.squareup.okhttp3:logging-interceptor:5.0.0-alpha.2'
494
495 implementation 'com.google.guava:guava:30.1.1-android'
496 implementation 'org.webrtc:google-webrtc:1.0.32006'
497
498 // Lifecycle Helper
499 implementation "androidx.activity:activity-ktx:1.3.0-rc02"
500 implementation "androidx.fragment:fragment-ktx:1.3.6"
501
502 //Navigation
503 implementation 'androidx.navigation:navigation-fragment-ktx:2.3.5'
504 implementation 'androidx.navigation:navigation-ui-ktx:2.3.5'
505
506 //CardView
507 implementation "androidx.cardview:cardview:1.0.0"
508
509 //Country Code Picker
510 implementation 'com.hbb20:ccp:2.5.3'
511
512 //Firebase
513 implementation 'com.google.firebase:firebase-bom:28.3.0'
514 implementation 'com.google.firebase:firebase-auth-ktx:21.0.1'
515 implementation 'androidx.browser:browser:1.3.0'
516
517 //OTP view
518 implementation 'com.github.mukeshsolanki:android-otpview-pinview:2.1.2'
519
520 //Retrofit
521 implementation 'com.squareup.retrofit2:retrofit:2.9.0'
522 implementation 'com.squareup.retrofit2:converter-gson:2.9.0'
523
524 //Gson
525 implementation 'com.google.code.gson:gson:2.8.7'
526
527 //Multidex
528 implementation 'androidx.multidex:multidex:2.0.1'
529
530 //Round Image
531 implementation 'de.hdodenhof:circleimageview:3.1.0'
532
533 // Button with image and text
534 implementation 'com.github.Omega-R:OmegaCenterIconButton:0.0.4@aar'
535
536 //Razor pay
537 implementation 'com.razorpay:checkout:1.6.10'
538
539 //Mixpanel Tracking
540 implementation 'com.mixpanel.android:mixpanel-android:5.9.1'
541
542 //Loading screen
543 implementation 'com.wang.avi:library:2.1.3'
544
545 //Loading
546 implementation 'com.wang.avi:library:2.1.3'
547
548 //Form
549 implementation 'com.quickbirdstudios:surveykit:1.1.0'
550}
551
552ext {
553 travisBuild = System.getenv("TRAVIS") == "true"
554 preDexEnabled = System.getProperty("pre-dex", "true")
555 abiCodes = ['armeabi-v7a': 1, 'x86': 2, 'x86_64': 3, 'arm64-v8a': 4]
556}
557
558android {
559 compileSdkVersion 31
560
561 defaultConfig {
562 minSdkVersion 24
563 targetSdkVersion 31
564 versionCode 44
565 versionName "2.0.4"
566 multiDexEnabled = true
567 archivesBaseName += "-$versionName"
568 applicationId "com.app.app"
569 resValue "string", "applicationId", applicationId
570 def appName = "app"
571 resValue "string", "app_name", appName
572 buildConfigField "String", "APP_NAME", "\"$appName\""
573 }
574
575 splits {
576 abi {
577 universalApk true
578 enable true
579 }
580 }
581
582 configurations {
583 compile.exclude group: 'org.jetbrains' , module:'annotations'
584 }
585
586 dataBinding {
587 enabled true
588 }
589
590 dexOptions {
591 // Skip pre-dexing when running on Travis CI or when disabled via -Dpre-dex=false.
592 preDexLibraries = preDexEnabled && !travisBuild
593 jumboMode true
594 }
595
596 compileOptions {
597 sourceCompatibility JavaVersion.VERSION_1_8
598 targetCompatibility JavaVersion.VERSION_1_8
599 }
600
601 flavorDimensions("mode", "distribution", "emoji")
602
603 productFlavors {
604
605 conversations {
606 dimension "mode"
607 }
608 free {
609 dimension "distribution"
610 versionNameSuffix "+f"
611 }
612 compat {
613 dimension "emoji"
614 versionNameSuffix "c"
615 }
616 }
617
618 sourceSets {
619 conversationsFreeCompat {
620 java {
621 srcDir 'src/freeCompat/java'
622 srcDir 'src/conversationsFree/java'
623 }
624 }
625 }
626
627 buildTypes {
628 release {
629 shrinkResources true
630 minifyEnabled true
631 proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
632 versionNameSuffix "r"
633 }
634 debug {
635 shrinkResources true
636 minifyEnabled true
637 proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
638 versionNameSuffix "d"
639 }
640 }
641
642
643 if (new File("signing.properties").exists()) {
644 Properties props = new Properties()
645 props.load(new FileInputStream(file("signing.properties")))
646
647 signingConfigs {
648 release {
649 storeFile file(props['keystore'])
650 storePassword props['keystore.password']
651 keyAlias props['keystore.alias']
652 keyPassword props['keystore.password']
653 }
654 }
655 buildTypes.release.signingConfig = signingConfigs.release
656 }
657
658 lintOptions {
659 disable 'MissingTranslation', 'InvalidPackage','AppCompatResource'
660 }
661
662 subprojects {
663
664 afterEvaluate {
665 if (getPlugins().hasPlugin('android') ||
666 getPlugins().hasPlugin('android-library')) {
667
668 configure(android.lintOptions) {
669 disable 'AndroidGradlePluginVersion', 'MissingTranslation'
670 }
671 }
672
673 }
674 }
675
676 packagingOptions {
677 exclude 'META-INF/BCKEY.DSA'
678 exclude 'META-INF/BCKEY.SF'
679 }
680
681 android.applicationVariants.all { variant ->
682 variant.outputs.each { output ->
683 def baseAbiVersionCode = project.ext.abiCodes.get(output.getFilter(OutputFile.ABI))
684 if (baseAbiVersionCode != null) {
685 output.versionCodeOverride = (100 * variant.versionCode) + baseAbiVersionCode
686 }
687 }
688
689 }
690}
691
ANSWER
Answered 2021-Aug-04 at 09:18I'm not sure what you're using to code, but in order to set it in Android Studio, open the manifest of your project and under the "activity" section, put android:exported="true"(or false if that is what you prefer). I have attached an example.
QUESTION
CameraX is not configured properly. The most likely cause is you did not include a default implementation in your build such as 'camera-camera2
Asked 2022-Feb-17 at 12:57After updating from androidx.camera:camera-view:1.0.0-alpha32
to androidx.camera:camera-view:1.1.0-beta01
I receive the next error when using CameraX
1camerax_version = "1.0.2"
2
3// CameraX
4implementation "androidx.camera:camera-core:$camerax_version"
5implementation "androidx.camera:camera-camera2:$camerax_version"
6implementation "androidx.camera:camera-lifecycle:$camerax_version"
7implementation "androidx.camera:camera-view:1.1.0-beta01"
8
Error
1camerax_version = "1.0.2"
2
3// CameraX
4implementation "androidx.camera:camera-core:$camerax_version"
5implementation "androidx.camera:camera-camera2:$camerax_version"
6implementation "androidx.camera:camera-lifecycle:$camerax_version"
7implementation "androidx.camera:camera-view:1.1.0-beta01"
8java.lang.IllegalStateException: CameraX is not configured properly. The most likely cause is you did not include a default implementation in your build such as 'camera-camera2'.
9 at androidx.camera.core.CameraX.<init>(CameraX.java:109)
10 at androidx.camera.lifecycle.ProcessCameraProvider.getOrCreateCameraXInstance(ProcessCameraProvider.java:181)
11 at androidx.camera.lifecycle.ProcessCameraProvider.getInstance(ProcessCameraProvider.java:167)
12
ANSWER
Answered 2022-Feb-17 at 12:57It fails because you have different versions for the various androidx.camera.* libraries.
If you check this:
https://developer.android.com/jetpack/androidx/releases/camera
It has the following description:
From 1.1.0-beta01, all CameraX libraries will align the same version number. This will help developers track versions much easier and reduce the complexity of large version compatibility matrix.
So you need to use the same version for ALL camerax libraries.
QUESTION
uploaded an APK which has an activity,activity alias,service or broadcast receiver with intentfilter, but without 'android : exported' property set
Asked 2022-Feb-03 at 10:56I'm having an issue when i'm uploading app bundle to the play console that You uploaded an APK or Android App Bundle which has an activity, activity alias, service or broadcast receiver with intent filter, but without 'android:exported' property set. This file can't be installed on Android 12 or higher. but my manifest file includes the property.
Manifest file
1 <?xml version="1.0" encoding="utf-8"?>
2 <manifest xmlns:android="http://schemas.android.com/apk/res/android"
3 package="**********">
4 <!-- io.flutter.app.FlutterApplication is an android.app.Application that
5 calls FlutterMain.startInitialization(this); in its onCreate method.
6 In most cases you can leave this as-is, but you if you want to provide
7 additional functionality it is fine to subclass or reimplement
8 FlutterApplication and put your custom class here. -->
9 <uses-permission android:name="android.permission.INTERNET" />
10 <uses-permission android:name="android.permission.CAMERA" />
11 <uses-feature android:name="android.hardware.camera" />
12 <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
13 <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
14 <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
15 <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
16 <uses-permission android:name="android.permission.ACCESS_BACKGROUND_LOCATION" />
17 <uses-permission android:name="android.permission.WAKE_LOCK"/>
18 <uses-permission android:name="android.permission.FOREGROUND_SERVICE"/>
19 <uses-permission android:name="android.permission.VIBRATE" />
20 <uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED"/>
21 <uses-permission android:name="android.permission.WAKE_LOCK" />
22 <uses-permission android:name="android.permission.ACTIVITY_RECOGNITION" />
23 <uses-permission android:name="com.google.android.gms.permission.ACTIVITY_RECOGNITION" />
24
25
26 <application
27 android:name="io.flutter.app.FlutterApplication"
28 android:label="*****"
29 android:requestLegacyExternalStorage="true"
30 android:usesCleartextTraffic="true"
31 android:icon="@mipmap/ic_launcher">
32
33
34 <meta-data
35 android:name="com.google.firebase.messaging.default_notification_icon"
36 android:resource="@drawable/ic_stat_artboard_1" />
37
38 <meta-data android:name="com.google.android.geo.API_KEY"
39 android:value="Z*********"/>
40
41 <provider
42 android:name="vn.hunghd.flutterdownloader.DownloadedFileProvider"
43 android:authorities="im.mingguang.mingguang_app.flutter_downloader.provider"
44 android:grantUriPermissions="true"
45 android:requestLegacyExternalStorage="true">
46 <meta-data
47 android:name="android.support.FILE_PROVIDER_PATHS"
48 android:resource="@xml/provider_paths"/>
49 </provider>
50
51 <provider
52 android:name="androidx.core.content.FileProvider"
53 android:authorities="${applicationId}.provider"
54 android:grantUriPermissions="true">
55 <meta-data
56 android:name="android.support.FILE_PROVIDER_PATHS"
57 android:resource="@xml/provider_paths"/>
58 </provider>
59 <activity
60 android:name=".MainActivity"
61 android:launchMode="singleTop"
62 android:theme="@style/LaunchTheme"
63 android:configChanges="orientation|keyboardHidden|keyboard|screenSize|smallestScreenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode"
64 android:hardwareAccelerated="true"
65 android:exported="true"
66 android:windowSoftInputMode="adjustResize">
67 <intent-filter>
68 <action android:name="android.intent.action.MAIN"/>
69 <category android:name="android.intent.category.DEFAULT"/>
70 <category android:name="android.intent.category.LAUNCHER"/>
71 </intent-filter>
72 <intent-filter>
73 <action android:name="FLUTTER_NOTIFICATION_CLICK" />
74 <category android:name="android.intent.category.DEFAULT"/>
75 </intent-filter>
76 </activity>
77 <!-- Don't delete the meta-data below.
78 This is used by the Flutter tool to generate GeneratedPluginRegistrant.java -->
79 <meta-data
80 android:name="flutterEmbedding"
81 android:value="2" />
82 </application>
83 </manifest>
84
Play Console Error
ANSWER
Answered 2022-Jan-12 at 23:56I face the same Issue but i solved by writing android:exported="true" in activity bellow the android:name=".MainActivity" image shown
QUESTION
flutter permission Handler grant not showing on iOS
Asked 2022-Feb-02 at 18:56i created a class to ask for permission immediately it get to login, it show on Android but on iOs i am not seeing any permission grant.
1class PermissionService {
2 Future permissionHandler() async {
3 await Permission.contacts.shouldShowRequestRationale;
4 if (await Permission.contacts.request().isGranted) {
5 // Either the permission was already granted before or the user just granted it.
6 }
7 Map<Permission, PermissionStatus> statuses = await [
8 Permission.locationWhenInUse,
9 Permission.locationAlways,
10 Permission.photos,
11 Permission.camera,
12 Permission.location,
13 Permission.microphone,
14 Permission.notification,
15 ].request();
16
17 if (statuses[Permission.location].isDenied) {
18 print("Location permission is denied.");
19 }
20
21 if (statuses[Permission.camera].isDenied) {
22 print("Camera permission is denied.");
23 }
24 if (statuses[Permission.photos].isDenied) {
25 print("Photos permission is denied.");
26 }
27 if (statuses[Permission.notification].isDenied) {
28 print("Notification permission is denied.");
29 }
30 if (statuses[Permission.microphone].isDenied) {
31 print("Microphone permission is denied.");
32 }
33 if (statuses[Permission.locationWhenInUse].isDenied) {
34 print("locationWhenInUse permission is denied.");
35 }
36 if (statuses[Permission.locationAlways].isDenied) {
37 print("locationAlways permission is denied.");
38 }
39 }
40}
41
and i call this function in the initstate of the Login.dart
ANSWER
Answered 2022-Feb-02 at 18:56The permission_handler package introduced a breaking change in version 8.0.0
, see changelog. Permissions on iOS are disabled by default, and you have the set the correct GCC_PREPROCESSOR_DEFINITIONS
in you Podfile. An example Podfile can be found here, but basically you have to add this to you Podfile, set the permissions that you don't use to 0
:
1class PermissionService {
2 Future permissionHandler() async {
3 await Permission.contacts.shouldShowRequestRationale;
4 if (await Permission.contacts.request().isGranted) {
5 // Either the permission was already granted before or the user just granted it.
6 }
7 Map<Permission, PermissionStatus> statuses = await [
8 Permission.locationWhenInUse,
9 Permission.locationAlways,
10 Permission.photos,
11 Permission.camera,
12 Permission.location,
13 Permission.microphone,
14 Permission.notification,
15 ].request();
16
17 if (statuses[Permission.location].isDenied) {
18 print("Location permission is denied.");
19 }
20
21 if (statuses[Permission.camera].isDenied) {
22 print("Camera permission is denied.");
23 }
24 if (statuses[Permission.photos].isDenied) {
25 print("Photos permission is denied.");
26 }
27 if (statuses[Permission.notification].isDenied) {
28 print("Notification permission is denied.");
29 }
30 if (statuses[Permission.microphone].isDenied) {
31 print("Microphone permission is denied.");
32 }
33 if (statuses[Permission.locationWhenInUse].isDenied) {
34 print("locationWhenInUse permission is denied.");
35 }
36 if (statuses[Permission.locationAlways].isDenied) {
37 print("locationAlways permission is denied.");
38 }
39 }
40}
41post_install do |installer|
42 installer.pods_project.targets.each do |target|
43 flutter_additional_ios_build_settings(target)
44 target.build_configurations.each do |config|
45 # You can remove unused permissions here
46 # for more infomation: https://github.com/BaseflowIT/flutter-permission-handler/blob/master/permission_handler/ios/Classes/PermissionHandlerEnums.h
47 # e.g. when you don't need camera permission, just add 'PERMISSION_CAMERA=0'
48 config.build_settings['GCC_PREPROCESSOR_DEFINITIONS'] ||= [
49 '$(inherited)',
50 ## dart: PermissionGroup.calendar
51 'PERMISSION_EVENTS=1',
52 ## dart: PermissionGroup.reminders
53 'PERMISSION_REMINDERS=1',
54 ## dart: PermissionGroup.contacts
55 'PERMISSION_CONTACTS=1',
56 ## dart: PermissionGroup.camera
57 'PERMISSION_CAMERA=1',
58 ## dart: PermissionGroup.microphone
59 'PERMISSION_MICROPHONE=1',
60 ## dart: PermissionGroup.speech
61 'PERMISSION_SPEECH_RECOGNIZER=1',
62 ## dart: PermissionGroup.photos
63 'PERMISSION_PHOTOS=1',
64 ## dart: [PermissionGroup.location, PermissionGroup.locationAlways, PermissionGroup.locationWhenInUse]
65 'PERMISSION_LOCATION=1',
66 ## dart: PermissionGroup.notification
67 'PERMISSION_NOTIFICATIONS=1',
68 ## dart: PermissionGroup.mediaLibrary
69 'PERMISSION_MEDIA_LIBRARY=1',
70 ## dart: PermissionGroup.sensors
71 'PERMISSION_SENSORS=1',
72 ## dart: PermissionGroup.bluetooth
73 'PERMISSION_BLUETOOTH=1',
74 ## dart: PermissionGroup.appTrackingTransparency
75 'PERMISSION_APP_TRACKING_TRANSPARENCY=1',
76 ## dart: PermissionGroup.criticalAlerts
77 'PERMISSION_CRITICAL_ALERTS=1',
78 ]
79 end
80 end
81end
82
Edit 1: Once that is done, save your Podfile and then stop the current instance of the project since hot restart will not reflect the changes. Rebuild the project and permission_handler
requests should now be working perfectly.
Edit 2: As suggested by @YugankaSharan it might be necessary to run pod install
for the changes to take effect.
QUESTION
Execution failed for task ':camera:compileDebugJavaWithJavac'
Asked 2022-Jan-29 at 09:35I have created a new flutter project and added camera
plugin. after adding that dependency I got many errors. I used futter version is 2.5.2
& minSdkVersion 21
In pubspec.yaml
file,
1environment:
2 sdk: ">=2.12.0 <3.0.0"
3
4dependencies:
5 flutter:
6 sdk: flutter
7
8 cupertino_icons: ^1.0.4
9 camera: ^0.9.4+4
10
11
Errors as follows,
1environment:
2 sdk: ">=2.12.0 <3.0.0"
3
4dependencies:
5 flutter:
6 sdk: flutter
7
8 cupertino_icons: ^1.0.4
9 camera: ^0.9.4+4
10
11C:\Users\Lakshan\Documents\SDKs\flutter\.pub-cache\hosted\pub.dartlang.org\camera-0.9.4+4\android\src\main\java\io\flutter\plugins\camera\Camera.java:23: error: cannot find symbol
12import android.media.EncoderProfiles;
13 ^
14 symbol: class EncoderProfiles
15 location: package android.media
16C:\Users\Lakshan\Documents\SDKs\flutter\.pub-cache\hosted\pub.dartlang.org\camera-0.9.4+4\android\src\main\java\io\flutter\plugins\camera\Camera.java:935: error: cannot find symbol
17 EncoderProfiles getRecordingProfile() {
18 ^
19 symbol: class EncoderProfiles
20 location: class Camera
21C:\Users\Lakshan\Documents\SDKs\flutter\.pub-cache\hosted\pub.dartlang.org\camera-0.9.4+4\android\src\main\java\io\flutter\plugins\camera\features\resolution\ResolutionFeature.java:10: error: cannot find symbol
22import android.media.EncoderProfiles;
23 ^
24 symbol: class EncoderProfiles
25 location: package android.media
26C:\Users\Lakshan\Documents\SDKs\flutter\.pub-cache\hosted\pub.dartlang.org\camera-0.9.4+4\android\src\main\java\io\flutter\plugins\camera\features\resolution\ResolutionFeature.java:29: error: cannot find symbol
27 private EncoderProfiles recordingProfile;
28 ^
29 symbol: class EncoderProfiles
30 location: class ResolutionFeature
31C:\Users\Lakshan\Documents\SDKs\flutter\.pub-cache\hosted\pub.dartlang.org\camera-0.9.4+4\android\src\main\java\io\flutter\plugins\camera\features\resolution\ResolutionFeature.java:63: error: cannot find symbol
32 public EncoderProfiles getRecordingProfile() {
33 ^
34 symbol: class EncoderProfiles
35 location: class ResolutionFeature
36C:\Users\Lakshan\Documents\SDKs\flutter\.pub-cache\hosted\pub.dartlang.org\camera-0.9.4+4\android\src\main\java\io\flutter\plugins\camera\features\resolution\ResolutionFeature.java:187: error: cannot find symbol
37 public static EncoderProfiles getBestAvailableCamcorderProfileForResolutionPreset(
38 ^
39 symbol: class EncoderProfiles
40 location: class ResolutionFeature
41C:\Users\Lakshan\Documents\SDKs\flutter\.pub-cache\hosted\pub.dartlang.org\camera-0.9.4+4\android\src\main\java\io\flutter\plugins\camera\media\MediaRecorderBuilder.java:8: error: cannot find symbol
42import android.media.EncoderProfiles;
43 ^
44 symbol: class EncoderProfiles
45 location: package android.media
46C:\Users\Lakshan\Documents\SDKs\flutter\.pub-cache\hosted\pub.dartlang.org\camera-0.9.4+4\android\src\main\java\io\flutter\plugins\camera\media\MediaRecorderBuilder.java:24: error: cannot find symbol
47 private final EncoderProfiles encoderProfiles;
48 ^
49 symbol: class EncoderProfiles
50 location: class MediaRecorderBuilder
51C:\Users\Lakshan\Documents\SDKs\flutter\.pub-cache\hosted\pub.dartlang.org\camera-0.9.4+4\android\src\main\java\io\flutter\plugins\camera\media\MediaRecorderBuilder.java:36: error: cannot find symbol
52 @NonNull EncoderProfiles encoderProfiles, @NonNull String outputFilePath) {
53 ^
54 symbol: class EncoderProfiles
55 location: class MediaRecorderBuilder
56C:\Users\Lakshan\Documents\SDKs\flutter\.pub-cache\hosted\pub.dartlang.org\camera-0.9.4+4\android\src\main\java\io\flutter\plugins\camera\media\MediaRecorderBuilder.java:51: error: cannot find symbol
57 @NonNull EncoderProfiles encoderProfiles,
58 ^
59 symbol: class EncoderProfiles
60 location: class MediaRecorderBuilder
61C:\Users\Lakshan\Documents\SDKs\flutter\.pub-cache\hosted\pub.dartlang.org\camera-0.9.4+4\android\src\main\java\io\flutter\plugins\camera\features\resolution\ResolutionFeature.java:186: error: cannot find symbol
62 @TargetApi(Build.VERSION_CODES.S)
63 ^
64 symbol: variable S
65 location: class VERSION_CODES
66C:\Users\Lakshan\Documents\SDKs\flutter\.pub-cache\hosted\pub.dartlang.org\camera-0.9.4+4\android\src\main\java\io\flutter\plugins\camera\Camera.java:208: error: reference to MediaRecorderBuilder is ambiguous
67 mediaRecorderBuilder = new MediaRecorderBuilder(getRecordingProfileLegacy(), outputFilePath);
68 ^
69 both constructor MediaRecorderBuilder(CamcorderProfile,String) in MediaRecorderBuilder and constructor MediaRecorderBuilder(EncoderProfiles,String) in MediaRecorderBuilder match
70C:\Users\Lakshan\Documents\SDKs\flutter\.pub-cache\hosted\pub.dartlang.org\camera-0.9.4+4\android\src\main\java\io\flutter\plugins\camera\features\resolution\ResolutionFeature.java:118: error: cannot find symbol
71 EncoderProfiles profile =
72 ^
73 symbol: class EncoderProfiles
74 location: class ResolutionFeature
75C:\Users\Lakshan\Documents\SDKs\flutter\.pub-cache\hosted\pub.dartlang.org\camera-0.9.4+4\android\src\main\java\io\flutter\plugins\camera\features\resolution\ResolutionFeature.java:120: error: package EncoderProfiles does not exist
76 List<EncoderProfiles.VideoProfile> videoProfiles = profile.getVideoProfiles();
77 ^
78C:\Users\Lakshan\Documents\SDKs\flutter\.pub-cache\hosted\pub.dartlang.org\camera-0.9.4+4\android\src\main\java\io\flutter\plugins\camera\features\resolution\ResolutionFeature.java:121: error: package EncoderProfiles does not exist
79 EncoderProfiles.VideoProfile defaultVideoProfile = videoProfiles.get(0);
80 ^
81C:\Users\Lakshan\Documents\SDKs\flutter\.pub-cache\hosted\pub.dartlang.org\camera-0.9.4+4\android\src\main\java\io\flutter\plugins\camera\features\resolution\ResolutionFeature.java:200: error: cannot find symbol
82 return CamcorderProfile.getAll(cameraIdString, CamcorderProfile.QUALITY_HIGH);
83 ^
84 symbol: method getAll(String,int)
85 location: class CamcorderProfile
86C:\Users\Lakshan\Documents\SDKs\flutter\.pub-cache\hosted\pub.dartlang.org\camera-0.9.4+4\android\src\main\java\io\flutter\plugins\camera\features\resolution\ResolutionFeature.java:204: error: cannot find symbol
87 return CamcorderProfile.getAll(cameraIdString, CamcorderProfile.QUALITY_2160P);
88 ^
89 symbol: method getAll(String,int)
90 location: class CamcorderProfile
91C:\Users\Lakshan\Documents\SDKs\flutter\.pub-cache\hosted\pub.dartlang.org\camera-0.9.4+4\android\src\main\java\io\flutter\plugins\camera\features\resolution\ResolutionFeature.java:208: error: cannot find symbol
92 return CamcorderProfile.getAll(cameraIdString, CamcorderProfile.QUALITY_1080P);
93 ^
94 symbol: method getAll(String,int)
95 location: class CamcorderProfile
96C:\Users\Lakshan\Documents\SDKs\flutter\.pub-cache\hosted\pub.dartlang.org\camera-0.9.4+4\android\src\main\java\io\flutter\plugins\camera\features\resolution\ResolutionFeature.java:212: error: cannot find symbol
97 return CamcorderProfile.getAll(cameraIdString, CamcorderProfile.QUALITY_720P);
98 ^
99 symbol: method getAll(String,int)
100 location: class CamcorderProfile
101C:\Users\Lakshan\Documents\SDKs\flutter\.pub-cache\hosted\pub.dartlang.org\camera-0.9.4+4\android\src\main\java\io\flutter\plugins\camera\features\resolution\ResolutionFeature.java:216: error: cannot find symbol
102 return CamcorderProfile.getAll(cameraIdString, CamcorderProfile.QUALITY_480P);
103 ^
104 symbol: method getAll(String,int)
105 location: class CamcorderProfile
106C:\Users\Lakshan\Documents\SDKs\flutter\.pub-cache\hosted\pub.dartlang.org\camera-0.9.4+4\android\src\main\java\io\flutter\plugins\camera\features\resolution\ResolutionFeature.java:220: error: cannot find symbol
107 return CamcorderProfile.getAll(cameraIdString, CamcorderProfile.QUALITY_QVGA);
108 ^
109 symbol: method getAll(String,int)
110 location: class CamcorderProfile
111C:\Users\Lakshan\Documents\SDKs\flutter\.pub-cache\hosted\pub.dartlang.org\camera-0.9.4+4\android\src\main\java\io\flutter\plugins\camera\features\resolution\ResolutionFeature.java:224: error: cannot find symbol
112 return CamcorderProfile.getAll(cameraIdString, CamcorderProfile.QUALITY_LOW);
113 ^
114 symbol: method getAll(String,int)
115 location: class CamcorderProfile
116C:\Users\Lakshan\Documents\SDKs\flutter\.pub-cache\hosted\pub.dartlang.org\camera-0.9.4+4\android\src\main\java\io\flutter\plugins\camera\features\resolution\ResolutionFeature.java:241: error: package EncoderProfiles does not exist
117 List<EncoderProfiles.VideoProfile> videoProfiles = recordingProfile.getVideoProfiles();
118 ^
119C:\Users\Lakshan\Documents\SDKs\flutter\.pub-cache\hosted\pub.dartlang.org\camera-0.9.4+4\android\src\main\java\io\flutter\plugins\camera\features\resolution\ResolutionFeature.java:243: error: package EncoderProfiles does not exist
120 EncoderProfiles.VideoProfile defaultVideoProfile = videoProfiles.get(0);
121 ^
122C:\Users\Lakshan\Documents\SDKs\flutter\.pub-cache\hosted\pub.dartlang.org\camera-0.9.4+4\android\src\main\java\io\flutter\plugins\camera\media\MediaRecorderBuilder.java:32: error: reference to MediaRecorderBuilder is ambiguous
123 this(camcorderProfile, outputFilePath, new MediaRecorderFactory());
124 ^
125 both constructor MediaRecorderBuilder(CamcorderProfile,String,MediaRecorderFactory) in MediaRecorderBuilder and constructor MediaRecorderBuilder(EncoderProfiles,String,MediaRecorderFactory) in MediaRecorderBuilder match
126C:\Users\Lakshan\Documents\SDKs\flutter\.pub-cache\hosted\pub.dartlang.org\camera-0.9.4+4\android\src\main\java\io\flutter\plugins\camera\media\MediaRecorderBuilder.java:79: error: package EncoderProfiles does not exist
127 EncoderProfiles.VideoProfile videoProfile = encoderProfiles.getVideoProfiles().get(0);
128 ^
129C:\Users\Lakshan\Documents\SDKs\flutter\.pub-cache\hosted\pub.dartlang.org\camera-0.9.4+4\android\src\main\java\io\flutter\plugins\camera\media\MediaRecorderBuilder.java:80: error: package EncoderProfiles does not exist
130 EncoderProfiles.AudioProfile audioProfile = encoderProfiles.getAudioProfiles().get(0);
131 ^
13227 errors
133
134FAILURE: Build failed with an exception.
135
136* What went wrong:
137Execution failed for task ':camera:compileDebugJavaWithJavac'.
138> Compilation failed; see the compiler error output for details.
139
140* Try:
141Run 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.
142
143* Get more help at https://help.gradle.org
144
145BUILD FAILED in 16s
146Exception: Gradle task assembleDebug failed with exit code 1
147
I tried clearing cache, but this issue occurs as same.
ANSWER
Answered 2021-Nov-17 at 07:00How about this?
flutter pub cache repair
QUESTION
Expo SDK 44 upgrade ERROR - App.js: [BABEL]: Unexpected token '.'
Asked 2022-Jan-24 at 21:48I have recently upgraded my app from SDK 40 to SDK 44 and came across this error App.js: [BABEL]: Unexpected token '.' (While processing: /Users/user/path/to/project/node_modules/babel-preset-expo/index.js)
Error Stack Trace:
1App.js: [BABEL]: Unexpected token '.' (While processing: /Users/user/path/to/project/node_modules/babel-preset-expo/index.js)
2/Users/user/path/to/project/node_modules/babel-preset-expo/index.js:48
3 ...(options?.jsxRuntime !== 'classic' && {
4 ^
5
6SyntaxError: Unexpected token '.'
7 at wrapSafe (internal/modules/cjs/loader.js:931:16)
8 at Module._compile (internal/modules/cjs/loader.js:979:27)
9 at Object.Module._extensions..js (internal/modules/cjs/loader.js:1035:10)
10 at Module.load (internal/modules/cjs/loader.js:879:32)
11 at Function.Module._load (internal/modules/cjs/loader.js:724:14)
12 at Module.require (internal/modules/cjs/loader.js:903:19)
13 at require (internal/modules/cjs/helpers.js:74:18)
14 at loadCjsDefault (/Users/user/path/to/project/node_modules/@babel/core/lib/config/files/module-types.js:85:18)
15 at loadCjsOrMjsDefault (/Users/user/path/to/project/node_modules/@babel/core/lib/config/files/module-types.js:57:16)
16
Here is my babel.config.js:
1App.js: [BABEL]: Unexpected token '.' (While processing: /Users/user/path/to/project/node_modules/babel-preset-expo/index.js)
2/Users/user/path/to/project/node_modules/babel-preset-expo/index.js:48
3 ...(options?.jsxRuntime !== 'classic' && {
4 ^
5
6SyntaxError: Unexpected token '.'
7 at wrapSafe (internal/modules/cjs/loader.js:931:16)
8 at Module._compile (internal/modules/cjs/loader.js:979:27)
9 at Object.Module._extensions..js (internal/modules/cjs/loader.js:1035:10)
10 at Module.load (internal/modules/cjs/loader.js:879:32)
11 at Function.Module._load (internal/modules/cjs/loader.js:724:14)
12 at Module.require (internal/modules/cjs/loader.js:903:19)
13 at require (internal/modules/cjs/helpers.js:74:18)
14 at loadCjsDefault (/Users/user/path/to/project/node_modules/@babel/core/lib/config/files/module-types.js:85:18)
15 at loadCjsOrMjsDefault (/Users/user/path/to/project/node_modules/@babel/core/lib/config/files/module-types.js:57:16)
16return {
17 presets: ['babel-preset-expo', { jsxRuntime: 'automatic' }],
18 plugins: [
19 ['inline-dotenv'],
20 ['.....']
21 ]
22}
23
Here is my package.json:
1App.js: [BABEL]: Unexpected token '.' (While processing: /Users/user/path/to/project/node_modules/babel-preset-expo/index.js)
2/Users/user/path/to/project/node_modules/babel-preset-expo/index.js:48
3 ...(options?.jsxRuntime !== 'classic' && {
4 ^
5
6SyntaxError: Unexpected token '.'
7 at wrapSafe (internal/modules/cjs/loader.js:931:16)
8 at Module._compile (internal/modules/cjs/loader.js:979:27)
9 at Object.Module._extensions..js (internal/modules/cjs/loader.js:1035:10)
10 at Module.load (internal/modules/cjs/loader.js:879:32)
11 at Function.Module._load (internal/modules/cjs/loader.js:724:14)
12 at Module.require (internal/modules/cjs/loader.js:903:19)
13 at require (internal/modules/cjs/helpers.js:74:18)
14 at loadCjsDefault (/Users/user/path/to/project/node_modules/@babel/core/lib/config/files/module-types.js:85:18)
15 at loadCjsOrMjsDefault (/Users/user/path/to/project/node_modules/@babel/core/lib/config/files/module-types.js:57:16)
16return {
17 presets: ['babel-preset-expo', { jsxRuntime: 'automatic' }],
18 plugins: [
19 ['inline-dotenv'],
20 ['.....']
21 ]
22}
23{
24 "main": "node_modules/expo/AppEntry.js",
25 "scripts": {
26 "start": "expo start",
27 "android": "expo start --android",
28 "ios": "expo start --ios",
29 "web": "expo start --web",
30 "eject": "expo eject",
31 "test": "jest"
32 },
33 "jest": {
34 "preset": "jest-expo"
35 },
36 "dependencies": {
37 "@babel/plugin-transform-react-jsx": "^7.16.5",
38 "@react-native-async-storage/async-storage": "~1.15.0",
39 "@react-native-community/art": "^1.2.0",
40 "@react-native-community/datetimepicker": "4.0.0",
41 "@react-native-community/masked-view": "0.1.10",
42 "@react-native-community/netinfo": "7.1.3",
43 "@react-native-community/push-notification-ios": "^1.2.2",
44 "@react-native-community/slider": "4.1.12",
45 "@react-navigation/native": "^5.1.4",
46 "aws-amplify": "^3.3.1",
47 "aws-amplify-react-native": "^4.2.6",
48 "axios": "^0.19.2",
49 "expo": "^44.0.0",
50 "expo-app-loading": "~1.3.0",
51 "expo-barcode-scanner": "~11.2.0",
52 "expo-camera": "~12.1.0",
53 "expo-constants": "~13.0.0",
54 "expo-font": "~10.0.4",
55 "expo-linking": "~3.0.0",
56 "expo-mail-composer": "~11.1.0",
57 "expo-notifications": "~0.14.0",
58 "expo-permissions": "~13.1.0",
59 "expo-secure-store": "~11.1.0",
60 "expo-sqlite": "~10.1.0",
61 "expo-updates": "~0.11.2",
62 "expo-web-browser": "~10.1.0",
63 "file-saver": "^2.0.2",
64 "jsbarcode": "^3.11.3",
65 "link": "^0.1.5",
66 "metro-config": "^0.64.0",
67 "npm": "^8.3.0",
68 "qs": "^6.9.4",
69 "react": "17.0.1",
70 "react-dom": "17.0.1",
71 "react-native": "https://github.com/expo/react-native/archive/sdk-44.0.0.tar.gz",
72 "react-native-barcode-expo": "^1.1.1",
73 "react-native-elements": "^3.2.0",
74 "react-native-fs": "^2.16.6",
75 "react-native-gesture-handler": "~2.1.0",
76 "react-native-modal": "^11.5.6",
77 "react-native-modal-datetime-picker": "^8.6.0",
78 "react-native-paper": "^3.10.1",
79 "react-native-push-notification": "^3.5.2",
80 "react-native-reanimated": "~2.3.1",
81 "react-native-router-flux": "^4.2.0",
82 "react-native-safe-area-context": "3.3.2",
83 "react-native-screens": "~3.10.1",
84 "react-native-snap-carousel": "^3.9.1",
85 "react-native-svg": "12.1.1",
86 "react-native-web": "0.17.1",
87 "react-navigation-animated-switch": "^0.6.4",
88 "react-navigation-drawer": "^2.4.11",
89 "react-navigation-header-buttons": "^3.0.5",
90 "react-router-dom": "^6.0.0-alpha.3",
91 "yarn": "^1.22.17"
92 },
93 "devDependencies": {
94 "@babel/core": "^7.12.9",
95 "@babel/runtime": "^7.9.2",
96 "@react-native-community/eslint-config": "^0.0.7",
97 "babel-jest": "^25.1.0",
98 "babel-plugin-inline-dotenv": "^1.6.0",
99 "babel-preset-expo": "9.0.1",
100 "eslint": "^6.8.0",
101 "expo-cli": "^5.0.2",
102 "jest": "^26.6.3",
103 "jest-expo": "^44.0.0",
104 "metro-react-native-babel-preset": "^0.66.2",
105 "react-test-renderer": "^16.13.1"
106 },
107 "private": true
108}
109
Any help will be greatly appreciated.
ANSWER
Answered 2021-Dec-21 at 05:52can you give your
- package.json
- node version
I think that's because of the babel issue / your node version, because it cannot transpile the optional chaining https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Optional_chaining
maybe tried using latest LTS node version? because as far as I know, the latest LTS node version already support optional chaining
Community Discussions contain sources that include Stack Exchange Network
Tutorials and Learning Resources in Camera
Tutorials and Learning Resources are not available at this moment for Camera