Audio-Recording-Animation | WhatsApp like audio recording animations and views sample | Build Tool library
kandi X-RAY | Audio-Recording-Animation Summary
Support
Quality
Security
License
Reuse
- Initializes the listener
- Initialize view
- Stops recording
- Sets up recording
- Invoked when the view is clicked
- Gets the id
- Show the audio dialog
- Display an attachment
- Gets the id
- Show the audio dialog
- Handles recording started
- Shows a toast with the given message
- Log a debug message
- Called when recorder is canceled
- Returns the count of items
- Helper method to show the attachment attachment view
- Set the stop button image resource
- Sets the image for the send button image
- Sets the image image of the audio record button image
- Change text from TextView to cancel the TextView
- Set whether or not to show or not
- Called when recording is locked
- Returns the view holder for the list view
- Gets the AudioTime representation of a long
- Whether emoji should be shown or not
- Sets whether the icon should be shown or not
- Handle recording completed
- Binds a messageViewHolder to a messageViewHolder
Audio-Recording-Animation Key Features
Audio-Recording-Animation Examples and Code Snippets
Trending Discussions on Build Tool
Trending Discussions on Build Tool
QUESTION
I need help solving this cmake boost python3 find problem when trying to compile cv_bridge from ros2, which uses a build tool called colcon and in turn CMake. The colcon build error message:
> colcon build --symlink-install --merge-install
...
--- stderr: cv_bridge
CMake Error at C:/Program Files/CMake/share/cmake-3.22/Modules/FindPackageHandleStandardArgs.cmake:230 (message):
Could NOT find Boost (missing: python3) (found version "1.76.0")
Call Stack (most recent call first):
C:/Program Files/CMake/share/cmake-3.22/Modules/FindPackageHandleStandardArgs.cmake:594 (_FPHSA_FAILURE_MESSAGE)
C:/Program Files/CMake/share/cmake-3.22/Modules/FindBoost.cmake:2360 (find_package_handle_standard_args)
CMakeLists.txt:32 (find_package)
What I have tried:
- Installing different versions of boost: 1.58, 1.67, 1.76
- Adding to Boost_INCLUDE_DIRS the path to the boost libraries in the CMakeLists.txt of cv_bridge:
if(NOT ANDROID)
find_package(PythonLibs)
list(APPEND Boost_INCLUDE_DIRS "C:/Program Files/boost/boost_1_76_0")
list(APPEND Boost_INCLUDE_DIRS "C:/Program Files/boost/boost_1_76_0/stage/lib")
- Renaming the
libboost_python38-vc142-mt-gd-x64-1_76.lib
tolibboost_python38.lib
andlibboost_python3.lib
- Compiling Boost from source with bootstrap.bat and b2 or installing with the zip file.
- Looked for answers here and elsewhere, which led me to tried things above
I have run out of ideas, please any help will be greatly appreciated!
ANSWER
Answered 2021-Dec-08 at 13:20I was able to solve it (after a few days of suffering) using precompiled Boost 1.74 and by changing the boost/python related parts of cv_bridge/CMakeLists.txt to:
...
set(BOOST_ROOT )
find_package (Python3 REQUIRED COMPONENTS Interpreter Development)
if(NOT ANDROID)
find_package(Boost QUIET)
if(Boost_VERSION LESS 106500)
find_package(Boost REQUIRED python)
else()
# This is a bit of a hack to suppress a warning
# No header defined for python3; skipping header check
# Which should only affect Boost versions < 1.67
# Resolution for newer versions:
# https://gitlab.kitware.com/cmake/cmake/issues/16391
if (Boost_VERSION LESS 106700)
set(_Boost_PYTHON3_HEADERS "boost/python.hpp")
endif()
find_package(Boost COMPONENTS python${Python3_VERSION_MAJOR}.${Python3_VERSION_MINOR} REQUIRED)
endif()
else()
find_package(Boost REQUIRED)
endif()
find_package(sensor_msgs REQUIRED)
...
Do not forget to remove build and install folders before triggering colcon build again.
QUESTION
When enabling hermes in the Podfile and rebuilding the build it fails due to RCT-Folly. No idea what it does.
To re-initialise everything I use the following:
rm -rf node_modules && rm package-lock.json && npm install && cd ios && rm -rf Pods && rm Podfile.lock && pod deintegrate && pod setup && pod install && cd ..
I also start the metro bundler with:
npx react-native --reset-cache
Anyone has a solution?
The app uses react-native v0.64 and we want to have a better performance using hermes.
All information:
ios/Podfile
require_relative '../node_modules/react-native/scripts/react_native_pods'
require_relative '../node_modules/@react-native-community/cli-platform-ios/native_modules'
platform :ios, '10.0'
target 'unblnd' do
config = use_native_modules!
use_react_native!(
:path => config[:reactNativePath],
:hermes_enabled => true
)
permissions_path = '../node_modules/react-native-permissions/ios'
pod 'Permission-BluetoothPeripheral', :path => "#{permissions_path}/BluetoothPeripheral"
pod 'Permission-Calendars', :path => "#{permissions_path}/Calendars"
pod 'Permission-Camera', :path => "#{permissions_path}/Camera"
pod 'Permission-Contacts', :path => "#{permissions_path}/Contacts"
pod 'Permission-FaceID', :path => "#{permissions_path}/FaceID"
pod 'Permission-LocationAlways', :path => "#{permissions_path}/LocationAlways"
pod 'Permission-LocationWhenInUse', :path => "#{permissions_path}/LocationWhenInUse"
pod 'Permission-MediaLibrary', :path => "#{permissions_path}/MediaLibrary"
pod 'Permission-Microphone', :path => "#{permissions_path}/Microphone"
pod 'Permission-Motion', :path => "#{permissions_path}/Motion"
pod 'Permission-Notifications', :path => "#{permissions_path}/Notifications"
pod 'Permission-PhotoLibrary', :path => "#{permissions_path}/PhotoLibrary"
pod 'Permission-Reminders', :path => "#{permissions_path}/Reminders"
pod 'Permission-Siri', :path => "#{permissions_path}/Siri"
pod 'Permission-SpeechRecognition', :path => "#{permissions_path}/SpeechRecognition"
pod 'Permission-StoreKit', :path => "#{permissions_path}/StoreKit"
pod 'Yoga', :path => '../node_modules/react-native/ReactCommon/yoga', :modular_headers => true
# add the Firebase pod for Google Analytics
pod 'Firebase/Analytics'
# add pods for any other desired Firebase products
# https://firebase.google.com/docs/ios/setup#available-pods
target 'unblndTests' do
inherit! :complete
# Pods for testing
end
# Enables Flipper.
#
# Note that if you have use_frameworks! enabled, Flipper will not work and
# you should disable these next few lines.
# flipper_pods()
# post_install do |installer|
# flipper_post_install(installer)
# end
end
Terminal Output
In file included from /Users/adriaandebolle/htdocs/unblnd_app/ios/Pods/RCT-Folly/folly/synchronization/DistributedMutex.cpp:17: In file included from /Users/adriaandebolle/htdocs/unblnd_app/ios/Pods/Headers/Private/RCT-Folly/folly/synchronization/DistributedMutex.h:352: /Users/adriaandebolle/htdocs/unblnd_app/ios/Pods/Headers/Private/RCT-Folly/folly/synchronization/DistributedMutex-inl.h:1051:5: error: 'atomic_notify_one' is unavailable
atomic_notify_one(state);
^ /Users/adriaandebolle/htdocs/unblnd_app/ios/Pods/Headers/Private/RCT-Folly/folly/synchronization/DistributedMutex-inl.h:1573:5: note: in instantiation of function template specialization 'folly::detail::distributed_mutex::wakeTimedWaiters>' requested here
wakeTimedWaiters(&state_, proxy.timedWaiters_);
^ In file included from /Users/adriaandebolle/htdocs/unblnd_app/ios/Pods/RCT-Folly/folly/synchronization/DistributedMutex.cpp:17: In file included from /Users/adriaandebolle/htdocs/unblnd_app/ios/Pods/Headers/Private/RCT-Folly/folly/synchronization/DistributedMutex.h:19: In file included from /Users/adriaandebolle/htdocs/unblnd_app/ios/Pods/Headers/Private/RCT-Folly/folly/Optional.h:58: In file included from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.5.sdk/usr/include/c++/v1/functional:504: In file included from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.5.sdk/usr/include/c++/v1/memory:681: /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.5.sdk/usr/include/c++/v1/atomic:2140:6: note: 'atomic_notify_one' has been explicitly marked unavailable here void atomic_notify_one(atomic<_Tp>* __o) _NOEXCEPT
^ 1 error generated.
CompileC /Users/adriaandebolle/Library/Developer/Xcode/DerivedData/unblnd-cvaavakypguqqzftojmgjqbtdeij/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/RCT-Folly.build/Objects-normal/x86_64/Demangle-3c4c6b43c285d16c32230d6f0a7a76ce5af39228ed5c3beeaf7ed7d1344f76b0.o /Users/adriaandebolle/htdocs/unblnd_app/ios/Pods/RCT-Folly/folly/detail/Demangle.cpp normal x86_64 c++ com.apple.compilers.llvm.clang.1_0.compiler (in target 'RCT-Folly' from project 'Pods')
...
CompileC /Users/adriaandebolle/Library/Developer/Xcode/DerivedData/unblnd-cvaavakypguqqzftojmgjqbtdeij/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/RCT-Folly.build/Objects-normal/x86_64/Cursor.o /Users/adriaandebolle/htdocs/unblnd_app/ios/Pods/RCT-Folly/folly/io/Cursor.cpp normal x86_64 c++ com.apple.compilers.llvm.clang.1_0.compiler (in target 'RCT-Folly' from project 'Pods')
cd /Users/adriaandebolle/htdocs/unblnd_app/ios/Pods
export LANG\=en_US.US-ASCII
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/
...
** BUILD FAILED **
The following build commands failed: CompileC /Users/adriaandebolle/Library/Developer/Xcode/DerivedData/unblnd-cvaavakypguqqzftojmgjqbtdeij/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/RCT-Folly.build/Objects-normal/x86_64/DistributedMutex.o /Users/adriaandebolle/htdocs/unblnd_app/ios/Pods/RCT-Folly/folly/synchronization/DistributedMutex.cpp normal x86_64 c++ com.apple.compilers.llvm.clang.1_0.compiler (1 failure)
npx react-native info
System:
OS: macOS 11.4
CPU: (8) x64 Intel(R) Core(TM) i7-1068NG7 CPU @ 2.30GHz
Memory: 1.05 GB / 16.00 GB
Shell: 5.8 - /bin/zsh
Binaries:
Node: 14.17.0 - /usr/local/bin/node
Yarn: Not Found
npm: 6.14.13 - ~/htdocs/unblnd_app/node_modules/.bin/npm
Watchman: 4.9.0 - /usr/local/bin/watchman
Managers:
CocoaPods: 1.10.1 - /usr/local/bin/pod
SDKs:
iOS SDK:
Platforms: iOS 14.5, DriverKit 20.4, macOS 11.3, tvOS 14.5, watchOS 7.4
Android SDK:
API Levels: 28, 29
Build Tools: 28.0.3, 29.0.2, 29.0.3, 30.0.2
System Images: android-29 | Intel x86 Atom_64, android-29 | Google APIs Intel x86 Atom
Android NDK: Not Found
IDEs:
Android Studio: 4.2 AI-202.7660.26.42.7351085
Xcode: 12.5.1/12E507 - /usr/bin/xcodebuild
Languages:
Java: 1.8.0_265 - /usr/bin/javac
npmPackages:
@react-native-community/cli: Not Found
react: 17.0.1 => 17.0.1
react-native: 0.64.2 => 0.64.2
react-native-macos: Not Found
npmGlobalPackages:
*react-native*: Not Found
ANSWER
Answered 2021-Jul-23 at 16:11After lots of trial and error I found a working solution. It's a bit strange, but I had to enable Flipper. I did not find a way without it.
Thanks to this answer: https://github.com/facebook/react-native/issues/31179#issuecomment-831932941 I found out about fixing Pods.
This is my Podfile now:
...
# Enables Flipper.
#
# Note that if you have use_frameworks! enabled, Flipper will not work and
# you should disable these next few lines.
use_flipper!({ 'Flipper' => '0.87' })
post_install do |installer|
flipper_post_install(installer)
find_and_replace("Pods/Headers/Private/RCT-Folly/folly/synchronization/DistributedMutex-inl.h",
"atomic_notify_one(state)", "folly::atomic_notify_one(state)")
find_and_replace("Pods/Flipper-Folly/folly/synchronization/DistributedMutex-inl.h",
"atomic_wait_until(&state, previous | data, deadline)", "folly::atomic_wait_until(&state, previous | data, deadline)")
end
...
QUESTION
I am creating an MSI installer with Wix and wrote a task in the azure DevOps pipeline which builds the MSI solution file using MSBuild. When the code is pushed to remote the pipeline runs the task but my task returns the error saying WiX toolset is not installed hence the build fails. Though it is assured that the MSBuild task works as it is building other projects in the solution.
##[error]Process 'MSBuild.exe' exited with code '1'.
##[error][Path to wixproj](44,5): Error : The WiX Toolset v3.11 (or newer) build tools must be installed to build this project. To download the WiX Toolset, see http://wixtoolset.org/releases/
Is there any way to install Wix toolset using pipeline? Or any workaround which might help?
Please note that I am using a custom job pool if that might be a cause for this issue.
ANSWER
Answered 2022-Mar-09 at 18:02Check this article from the official wix documentation.
QUESTION
Android Studio Bumblebee (2021.1.1) was released stably on 25 January 2022 bundled with a new Device Manager (accompanying new support for Android 11+ device debugging over WIFI). I jumped on this stable release, updating from Android Studio Arctic Fox (2020.3.1 Patch 4).
Unfortunately however, since updating, physical devices/handsets don't remain connected to Android Studio for the purpose of debugging. I can confirm that the issue was introduced from Android Studio Bumblebee onwards (occurring in Beta and Canary builds also). I've reproduced the issue on Android Studio Bumblebee (Stable), Chipmunk (Beta), and Dolphin (Canary), but Android Studio Arctic Fox (superseded Stable) continues to work just fine.
The issue occurs soon after opening Android Studio (Bumblebee+) with one of my physical devices connected. Everything appears fine initially and I may even have enough time to deploy my project to the handset, before the device disappears from Android Studio (as if I'd physically disconnected the USB cable from my computer or from the handset itself).
I've tried a fair few things in an attempt to determine a root cause. These include testing:
- With different USB cables.
- With different handsets (both varying makes and models).
- With various versions of the Android Studio IDE (as mentioned above).
- Plugging the USB cables into different USB ports on my computer.
- Rebooting handsets and my computer.
- Restarting Android Studio.
- Invalidating caches and restarting Android Studio.
adb kill-server
thenadb start-server
.- Revoking/reaccepting USB debugging authorization.
- Reinstalled build tools/platform tools, and ADB.
- A great number of further possibilities, to no avail.
I searched and read through remotely similar issues, including (but not limited to) these:
- Android Studio Arctic Fox (Adb) - Connected Devices are being disconnected after some time
- Android debugger continually disconnects
This particular comment in one of the above issues clued me onto a possible root cause:
I have been fighting for a few days with adb not seeing my device. After trying many other posted solutions, I discovered that the issue was with Chrome also trying to connect its debugger to a web view. If Chrome is connected using chrome://inspect, then adb seems to disconnect. Quitting Chrome resolves the issue. Then I can connect with Android Studio and then restart Chrome and reconnect. Hope this helps someone else.
However I've been unable to do anything with the above discovery, other than close Google Chrome, and hope for the best. Obviously this isn't an ideal solution. It appears as though the moment Google Chrome shows the connected physical device in the chrome://inspect/#devices page, the physical device promptly becomes unavailable through Android Studio.
I've jumped back to Android Studio Arctic Fox (2020.3.1 Patch 4) for the moment, however this brings with it other issues (my current core project targets the latest SDK version, which requires the updated IDE).
Absolutely any help with this would be insanely appreciated. I've exhausted just about every avenue that I can think of!
ANSWER
Answered 2022-Feb-01 at 17:29I solved the problem by disabling
Settings -> Build, Execution, Deployment -> Debugger -> "Enable adb mDNS for wireless debugging"
QUESTION
Alright I have a package Pythran
which is a Python to C++ (PYD module) complier. The package itself on conda-forge says it requires clang
and clangxx
. BUT I have MS Build Tools clang-12
already installed, so these packages are not used at all.
Now every time I go to conda install [package_name]
it tells me my environment is inconsistent, because I force removed the clang libraries I don't need (or want) via a:
conda remove clang clangxx clang-13 --force
So I looked around a bit at the installation of things. And I found that there is a \Anaconda3\conda-meta\pythran-0.11.0-py39h832f523_0.json (note the name after the version changes)...
So I opened that file up, scrolled down to:
"depends": [
"beniget 0.4.*",
"decorator",
"gast 0.5.*",
"numpy >=1.19.5,<2.0a0",
"ply >=3.4",
"python >=3.9,<3.10.0a0",
"python_abi 3.9.* *_cp39",
"xsimd >=8.0.5,<8.1"
],
Which had these entries, which I manually removed:
"clang",
"clangxx",
So now when I go to run conda
it doesn't say my environment is inconsistent anymore. However, when I try to add a package, it insists on installing clang
, clang-13
, clangxx
.
Anyone have a way to completely remove these dependencies? I think maybe it's referring to files online rather than local, since I deleted those required libraries. I ran a command prompt: findstr /S /C:'clang' *
which is like calling grep from Linux. It shows all the files that reference clang
somewhere. It isn't referenced anywhere other than what I deleted already, hence my confusion.
Yes I understand these package managers like conda
are supposed to ensure your environment works. But I can compile Python to C++ to PYD (modules) no problem at all with these clang
libraries missing. Since I already have clang-12
in the path. This is more of an annoyance than anything else, as every package install / upgrade keeps wanting to install clang-13
libraries that aren't needed...
ANSWER
Answered 2022-Mar-01 at 00:36The cleaner solution is to create a dummy package that one can install as an indicator that the corresponding software is already available on the system. This is what Conda Forge provides for the mpich
package. Specifically, they provide an external build (see recipe), that one installs with
conda install mpich=*=external_*
For custom configurations like what you want, create your own dummy version of the clang
and clangxx
packages that would satisfy the requirements and install them to the environment. Something like
meta.yaml
{% set version = "12.0.1" %}
{% set build = 0 %}
package:
name: clang-dummies
version: {{ version }}
build:
number: {{ build }}
outputs:
- name: clang
string: external_{{ build }}
- name: clangxx
string: external_{{ build }}
about:
license: GPL-3.0-only
summary: Dummy package for external clang(xx) compiler.
After building this (conda build .
), you can install these local versions with
conda install --use-local clang=12=external* clangxx=12=external*
or upload them to a user Anaconda Cloud channel.
QUESTION
I get this Error when I try to install Pyodbc , I have already install visual studio and I have Microsoft Visual C++ 12 , 15-19 in my machine but still its giving this error.
Running setup.py clean for pyodbc
Failed to build pyodbc
Installing collected packages: sqlparse, pytz, asgiref, pyodbc, Django, Pillow, mssql-django, django-crispy-forms
Running setup.py install for pyodbc ... error
ERROR: Command errored out with exit status 1:
command: 'C:\Users\Athar\Desktop\New folder\Project\HeatlhCare\venv\Scripts\python.exe' -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\Athar\\AppData\\Local\\Temp\\pip-install-w0wwm18g\\pyodbc_61963e883a8543fea24a63b1c522bbea\\setup.py'"'"'; __file__='"'"'C:\\Users\\Athar\\AppData\\Local\\Temp\\pip-install-w0wwm18g\\pyodbc_61963e883a8543fea24a63b1c522bbea\\setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record 'C:\Users\Athar\AppData\Local\Temp\pip-record-t1td50y6\install-record.txt' --single-version-externally-managed --compile --install-headers 'C:\Users\Athar\Desktop\New folder\Project\HeatlhCare\venv\include\site\python3.10\pyodbc'
cwd: C:\Users\Athar\AppData\Local\Temp\pip-install-w0wwm18g\pyodbc_61963e883a8543fea24a63b1c522bbea\
Complete output (7 lines):
running install
C:\Users\Athar\Desktop\New folder\Project\HeatlhCare\venv\lib\site-packages\setuptools\command\install.py:34: SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build and pip and other standards-based tools.
warnings.warn(
running build
running build_ext
building 'pyodbc' extension
error: Microsoft Visual C++ 14.0 or greater is required. Get it with "Microsoft C++ Build Tools": https://visualstudio.microsoft.com/visual-cpp-build-tools/
----------------------------------------
ERROR: Command errored out with exit status 1: 'C:\Users\Athar\Desktop\New folder\Project\HeatlhCare\venv\Scripts\python.exe' -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\Athar\\AppData\\Local\\Temp\\pip-install-w0wwm18g\\pyodbc_61963e883a8543fea24a63b1c522bbea\\setup.py'"'"'; __file__='"'"'C:\\Users\\Athar\\AppData\\Local\\Temp\\pip-install-w0wwm18g\\pyodbc_61963e883a8543fea24a63b1c522bbea\\setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record 'C:\Users\Athar\AppData\Local\Temp\pip-record-t1td50y6\install-record.txt' --single-version-externally-managed --compile --install-headers 'C:\Users\Athar\Desktop\New folder\Project\HeatlhCare\venv\include\site\python3.10\pyodbc' Check the logs for full command output.
ANSWER
Answered 2021-Nov-12 at 13:38The current release of pyodbc (4.0.32) does not have pre-built wheel files for Python 3.10. The easiest way to get it installed at the moment is to download the appropriate wheel from
https://www.lfd.uci.edu/~gohlke/pythonlibs/#pyodbc
and then install it. For example, if you are running 64-bit Python then you would download the 64-bit wheel and use
pip install pyodbc‑4.0.32‑cp310‑cp310‑win_amd64.whl
QUESTION
I have a QObject
derived class Expense
that I use in QML like this.
// main.qml
Expense {
id: expenseManager
onExpenseCreated: {
// Do something
}
}
The expense class has no UI components, it has some basic Signal and Slots for API communications.
// expense.h
#ifndef EXPENSE_H
#define EXPENSE_H
#include
#include
#include "service.h"
class Expense : public QObject
{
Q_OBJECT
private:
Service service;
void networkError();
bool buttonLock = false;
public:
explicit Expense(QObject *parent = nullptr);
public slots:
void createInvoice(QString item, float amount);
signals:
void expenseCreated();
};
#endif // EXPENSE_H
I have used qmlRegisterType()
for registering Expense
type in QML. Below is how my main()
looks like.
int main(int argc, char *argv[])
{
QGuiApplication app(argc, argv);
......
qmlRegisterType("com.kadbyte.expense", 1, 0, "Expense");
........
return app.exec();
}
Everything working perfectly as it used to. But recently I have upgraded my project to QT6 with CMake as the build tool instead of QMake. In the docs I saw that we can use qt_add_qml_module
command in CMakeList.txt to register C++ Classes instead of qmlRegisterType()
, by adding QML_ELEMENT
macro to the QObject class.
But I can't understand how to do this, the documentation doesn't make sense as it uses qmake example (Link to docs) instead of CMake. Below is my CMakeLists.txt file
cmake_minimum_required(VERSION 3.16)
project(Udyan VERSION 0.1 LANGUAGES CXX)
set(CMAKE_AUTOMOC ON)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
find_package(Qt6 6.2 COMPONENTS Quick REQUIRED)
qt_add_executable(appUdyan
main.cpp
expense.h expense.cpp
)
qt_add_qml_module(appUdyan
URI Udyan
VERSION 1.0
QML_FILES qml/main.qml
)
set_target_properties(appUdyan PROPERTIES
MACOSX_BUNDLE_GUI_IDENTIFIER my.example.com
MACOSX_BUNDLE_BUNDLE_VERSION ${PROJECT_VERSION}
MACOSX_BUNDLE_SHORT_VERSION_STRING ${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}
MACOSX_BUNDLE TRUE
WIN32_EXECUTABLE TRUE
)
target_compile_definitions(appUdyan
PRIVATE $<$,$>:QT_QML_DEBUG>)
target_link_libraries(appUdyan
PRIVATE Qt6::Quick)
So how to use qt_add_qml_module
to registering QObject class to use in QML?
Note: All the example I have given above is just an MRE and not my complete code.
ANSWER
Answered 2022-Feb-21 at 07:35You just need to add QML_ELEMENT
to your QObject-derived Expense
class's header and make sure you have moc enabled in your CMakeLists.txt. In application case it doesn't matter if the expense.h/cpp sources are included via qt_add_executable
or qt_add_qml_module
. I think it's clearer to add them to qt_add_qml_module
SOURCES. Then you just import module URI in you QML file. In the example below I'm printing out property value from Expense object in QML.
CMakeLists.txt
set(CMAKE_AUTOMOC ON)
qt_add_qml_module(appUdyan
URI udyan
VERSION 1.0
QML_FILES
main.qml
SOURCES
expense.h
expense.cpp
)
C++
#include
#include
class Expense : public QObject
{
Q_OBJECT
QML_ELEMENT
Q_PROPERTY(int value READ value NOTIFY valueChanged)
public:
explicit Expense(QObject *parent = nullptr);
int value() const;
signals:
void valueChanged();
private:
int m_value {5};
};
QML:
import QtQuick
import udyan
Window {
width: 640
height: 480
visible: true
title: qsTr("Hello World")
Expense {
id: expense
Component.onCompleted: console.log(expense.value)
}
}
QUESTION
Building my app using flutter on android studio, and when I upload my app bundle (made via flutter build appbundle
, the message pops up:
Warning
This App Bundle contains native code, and youve not uploaded debug symbols. We recommend you upload a symbol file to make your crashes and ANRs easier to analyze and debug. Learn More
I've tried every solution currently online to fix this. Every combination of the following:
these solutions:
- https://github.com/flutter/flutter/issues/60240#issuecomment-894683946
- https://github.com/flutter/flutter/issues/60240#issuecomment-917321657
- https://stackoverflow.com/a/63436935/5229301
- https://stackoverflow.com/a/64729294/5229301
- https://stackoverflow.com/a/70337587/5229301
Upgrading to Flutter 2.10.0
Upgrading to Android Studio Bumblebee | 2021.1.1 Patch 1 and clicking check for updates, to which it responds You already have the latest version of Android Studio and plugins installed.
Trying to check the gradle plugin version, but it's packaged into android studio, and I can't see the version nor an option to upgrade.
Upgrading Android SDK build tools to 33-rc1. via SDK manager
Installing NDK (Side-by-side) via SDK manager
Installing CMake via SDK manager
Adding ndk.dir=/home/jaden/Android/Sdk/ndk/23.1.7779620
to the local.properties file, even though that's apparently deprecated. adding android.buildTypes.release.ndk.debugSymbolLevel = 'SYMBOL_TABLE'
to the bottom of my app/build.gradle.
from app/build.gradle:
android {
compileSdkVersion 31
...
defaultConfig {
applicationId "app.(myapp)"
minSdkVersion 23
targetSdkVersion 31
versionCode flutterVersionCode.toInteger()
versionName flutterVersionName
}
ndkVersion "23.1.7779620"
buildTypes {
...
release {
signingConfig signingConfigs.release
ndk {
debugSymbolLevel 'SYMBOL_TABLE'
}
}
}
}
flutter doctor:
flutter doctor
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, 2.10.0, on Manjaro Linux 5.13.19-2-MANJARO, locale en_US.UTF-8)
[✓] Android toolchain - develop for Android devices (Android SDK version 31.0.0)
[✗] Chrome - develop for the web (Cannot find Chrome executable at google-chrome)
! Cannot find Chrome. Try setting CHROME_EXECUTABLE to a Chrome executable.
[✓] Android Studio (version 2021.1)
[!] Connected device
! No devices available
[✓] HTTP Host Availability
! Doctor found issues in 2 categories.
last lines of flutter build appbundle -v
:
[ ] > Task :package_info_plus:generateReleaseBuildConfig UP-TO-DATE
[ ] > Task :package_info_plus:parseReleaseLocalResources UP-TO-DATE
[ ] > Task :package_info_plus:generateReleaseRFile UP-TO-DATE
[ ] > Task :package_info_plus:javaPreCompileRelease UP-TO-DATE
[ ] > Task :package_info_plus:compileReleaseJavaWithJavac UP-TO-DATE
[ ] > Task :package_info_plus:mergeReleaseGeneratedProguardFiles UP-TO-DATE
[ ] > Task :package_info_plus:exportReleaseConsumerProguardFiles UP-TO-DATE
[ ] > Task :fluttertoast:compileReleaseAidl NO-SOURCE
[ ] > Task :fluttertoast:generateReleaseBuildConfig UP-TO-DATE
[ ] > Task :fluttertoast:parseReleaseLocalResources UP-TO-DATE
[ ] > Task :fluttertoast:generateReleaseRFile UP-TO-DATE
[ ] > Task :fluttertoast:compileReleaseKotlin UP-TO-DATE
[ ] > Task :fluttertoast:javaPreCompileRelease UP-TO-DATE
[ ] > Task :fluttertoast:compileReleaseJavaWithJavac UP-TO-DATE
[ +97 ms] > Task :fluttertoast:mergeReleaseGeneratedProguardFiles UP-TO-DATE
[ ] > Task :fluttertoast:exportReleaseConsumerProguardFiles UP-TO-DATE
[ ] > Task :permission_handler:compileReleaseAidl NO-SOURCE
[ ] > Task :permission_handler:generateReleaseBuildConfig UP-TO-DATE
[ ] > Task :permission_handler:parseReleaseLocalResources UP-TO-DATE
[ ] > Task :permission_handler:generateReleaseRFile UP-TO-DATE
[ ] > Task :permission_handler:javaPreCompileRelease UP-TO-DATE
[ ] > Task :permission_handler:compileReleaseJavaWithJavac UP-TO-DATE
[ ] > Task :permission_handler:mergeReleaseGeneratedProguardFiles UP-TO-DATE
[ ] > Task :permission_handler:exportReleaseConsumerProguardFiles UP-TO-DATE
[ ] > Task :app:buildKotlinToolingMetadata UP-TO-DATE
[ ] > Task :app:checkReleaseDuplicateClasses UP-TO-DATE
[ ] > Task :app:compileReleaseAidl NO-SOURCE
[ ] > Task :app:generateReleaseBuildConfig UP-TO-DATE
[ ] > Task :cloud_firestore:writeReleaseAarMetadata UP-TO-DATE
[ ] > Task :file_picker:writeReleaseAarMetadata UP-TO-DATE
[ ] > Task :firebase_auth:writeReleaseAarMetadata UP-TO-DATE
[ ] > Task :firebase_core:writeReleaseAarMetadata UP-TO-DATE
[ ] > Task :flutter_fimber:writeReleaseAarMetadata UP-TO-DATE
[ ] > Task :flutter_inappwebview:writeReleaseAarMetadata UP-TO-DATE
[ ] > Task :flutter_keyboard_visibility:writeReleaseAarMetadata UP-TO-DATE
[ ] > Task :flutter_plugin_android_lifecycle:writeReleaseAarMetadata UP-TO-DATE
[ ] > Task :fluttertoast:writeReleaseAarMetadata UP-TO-DATE
[ ] > Task :image_picker:writeReleaseAarMetadata UP-TO-DATE
[ ] > Task :package_info_plus:writeReleaseAarMetadata UP-TO-DATE
[ ] > Task :path_provider_android:writeReleaseAarMetadata UP-TO-DATE
[ ] > Task :permission_handler:writeReleaseAarMetadata UP-TO-DATE
[ ] > Task :share_plus:writeReleaseAarMetadata UP-TO-DATE
[ ] > Task :shared_preferences_android:writeReleaseAarMetadata UP-TO-DATE
[ ] > Task :url_launcher_android:writeReleaseAarMetadata UP-TO-DATE
[ ] > Task :webview_flutter_android:writeReleaseAarMetadata UP-TO-DATE
[ ] > Task :app:checkReleaseAarMetadata UP-TO-DATE
[ +495 ms] > Task :app:copyFlutterAssetsRelease
[ ] > Task :app:processReleaseManifestForPackage UP-TO-DATE
[ ] > Task :app:processReleaseResources UP-TO-DATE
[ ] > Task :cloud_firestore:bundleLibCompileToJarRelease UP-TO-DATE
[ ] > Task :file_picker:bundleLibCompileToJarRelease UP-TO-DATE
[ ] > Task :firebase_auth:bundleLibCompileToJarRelease UP-TO-DATE
[ ] > Task :flutter_fimber:bundleLibCompileToJarRelease UP-TO-DATE
[ ] > Task :flutter_inappwebview:bundleLibCompileToJarRelease UP-TO-DATE
[ ] > Task :flutter_keyboard_visibility:bundleLibCompileToJarRelease UP-TO-DATE
[ ] > Task :fluttertoast:bundleLibCompileToJarRelease UP-TO-DATE
[ ] > Task :image_picker:bundleLibCompileToJarRelease UP-TO-DATE
[ ] > Task :package_info_plus:bundleLibCompileToJarRelease UP-TO-DATE
[ ] > Task :path_provider_android:bundleLibCompileToJarRelease UP-TO-DATE
[ ] > Task :permission_handler:bundleLibCompileToJarRelease UP-TO-DATE
[ ] > Task :share_plus:bundleLibCompileToJarRelease UP-TO-DATE
[ ] > Task :shared_preferences_android:bundleLibCompileToJarRelease UP-TO-DATE
[ ] > Task :url_launcher_android:bundleLibCompileToJarRelease UP-TO-DATE
[ ] > Task :webview_flutter_android:bundleLibCompileToJarRelease UP-TO-DATE
[ +96 ms] > Task :app:compileReleaseKotlin UP-TO-DATE
[ ] > Task :app:javaPreCompileRelease UP-TO-DATE
[ ] > Task :app:compileReleaseJavaWithJavac UP-TO-DATE
[ ] > Task :app:extractProguardFiles UP-TO-DATE
[ ] > Task :app:mergeReleaseGeneratedProguardFiles UP-TO-DATE
[ ] > Task :app:processReleaseJavaRes NO-SOURCE
[ ] > Task :cloud_firestore:processReleaseJavaRes NO-SOURCE
[ ] > Task :cloud_firestore:bundleLibResRelease NO-SOURCE
[ ] > Task :file_picker:processReleaseJavaRes NO-SOURCE
[ ] > Task :file_picker:bundleLibResRelease NO-SOURCE
[ ] > Task :firebase_auth:processReleaseJavaRes NO-SOURCE
[ ] > Task :firebase_auth:bundleLibResRelease NO-SOURCE
[ ] > Task :firebase_core:processReleaseJavaRes NO-SOURCE
[ ] > Task :firebase_core:bundleLibResRelease NO-SOURCE
[ ] > Task :flutter_fimber:processReleaseJavaRes NO-SOURCE
[ ] > Task :flutter_fimber:bundleLibResRelease UP-TO-DATE
[ ] > Task :flutter_inappwebview:processReleaseJavaRes NO-SOURCE
[ ] > Task :flutter_inappwebview:bundleLibResRelease NO-SOURCE
[ ] > Task :flutter_keyboard_visibility:processReleaseJavaRes NO-SOURCE
[ ] > Task :flutter_keyboard_visibility:bundleLibResRelease NO-SOURCE
[ ] > Task :flutter_plugin_android_lifecycle:processReleaseJavaRes NO-SOURCE
[ ] > Task :flutter_plugin_android_lifecycle:bundleLibResRelease NO-SOURCE
[ ] > Task :fluttertoast:processReleaseJavaRes NO-SOURCE
[ ] > Task :fluttertoast:bundleLibResRelease UP-TO-DATE
[ ] > Task :image_picker:processReleaseJavaRes NO-SOURCE
[ ] > Task :image_picker:bundleLibResRelease NO-SOURCE
[ ] > Task :package_info_plus:processReleaseJavaRes NO-SOURCE
[ ] > Task :package_info_plus:bundleLibResRelease NO-SOURCE
[ ] > Task :path_provider_android:processReleaseJavaRes NO-SOURCE
[ ] > Task :path_provider_android:bundleLibResRelease NO-SOURCE
[ ] > Task :permission_handler:processReleaseJavaRes NO-SOURCE
[ ] > Task :permission_handler:bundleLibResRelease NO-SOURCE
[ ] > Task :share_plus:processReleaseJavaRes NO-SOURCE
[ ] > Task :share_plus:bundleLibResRelease NO-SOURCE
[ ] > Task :shared_preferences_android:processReleaseJavaRes NO-SOURCE
[ ] > Task :shared_preferences_android:bundleLibResRelease NO-SOURCE
[ ] > Task :url_launcher_android:processReleaseJavaRes NO-SOURCE
[ ] > Task :url_launcher_android:bundleLibResRelease NO-SOURCE
[ ] > Task :webview_flutter_android:processReleaseJavaRes NO-SOURCE
[ ] > Task :webview_flutter_android:bundleLibResRelease NO-SOURCE
[ ] > Task :app:mergeReleaseJavaResource UP-TO-DATE
[ ] > Task :cloud_firestore:bundleLibRuntimeToJarRelease UP-TO-DATE
[ ] > Task :file_picker:bundleLibRuntimeToJarRelease UP-TO-DATE
[ ] > Task :firebase_auth:bundleLibRuntimeToJarRelease UP-TO-DATE
[ ] > Task :firebase_core:bundleLibRuntimeToJarRelease UP-TO-DATE
[ ] > Task :flutter_fimber:bundleLibRuntimeToJarRelease UP-TO-DATE
[ ] > Task :flutter_inappwebview:bundleLibRuntimeToJarRelease UP-TO-DATE
[ ] > Task :flutter_keyboard_visibility:bundleLibRuntimeToJarRelease UP-TO-DATE
[ ] > Task :flutter_plugin_android_lifecycle:bundleLibRuntimeToJarRelease UP-TO-DATE
[ ] > Task :fluttertoast:bundleLibRuntimeToJarRelease UP-TO-DATE
[ ] > Task :image_picker:bundleLibRuntimeToJarRelease UP-TO-DATE
[ ] > Task :package_info_plus:bundleLibRuntimeToJarRelease UP-TO-DATE
[ ] > Task :path_provider_android:bundleLibRuntimeToJarRelease UP-TO-DATE
[ ] > Task :permission_handler:bundleLibRuntimeToJarRelease UP-TO-DATE
[ ] > Task :share_plus:bundleLibRuntimeToJarRelease UP-TO-DATE
[ ] > Task :shared_preferences_android:bundleLibRuntimeToJarRelease UP-TO-DATE
[ ] > Task :url_launcher_android:bundleLibRuntimeToJarRelease UP-TO-DATE
[ ] > Task :webview_flutter_android:bundleLibRuntimeToJarRelease UP-TO-DATE
[ +172 ms] > Task :app:minifyReleaseWithR8 UP-TO-DATE
[ ] > Task :app:mergeReleaseJniLibFolders UP-TO-DATE
[ ] > Task :cloud_firestore:mergeReleaseJniLibFolders UP-TO-DATE
[ ] > Task :cloud_firestore:mergeReleaseNativeLibs NO-SOURCE
[ ] > Task :cloud_firestore:copyReleaseJniLibsProjectOnly UP-TO-DATE
[ ] > Task :file_picker:mergeReleaseJniLibFolders UP-TO-DATE
[ ] > Task :file_picker:mergeReleaseNativeLibs NO-SOURCE
[ ] > Task :file_picker:copyReleaseJniLibsProjectOnly UP-TO-DATE
[ ] > Task :firebase_auth:mergeReleaseJniLibFolders UP-TO-DATE
[ ] > Task :firebase_auth:mergeReleaseNativeLibs NO-SOURCE
[ ] > Task :firebase_auth:copyReleaseJniLibsProjectOnly UP-TO-DATE
[ ] > Task :firebase_core:mergeReleaseJniLibFolders UP-TO-DATE
[ ] > Task :firebase_core:mergeReleaseNativeLibs NO-SOURCE
[ ] > Task :firebase_core:copyReleaseJniLibsProjectOnly UP-TO-DATE
[ ] > Task :flutter_fimber:mergeReleaseJniLibFolders UP-TO-DATE
[ ] > Task :flutter_fimber:mergeReleaseNativeLibs NO-SOURCE
[ ] > Task :flutter_fimber:copyReleaseJniLibsProjectOnly UP-TO-DATE
[ ] > Task :flutter_inappwebview:mergeReleaseJniLibFolders UP-TO-DATE
[ ] > Task :flutter_inappwebview:mergeReleaseNativeLibs NO-SOURCE
[ ] > Task :flutter_inappwebview:copyReleaseJniLibsProjectOnly UP-TO-DATE
[ ] > Task :flutter_keyboard_visibility:mergeReleaseJniLibFolders UP-TO-DATE
[ ] > Task :flutter_keyboard_visibility:mergeReleaseNativeLibs NO-SOURCE
[ ] > Task :flutter_keyboard_visibility:copyReleaseJniLibsProjectOnly UP-TO-DATE
[ ] > Task :flutter_plugin_android_lifecycle:mergeReleaseJniLibFolders UP-TO-DATE
[ ] > Task :flutter_plugin_android_lifecycle:mergeReleaseNativeLibs NO-SOURCE
[ ] > Task :flutter_plugin_android_lifecycle:copyReleaseJniLibsProjectOnly UP-TO-DATE
[ ] > Task :fluttertoast:mergeReleaseJniLibFolders UP-TO-DATE
[ ] > Task :fluttertoast:mergeReleaseNativeLibs NO-SOURCE
[ ] > Task :fluttertoast:copyReleaseJniLibsProjectOnly UP-TO-DATE
[ +16 ms] > Task :image_picker:mergeReleaseJniLibFolders UP-TO-DATE
[ ] > Task :image_picker:mergeReleaseNativeLibs NO-SOURCE
[ ] > Task :image_picker:copyReleaseJniLibsProjectOnly UP-TO-DATE
[ ] > Task :package_info_plus:mergeReleaseJniLibFolders UP-TO-DATE
[ ] > Task :package_info_plus:mergeReleaseNativeLibs NO-SOURCE
[ ] > Task :package_info_plus:copyReleaseJniLibsProjectOnly UP-TO-DATE
[ ] > Task :path_provider_android:mergeReleaseJniLibFolders UP-TO-DATE
[ ] > Task :path_provider_android:mergeReleaseNativeLibs NO-SOURCE
[ ] > Task :path_provider_android:copyReleaseJniLibsProjectOnly UP-TO-DATE
[ +98 ms] > Task :permission_handler:mergeReleaseJniLibFolders UP-TO-DATE
[ ] > Task :permission_handler:mergeReleaseNativeLibs NO-SOURCE
[ ] > Task :permission_handler:copyReleaseJniLibsProjectOnly UP-TO-DATE
[ ] > Task :share_plus:mergeReleaseJniLibFolders UP-TO-DATE
[ ] > Task :share_plus:mergeReleaseNativeLibs NO-SOURCE
[ ] > Task :share_plus:copyReleaseJniLibsProjectOnly UP-TO-DATE
[ ] > Task :shared_preferences_android:mergeReleaseJniLibFolders UP-TO-DATE
[ ] > Task :shared_preferences_android:mergeReleaseNativeLibs NO-SOURCE
[ ] > Task :shared_preferences_android:copyReleaseJniLibsProjectOnly UP-TO-DATE
[ ] > Task :url_launcher_android:mergeReleaseJniLibFolders UP-TO-DATE
[ ] > Task :url_launcher_android:mergeReleaseNativeLibs NO-SOURCE
[ ] > Task :url_launcher_android:copyReleaseJniLibsProjectOnly UP-TO-DATE
[ ] > Task :webview_flutter_android:mergeReleaseJniLibFolders UP-TO-DATE
[ ] > Task :webview_flutter_android:mergeReleaseNativeLibs NO-SOURCE
[ +98 ms] > Task :webview_flutter_android:copyReleaseJniLibsProjectOnly UP-TO-DATE
[ ] > Task :app:mergeReleaseNativeLibs UP-TO-DATE
[ ] > Task :app:stripReleaseDebugSymbols UP-TO-DATE
[+2799 ms] > Task :app:buildReleasePreBundle
[ ] > Task :cloud_firestore:prepareReleaseArtProfile UP-TO-DATE
[ ] > Task :file_picker:prepareReleaseArtProfile UP-TO-DATE
[ ] > Task :firebase_auth:prepareReleaseArtProfile UP-TO-DATE
[ ] > Task :firebase_core:prepareReleaseArtProfile UP-TO-DATE
[ ] > Task :flutter_fimber:prepareReleaseArtProfile UP-TO-DATE
[ ] > Task :flutter_inappwebview:prepareReleaseArtProfile UP-TO-DATE
[ ] > Task :flutter_keyboard_visibility:prepareReleaseArtProfile UP-TO-DATE
[ ] > Task :flutter_plugin_android_lifecycle:prepareReleaseArtProfile UP-TO-DATE
[ ] > Task :fluttertoast:prepareReleaseArtProfile UP-TO-DATE
[ ] > Task :image_picker:prepareReleaseArtProfile UP-TO-DATE
[ ] > Task :package_info_plus:prepareReleaseArtProfile UP-TO-DATE
[ ] > Task :path_provider_android:prepareReleaseArtProfile UP-TO-DATE
[ ] > Task :permission_handler:prepareReleaseArtProfile UP-TO-DATE
[ ] > Task :share_plus:prepareReleaseArtProfile UP-TO-DATE
[ ] > Task :shared_preferences_android:prepareReleaseArtProfile UP-TO-DATE
[ ] > Task :url_launcher_android:prepareReleaseArtProfile UP-TO-DATE
[ ] > Task :webview_flutter_android:prepareReleaseArtProfile UP-TO-DATE
[ ] > Task :app:mergeReleaseArtProfile UP-TO-DATE
[ ] > Task :app:compileReleaseArtProfile UP-TO-DATE
[ ] > Task :app:collectReleaseDependencies UP-TO-DATE
[ ] > Task :app:configureReleaseDependencies UP-TO-DATE
[ ] > Task :app:extractReleaseNativeSymbolTables UP-TO-DATE
[ ] > Task :app:parseReleaseIntegrityConfig UP-TO-DATE
[ ] > Task :app:writeReleaseAppMetadata UP-TO-DATE
[ ] > Task :app:validateSigningRelease UP-TO-DATE
[+3397 ms] > Task :app:packageReleaseBundle
[+4398 ms] > Task :app:shrinkBundleReleaseResources
[+5699 ms] > Task :app:signReleaseBundle
[ ] > Task :app:produceReleaseBundleIdeListingFile
[ ] > Task :app:createReleaseBundleListingFileRedirect
[ ] > Task :app:bundleRelease
[ +96 ms] Deprecated Gradle features were used in this build, making it incompatible with Gradle 8.0.
[ ] You can use '--warning-mode all' to show the individual deprecation warnings and determine if they come from your own scripts or plugins.
[ ] See https://docs.gradle.org/7.4/userguide/command_line_interface.html#sec:command_line_warnings
[ ] BUILD SUCCESSFUL in 36s
[ ] 375 actionable tasks: 11 executed, 364 up-to-date
[ +397 ms] Running Gradle task 'bundleRelease'... (completed in 37.5s)
[ +30 ms] ✓ Built build/app/outputs/bundle/release/app-release.aab (68.2MB).
[ +5 ms] "flutter appbundle" took 39,072ms.
[ +235 ms] ensureAnalyticsSent: 224ms
[ +5 ms] Running shutdown hooks
[ +1 ms] Shutdown hooks complete
[ +3 ms] exiting with code 0
What's insane is that the flutter documentation for building and releasing an android app says absolutely nothing about including native debug symbols. That leads me to believe that for some reason, flutter should already be including them in the app bundle, but it's not. Does it have anything to do with obfuscating my code? I didn't obfuscate mine, but do I need to use the solutions described in there to pull out the native debug symbols?
Is this even supported? Should I just upload the app as-is without the feature? What am I supposed to do when I get unintelligible crash reports?
ANSWER
Answered 2022-Feb-19 at 21:44Turns out the problem is occurring, for some reason, due to my usage of gradle plugin 7.1.1. Changing classpath 'com.android.tools.build:gradle:7.1.1'
to 'classpath 'com.android.tools.build:gradle:4.1.3'` fixes my problem. The google play console recognizes the native debug symbols within the app bundle. It's unclear why, except within the app bundle, the directory BUNDLE-METADATA contains the directories:
Using 7.1.1:
com.android.tools.build.gradle
com.android.tools.build.libraries
com.android.tools.build.obfuscation
Using 4.1.3:
com.android.tools.build.debugsymbols
com.android.tools.build.libraries
com.android.tools.build.obfuscation
I've tried it with multiple versions of the android gradle plugin, and I can say that the problem occurs after android gradle plugin version 4.1.3. So my fix right now is to make android/build.gradle
have:
buildscript {
...
dependencies {
classpath 'com.android.tools.build:gradle:4.1.3'
...
}
}
The next version of the plugin, 4.2.0, omits the native debug files, despite this inclusion in app/build.gradle:
android {
...
packagingOptions {
dex {
useLegacyPackaging true
}
jniLibs {
useLegacyPackaging true
}
}
}
QUESTION
I am first time using function pointers and ran into a weird problem. I am writing a code for STM32G4xx. The main idea is to transmit and receive data through LPUART. I have implemented simple FSM to handle TX and RX. LPUART configured in DMA interrupt mode. I have typedef the function pointer and declared the three function pointer variables (ISR handles) in main.h file as follow:
#ifndef __MAIN_H
#define __MAIN_H
#ifdef __cplusplus
extern "C" {
#endif
/* USER CODE BEGIN ET */
typedef void (*_func_clbck)(void);
/* USER CODE END ET */
_func_clbck lpuart_tx_tc_isr_clback;
//_func_clbck lpuart_rx_rne_isr_clback;
_func_clbck lpuart_dma_tx_tc_isr_clback;
_func_clbck lpuart_dma_rx_tc_isr_clback;
/* USER CODE END Private defines */
#ifdef __cplusplus
}
#endif
#endif /* __MAIN_H */
The definition of the function pointer is in function MX_LPUART1_UART_Init()
in the main.c file.
#include "main.h"
int main(void)
{
/* USER CODE BEGIN 1 */
/* USER CODE END 1 */
/* MCU Configuration--------------------------------------------------------*/
/* Reset of all peripherals, Initializes the Flash interface and the Systick. */
LL_APB2_GRP1_EnableClock(LL_APB2_GRP1_PERIPH_SYSCFG);
LL_APB1_GRP1_EnableClock(LL_APB1_GRP1_PERIPH_PWR);
NVIC_SetPriorityGrouping(NVIC_PRIORITYGROUP_4);
/* System interrupt init*/
/* SysTick_IRQn interrupt configuration */
NVIC_SetPriority(SysTick_IRQn, NVIC_EncodePriority(NVIC_GetPriorityGrouping(),1, 0));
/** Configure the internal voltage reference buffer voltage scale
*/
LL_VREFBUF_SetVoltageScaling(LL_VREFBUF_VOLTAGE_SCALE1);
/** Enable the Internal Voltage Reference buffer
*/
LL_VREFBUF_Enable();
/** Configure the internal voltage reference buffer high impedance mode
*/
LL_VREFBUF_DisableHIZ();
/** Disable the internal Pull-Up in Dead Battery pins of UCPD peripheral
*/
LL_PWR_DisableUCPDDeadBattery();
/* USER CODE BEGIN Init */
/* USER CODE END Init */
/* Configure the system clock */
SystemClock_Config();
/* USER CODE BEGIN SysInit */
/* USER CODE END SysInit */
/* Initialize all configured peripherals */
MX_GPIO_Init();
MX_DMA_Init();
MX_LPUART1_UART_Init();
MX_RTC_Init();
/* USER CODE BEGIN 2 */
#ifdef LPUART_TEST
lpuart_init_test();
#endif
/* USER CODE END 2 */
/* Infinite loop */
/* USER CODE BEGIN WHILE */
LL_GPIO_ResetOutputPin(GPIOC,LL_GPIO_PIN_6);
//LL_GPIO_SetOutputPin(GPIOC,LL_GPIO_PIN_6);
LL_mDelay(1);
uint8_t buf[9] ={'a','d','v',' ','l','o','w','\r','\n'};
//uint8_t buf[9] ={1,2,3,4,5,6,7,8,9};
#ifdef LPUART_TEST
uint16_t len_test[19] = {0,16,17,65535, 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15};
for(uint16_t i = 0 ; i<19 ; i++){
set_len_rx_dma_buff(len_test[i]);
lpuart_rx_test();
}
#endif
static uint8_t once = 1;
while (1)
{
lpuart_task();
//delay_ms_DWT(1);
/*if(once){
once = 0;
lpuart_start_tx(buf, 9);
LL_mDelay(100);
}*/
if(1){
//lpuart_start_tx(buf, 9);
if(!lpuart_isTxBusy()){
lpuart_start_tx(buf, 9);
delay_ms_DWT(1);
if(!lpuart_isRxBusy()){
rxOldIndex += rxIndex;
if(rxOldIndex > 255){
rxOldIndex = 0;
rxIndex = 0;
}
rxIndex = RingBuffer_available(&lpuart_RX_ring_buff);
for(i = rxOldIndex ; i < (rxIndex+rxOldIndex) ; i++ ){
rxBuff[i] = RingBuffer_readMeas(&lpuart_RX_ring_buff);
}
}
}
}
//}
}
/* USER CODE END WHILE */
/* USER CODE BEGIN 3 */
/* USER CODE END 3 */
}
static void MX_LPUART1_UART_Init(void)
{
/* USER CODE BEGIN LPUART1_Init 0 */
/* USER CODE END LPUART1_Init 0 */
LL_LPUART_InitTypeDef LPUART_InitStruct = {0};
LL_GPIO_InitTypeDef GPIO_InitStruct = {0};
/* Peripheral clock enable */
LL_APB1_GRP2_EnableClock(LL_APB1_GRP2_PERIPH_LPUART1);
LL_AHB2_GRP1_EnableClock(LL_AHB2_GRP1_PERIPH_GPIOB);
/**LPUART1 GPIO Configuration
PB10 ------> LPUART1_RX
PB11 ------> LPUART1_TX
*/
GPIO_InitStruct.Pin = LL_GPIO_PIN_10;
GPIO_InitStruct.Mode = LL_GPIO_MODE_ALTERNATE;
GPIO_InitStruct.Speed = LL_GPIO_SPEED_FREQ_LOW;
GPIO_InitStruct.OutputType = LL_GPIO_OUTPUT_PUSHPULL;
GPIO_InitStruct.Pull = LL_GPIO_PULL_NO;
GPIO_InitStruct.Alternate = LL_GPIO_AF_8;
LL_GPIO_Init(GPIOB, &GPIO_InitStruct);
GPIO_InitStruct.Pin = LL_GPIO_PIN_11;
GPIO_InitStruct.Mode = LL_GPIO_MODE_ALTERNATE;
GPIO_InitStruct.Speed = LL_GPIO_SPEED_FREQ_LOW;
GPIO_InitStruct.OutputType = LL_GPIO_OUTPUT_PUSHPULL;
GPIO_InitStruct.Pull = LL_GPIO_PULL_NO;
GPIO_InitStruct.Alternate = LL_GPIO_AF_8;
LL_GPIO_Init(GPIOB, &GPIO_InitStruct);
/* LPUART1 DMA Init */
/* LPUART1_TX Init */
LL_DMA_SetPeriphRequest(DMA1, LL_DMA_CHANNEL_1, LL_DMAMUX_REQ_LPUART1_TX);
LL_DMA_SetDataTransferDirection(DMA1, LL_DMA_CHANNEL_1, LL_DMA_DIRECTION_MEMORY_TO_PERIPH);
LL_DMA_SetChannelPriorityLevel(DMA1, LL_DMA_CHANNEL_1, LL_DMA_PRIORITY_HIGH);
LL_DMA_SetMode(DMA1, LL_DMA_CHANNEL_1, LL_DMA_MODE_NORMAL);
LL_DMA_SetPeriphIncMode(DMA1, LL_DMA_CHANNEL_1, LL_DMA_PERIPH_NOINCREMENT);
LL_DMA_SetMemoryIncMode(DMA1, LL_DMA_CHANNEL_1, LL_DMA_MEMORY_INCREMENT);
LL_DMA_SetPeriphSize(DMA1, LL_DMA_CHANNEL_1, LL_DMA_PDATAALIGN_BYTE);
LL_DMA_SetMemorySize(DMA1, LL_DMA_CHANNEL_1, LL_DMA_MDATAALIGN_BYTE);
/* LPUART1_RX Init */
LL_DMA_SetPeriphRequest(DMA1, LL_DMA_CHANNEL_2, LL_DMAMUX_REQ_LPUART1_RX);
LL_DMA_SetDataTransferDirection(DMA1, LL_DMA_CHANNEL_2, LL_DMA_DIRECTION_PERIPH_TO_MEMORY);
LL_DMA_SetChannelPriorityLevel(DMA1, LL_DMA_CHANNEL_2, LL_DMA_PRIORITY_HIGH);
LL_DMA_SetMode(DMA1, LL_DMA_CHANNEL_2, LL_DMA_MODE_CIRCULAR);
LL_DMA_SetPeriphIncMode(DMA1, LL_DMA_CHANNEL_2, LL_DMA_PERIPH_NOINCREMENT);
LL_DMA_SetMemoryIncMode(DMA1, LL_DMA_CHANNEL_2, LL_DMA_MEMORY_INCREMENT);
LL_DMA_SetPeriphSize(DMA1, LL_DMA_CHANNEL_2, LL_DMA_PDATAALIGN_BYTE);
LL_DMA_SetMemorySize(DMA1, LL_DMA_CHANNEL_2, LL_DMA_MDATAALIGN_BYTE);
/* LPUART1 interrupt Init */
NVIC_SetPriority(LPUART1_IRQn, NVIC_EncodePriority(NVIC_GetPriorityGrouping(),0, 0));
NVIC_EnableIRQ(LPUART1_IRQn);
/* USER CODE BEGIN LPUART1_Init 1 */
/* USER CODE END LPUART1_Init 1 */
LPUART_InitStruct.PrescalerValue = LL_LPUART_PRESCALER_DIV1;
LPUART_InitStruct.BaudRate = 9600;
LPUART_InitStruct.DataWidth = LL_LPUART_DATAWIDTH_8B;
LPUART_InitStruct.StopBits = LL_LPUART_STOPBITS_1;
LPUART_InitStruct.Parity = LL_LPUART_PARITY_NONE;
LPUART_InitStruct.TransferDirection = LL_LPUART_DIRECTION_TX_RX;
LPUART_InitStruct.HardwareFlowControl = LL_LPUART_HWCONTROL_NONE;
LL_LPUART_Init(LPUART1, &LPUART_InitStruct);
LL_LPUART_SetTXFIFOThreshold(LPUART1, LL_LPUART_FIFOTHRESHOLD_1_8);
LL_LPUART_SetRXFIFOThreshold(LPUART1, LL_LPUART_FIFOTHRESHOLD_1_8);
LL_LPUART_DisableFIFO(LPUART1);
LL_LPUART_SetTXRXSwap(LPUART1, LL_LPUART_TXRX_SWAPPED);
// LL_LPUART_EnableOverrunDetect(LPUART1);
// LL_LPUART_EnableDMADeactOnRxErr(LPUART1);
/* USER CODE BEGIN WKUPType LPUART1 */
/* USER CODE END WKUPType LPUART1 */
LL_LPUART_Enable(LPUART1);
/* Polling LPUART1 initialisation */
while((!(LL_LPUART_IsActiveFlag_TEACK(LPUART1))) || (!(LL_LPUART_IsActiveFlag_REACK(LPUART1))))
{
}
/* USER CODE BEGIN LPUART1_Init 2 */
//LL_LPUART_EnableIT_TXE_TXFNF(LPUART1);
/* Enable TC interrupts for RX */
/* Enable HT & TC interrupts for TX */
// LL_DMA_EnableIT_TC(DMA1, LL_DMA_CHANNEL_1);
lpuart_tx_tc_isr_clback = LPUART_TX_TC_ISR_CALLBACK;
//lpuart_rx_rne_isr_clback = &LPUART_RX_RXNE_ISR_CALLBACK;
lpuart_dma_tx_tc_isr_clback = LPUART_DMA_TX_TC_CALLBACK;
lpuart_dma_rx_tc_isr_clback = LPUART_DMA_RX_TC_CALLBACK;
//LL_LPUART_EnableDirectionRx(LPUART1);
LL_LPUART_EnableDirectionTx(LPUART1);
//LL_LPUART_EnableIT_RXNE_RXFNE(LPUART1);
/* USER CODE END LPUART1_Init 2 */
}
In main function, in while loop, I am calling the lpuart_start_tx(buf, 9);
function just after the if(!lpuart_isTxBusy())
statement. This causes change of the address of the function pointer lpuart_dma_rx_tc_isr_clback
but other two function pointers don't change its addresses and work fine. When an intrrupt raised on the reception of the data, it tried to execute lpuart_dma_rx_tc_isr_clback
which causes the hard fault because its address was modified. Note that if I call lpuart_start_tx(buf, 9);
before if(!lpuart_isTxBusy())
, then everything works fine. I don't understand what could be an issue.
I have checked the CFSR
register and every time different flag was raised. I have noticed that out of three flags, such as IBUSERR
, IACCVOIL
, and INVSTATE
, one of them was raised. I have not included the full main.c file.
LPUART FSM implementation is as follow: lpuart.h file
#ifndef INC_LPUART_H_
#define INC_LPUART_H_
#include "ring_buffer.h"
#ifdef USE_FULL_ASSERT
#include "stm32_assert.h"
#else
#define assert_param(expr) ((void)0U)
#endif /* USE_FULL_ASSERT */
uint8_t lpuart_start_tx(uint8_t* buff, uint16_t len );
uint8_t LPUART_isTxFinished(void);
void LPUART_clear_tx_finishedFlag();
uint8_t lpuart_isRxBusy(void);
uint8_t lpuart_isTxBusy(void);
void lpuart_task();
void LPUART_TX_TC_ISR_CALLBACK(void);
void LPUART_DMA_TX_TC_CALLBACK(void);
void LPUART_DMA_RX_TC_CALLBACK(void);
#endif /* INC_LPUART_H_ */
lpuart.c
#include "lpuart.h"
#include "string.h"
#include "stm32g4xx_ll_lpuart.h"
#include "stm32g4xx_ll_dma.h"
#define SIZE_TX_BUFF 256
#define SIZE_RX_BUFF 256
#define SIZE_DMA_RX_BUFF 64
static uint8_t rxBuf[SIZE_RX_BUFF];
static uint8_t rxDMA_Buf[SIZE_DMA_RX_BUFF];
static uint8_t txBuf[SIZE_TX_BUFF];
RingBuffer lpuart_RX_ring_buff;
static uint8_t* tempTxBuf;
static uint16_t txLen = 0;
static void setTxDataLengthDMA(uint16_t len);
static void lpuart_transmit();
static void lpuart_finished_tx();
static void no_action();
static void lpuart_rx();
static void check_rx_dma_buff();
static uint8_t ev_no_event(void);
static uint8_t ev_txtc(void);
static uint8_t ev_start_tx(void);
static uint8_t ev_dmatxtc(void);
static uint8_t ev_rx_read(void);
static uint8_t ev_buff_full(void);
typedef uint8_t (*t_event_func)(void);
typedef void(*t_action_func)(void);
typedef struct{
uint16_t txtc:1;
uint16_t tx_busy:1;
uint16_t dmatxtc:1;
uint16_t dmarxtc:1;
uint16_t start_tx:1;
uint16_t rx_read:1;
uint16_t buff_full:1;
uint16_t is_fsm_table_init:1;
uint16_t ext_rxBusyFlag:1;
}t_event;
typedef enum {INIT, READY, BUSY, COMPLETE, LPUART_ERROR}t_state;
typedef struct{
t_state present_state;
t_event_func event1;
t_event_func event2;
t_action_func action1;
t_action_func action2;
t_state next_state;
}t_fsm_row;
typedef struct{
t_state current_state;
t_state previous_state;
t_fsm_row stt_row[7];
uint16_t number_of_rows;
}t_fsm_table;
t_event lpuart_event;
uint8_t lpuart_isTxBusy(void){
return lpuart_event.tx_busy;
}
uint8_t lpuart_isRxBusy(){
return lpuart_event.ext_rxBusyFlag;
}
uint8_t ev_no_event(void){
return 1;
}
uint8_t ev_txtc(void){
return lpuart_event.txtc;
}
uint8_t ev_start_tx(void){
return lpuart_event.start_tx;
}
uint8_t ev_dmatxtc(void){
return lpuart_event.dmatxtc;
}
uint8_t ev_rx_read(void){
return lpuart_event.rx_read || lpuart_event.dmarxtc;
}
uint8_t ev_buff_full(void){
return lpuart_event.buff_full;
}
void no_action(){
return;
}
void lpuart_init(void){
memset(rxBuf, 0, (size_t)SIZE_RX_BUFF );
memset(rxDMA_Buf, 0, (size_t)SIZE_DMA_RX_BUFF );
memset(txBuf, 0, (size_t)SIZE_TX_BUFF );
RingBuffer_init(&lpuart_RX_ring_buff,rxBuf , (uint16_t)SIZE_RX_BUFF);
LL_LPUART_DisableIT_TC(LPUART1);
LL_LPUART_DisableIT_RXNE_RXFNE(LPUART1);
LL_LPUART_DisableDirectionRx(LPUART1);
LL_DMA_DisableIT_TC(DMA1, LL_DMA_CHANNEL_1); //tx
LL_DMA_DisableChannel(DMA1, LL_DMA_CHANNEL_1); //tx
LL_DMA_DisableIT_TC(DMA1, LL_DMA_CHANNEL_2); //rx
LL_DMA_DisableChannel(DMA1, LL_DMA_CHANNEL_2); //rx
/*TX buffer address attached to DMA channel1 */
LL_DMA_ConfigAddresses(DMA1, LL_DMA_CHANNEL_1,
(uint32_t)txBuf,
LL_LPUART_DMA_GetRegAddr(LPUART1, LL_LPUART_DMA_REG_DATA_TRANSMIT),
LL_DMA_GetDataTransferDirection(DMA1, LL_DMA_CHANNEL_1));
LL_DMA_SetDataLength(DMA1, LL_DMA_CHANNEL_1, SIZE_TX_BUFF);
/*RX buffer address attached to DMA channel2 */
LL_DMA_ConfigAddresses(DMA1, LL_DMA_CHANNEL_2,
LL_LPUART_DMA_GetRegAddr(LPUART1, LL_LPUART_DMA_REG_DATA_RECEIVE),
(uint32_t)rxDMA_Buf,
LL_DMA_GetDataTransferDirection(DMA1, LL_DMA_CHANNEL_2));
LL_DMA_SetDataLength(DMA1, LL_DMA_CHANNEL_2, SIZE_DMA_RX_BUFF);
LL_LPUART_EnableDMAReq_RX(LPUART1);
LL_DMA_EnableIT_TC(DMA1, LL_DMA_CHANNEL_2); //rx
LL_DMA_EnableIT_TE(DMA1, LL_DMA_CHANNEL_2);
LL_DMA_EnableChannel(DMA1, LL_DMA_CHANNEL_2); //rx
LL_LPUART_EnableDirectionRx(LPUART1);
lpuart_event.tx_busy = 0;
}
uint8_t lpuart_start_tx(uint8_t* buff, uint16_t len ){
if(!lpuart_event.tx_busy){
lpuart_event.tx_busy = 1;
if(len < SIZE_TX_BUFF){
lpuart_event.start_tx = 1;
tempTxBuf = buff;
txLen = len;
}else{
/* lpuart_event.start_tx = 0;
lpuart_event.buff_full = 1;*/
return 0;
}
return 1;
}else{
return 0;
}
}
void lpuart_transmit(){
memcpy(txBuf, tempTxBuf, txLen);
setTxDataLengthDMA(txLen);
LL_LPUART_EnableDMAReq_TX(LPUART1);
LL_LPUART_EnableDirectionTx(LPUART1);
LL_LPUART_EnableIT_TC(LPUART1);
LL_DMA_EnableIT_TC(DMA1, LL_DMA_CHANNEL_1);
LL_DMA_EnableIT_TE(DMA1, LL_DMA_CHANNEL_1);
LL_DMA_EnableChannel(DMA1, LL_DMA_CHANNEL_1);
}
void lpuart_finished_tx(){
LL_LPUART_DisableIT_TC(LPUART1);
LL_LPUART_DisableDirectionTx(LPUART1);
LL_DMA_DisableIT_TC(DMA1, LL_DMA_CHANNEL_1);
LL_DMA_DisableIT_TE(DMA1, LL_DMA_CHANNEL_1);
LL_DMA_DisableChannel(DMA1, LL_DMA_CHANNEL_1);
lpuart_event.txtc = 0;
lpuart_event.dmatxtc = 0;
lpuart_event.start_tx = 0;
lpuart_event.tx_busy = 0;
}
void setTxDataLengthDMA(uint16_t len){
LL_LPUART_DisableDirectionTx(LPUART1);
LL_DMA_DisableChannel(DMA1, LL_DMA_CHANNEL_1);
/* Clear all flags */
LL_DMA_ClearFlag_TC1(DMA1);
LL_DMA_ClearFlag_TE1(DMA1);
LL_DMA_SetDataLength(DMA1, LL_DMA_CHANNEL_1, len);
}
void check_rx_dma_buff(){
static uint16_t old_len = SIZE_DMA_RX_BUFF;
uint16_t current_len = LL_DMA_GetDataLength(DMA1, LL_DMA_CHANNEL_2);
if(old_len != current_len ){
if(current_len > 0){
lpuart_event.rx_read = 1;
}
}
old_len = current_len;
}
static uint16_t old_pos = 0;
uint16_t pos = 0;
void lpuart_rx(){
lpuart_event.ext_rxBusyFlag = 1;
if(lpuart_event.dmarxtc){
lpuart_event.dmarxtc = 0;
}
if(lpuart_event.rx_read){
lpuart_event.rx_read = 0;
}
pos = (uint16_t)SIZE_DMA_RX_BUFF - LL_DMA_GetDataLength(DMA1, LL_DMA_CHANNEL_2);
if(pos > SIZE_DMA_RX_BUFF ){
pos = SIZE_DMA_RX_BUFF;
}
if(pos != old_pos /* || (pos == 0 && old_pos == 0)*/){
if (pos > old_pos) {
RingBuffer_writeMeasBlock(&lpuart_RX_ring_buff,&rxDMA_Buf[old_pos],(pos - old_pos));
}else{
RingBuffer_writeMeasBlock(&lpuart_RX_ring_buff,&rxDMA_Buf[old_pos],((uint16_t)SIZE_DMA_RX_BUFF - old_pos));
if(pos > 0){
RingBuffer_writeMeasBlock(&lpuart_RX_ring_buff,&rxDMA_Buf[0],pos);
}
}
}
old_pos = pos;
lpuart_event.ext_rxBusyFlag = 0;
}
t_fsm_row rowInit = {INIT,ev_no_event, ev_no_event, lpuart_init, no_action, READY };
t_fsm_row rowReady = {READY,ev_start_tx, ev_no_event, lpuart_transmit, no_action, BUSY };
t_fsm_row rowBusy = {BUSY,ev_dmatxtc, ev_txtc, lpuart_finished_tx, no_action, READY};
t_fsm_table lpuart_fsm_table = {INIT,INIT, {}};
void fsm_table_init(){
lpuart_fsm_table.current_state = INIT;
lpuart_fsm_table.stt_row[0] = rowInit;
lpuart_fsm_table.stt_row[1] = rowReady;
lpuart_fsm_table.stt_row[2] = rowBusy;
lpuart_event.is_fsm_table_init = 1;
lpuart_fsm_table.number_of_rows = 3;
}
void lpuar_tx_fsm(){
uint8_t ev = 0;
for(uint16_t rowIndex = 0; rowIndex < lpuart_fsm_table.number_of_rows; rowIndex++){
if(lpuart_fsm_table.current_state == lpuart_fsm_table.stt_row[rowIndex].present_state){
ev = lpuart_fsm_table.stt_row[rowIndex].event1() && lpuart_fsm_table.stt_row[rowIndex].event2();
if(ev){
lpuart_fsm_table.stt_row[rowIndex].action1();
lpuart_fsm_table.stt_row[rowIndex].action2();
lpuart_fsm_table.current_state = lpuart_fsm_table.stt_row[rowIndex].next_state;
lpuart_fsm_table.previous_state = lpuart_fsm_table.stt_row[rowIndex].present_state;
}
}
}
}
void lpuar_read_task(){
check_rx_dma_buff();
if(ev_rx_read()){
lpuart_rx();
}
}
void lpuart_task(){
if(!lpuart_event.is_fsm_table_init){
fsm_table_init();
}
//else{
lpuar_tx_fsm();
lpuar_read_task();
//}
}
void LPUART_TX_TC_ISR_CALLBACK(void){
lpuart_event.txtc = 1;
LL_LPUART_ClearFlag_TC(LPUART1);
}
void LPUART_DMA_TX_TC_CALLBACK(void){
lpuart_event.dmatxtc = 1;
LL_DMA_ClearFlag_TC1(DMA1);
}
void LPUART_DMA_RX_TC_CALLBACK(void){
if(LL_DMA_IsActiveFlag_TC2(DMA1)){
LL_DMA_ClearFlag_TC2(DMA1);
lpuart_event.dmarxtc = 1;
lpuart_rx();
}
if(LL_DMA_IsActiveFlag_TE2(DMA1)){
LL_DMA_ClearFlag_TE2(DMA1);
}
}
Intrrupt routine file stm32g4xx_it.c:
/* Includes ------------------------------------------------------------------*/
#include "main.h"
#include "stm32g4xx_it.h"
#include "lpuart.h"
extern _func_clbck lpuart_tx_tc_isr_clback;
//_func_clbck lpuart_rx_rne_isr_clback = LPUART_RX_RXNE_ISR_CALLBACK;
extern _func_clbck lpuart_dma_tx_tc_isr_clback;
extern _func_clbck lpuart_dma_rx_tc_isr_clback;
void HardFault_Handler(void)
{
/* USER CODE BEGIN HardFault_IRQn 0 */
/* USER CODE END HardFault_IRQn 0 */
while (1)
{
/* USER CODE BEGIN W1_HardFault_IRQn 0 */
/* USER CODE END W1_HardFault_IRQn 0 */
}
}
void DMA1_Channel2_IRQHandler(void)
{
/* USER CODE BEGIN DMA1_Channel2_IRQn 0 */
lpuart_dma_rx_tc_isr_clback();
//LPUART_DMA_RX_TC_CALLBACK();
/* USER CODE END DMA1_Channel2_IRQn 0 */
/* USER CODE BEGIN DMA1_Channel2_IRQn 1 */
/* USER CODE END DMA1_Channel2_IRQn 1 */
}
Some of the code I have ommitted here. I am sure that I have not fully understood how function pointers work. Could you please give me suggestions or a solution.
I am using: language: C11 Compiler/build tools: GNU tools for STM32 (7-2018-q2-update) IDE: STM32CubeIDE
Please let me know if you require more info. Thanks in advance.
ANSWER
Answered 2022-Feb-17 at 07:53As per @Lundin's suggestion, I have put a watchpoint on lpuart_dma_rx_tc_isr_clback
function pointer variable. It exposed the out of index bug in my code. The bug is inside while loop in main.c.
rxIndex = RingBuffer_available(&lpuart_RX_ring_buff);
for(i = rxOldIndex ; i < (rxIndex+rxOldIndex) ; i++ ){
rxBuff[i] = RingBuffer_readMeas(&lpuart_RX_ring_buff);
....
}
It was also pointed out that function pointer variable shouldn't be in flash.
QUESTION
I just did a fresh install of windows to clean up my computer, moved everything over to my D drive and installed Python through Windows Store (somehow it defaulted to my C drive, so I left it there because Pycharm was getting confused about its location), now I'm trying to pip install the python-docx module for the first time and I'm stuck. I have a recent version of Microsoft C++ Visual Build Tools installed. Excuse me for any irrelevant information I provided, just wishing to be thorough. Here's what's returning in command:
.>pip install python-docx
Collecting python-docx
Using cached python-docx-0.8.11.tar.gz (5.6 MB)
Preparing metadata (setup.py) ... done
Collecting lxml>=2.3.2
Using cached lxml-4.6.3.tar.gz (3.2 MB)
Preparing metadata (setup.py) ... done
Using legacy 'setup.py install' for python-docx, since package 'wheel' is not installed.
Using legacy 'setup.py install' for lxml, since package 'wheel' is not installed.
Installing collected packages: lxml, python-docx
Running setup.py install for lxml ... error
ERROR: Command errored out with exit status 1:
command: 'C:\Users\cahez\AppData\Local\Microsoft\WindowsApps\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\python.exe' -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\cahez\\AppData\\Local\\Temp\\pip-install-8rz9vrlv\\lxml_69e9fa188fd042d6953641882e4b3a17\\setup.py'"'"'; __file__='"'"'C:\\Users\\cahez\\AppData\\Local\\Temp\\pip-install-8rz9vrlv\\lxml_69e9fa188fd042d6953641882e4b3a17\\setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record 'C:\Users\cahez\AppData\Local\Temp\pip-record-xpg_v_i_\install-record.txt' --single-version-externally-managed --user --prefix= --compile --install-headers 'C:\Users\cahez\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\Include\lxml'
cwd: C:\Users\cahez\AppData\Local\Temp\pip-install-8rz9vrlv\lxml_69e9fa188fd042d6953641882e4b3a17\
Complete output (76 lines):
Building lxml version 4.6.3.
Building without Cython.
Building against pre-built libxml2 andl libxslt libraries
running install
C:\Users\cahez\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\setuptools\command\install.py:34: SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build and pip and other standards-based tools.
warnings.warn(
running build
running build_py
creating build
creating build\lib.win-amd64-3.10
creating build\lib.win-amd64-3.10\lxml
copying src\lxml\builder.py -> build\lib.win-amd64-3.10\lxml
copying src\lxml\cssselect.py -> build\lib.win-amd64-3.10\lxml
copying src\lxml\doctestcompare.py -> build\lib.win-amd64-3.10\lxml
copying src\lxml\ElementInclude.py -> build\lib.win-amd64-3.10\lxml
copying src\lxml\pyclasslookup.py -> build\lib.win-amd64-3.10\lxml
copying src\lxml\sax.py -> build\lib.win-amd64-3.10\lxml
copying src\lxml\usedoctest.py -> build\lib.win-amd64-3.10\lxml
copying src\lxml\_elementpath.py -> build\lib.win-amd64-3.10\lxml
copying src\lxml\__init__.py -> build\lib.win-amd64-3.10\lxml
creating build\lib.win-amd64-3.10\lxml\includes
copying src\lxml\includes\__init__.py -> build\lib.win-amd64-3.10\lxml\includes
creating build\lib.win-amd64-3.10\lxml\html
copying src\lxml\html\builder.py -> build\lib.win-amd64-3.10\lxml\html
copying src\lxml\html\clean.py -> build\lib.win-amd64-3.10\lxml\html
copying src\lxml\html\defs.py -> build\lib.win-amd64-3.10\lxml\html
copying src\lxml\html\diff.py -> build\lib.win-amd64-3.10\lxml\html
copying src\lxml\html\ElementSoup.py -> build\lib.win-amd64-3.10\lxml\html
copying src\lxml\html\formfill.py -> build\lib.win-amd64-3.10\lxml\html
copying src\lxml\html\html5parser.py -> build\lib.win-amd64-3.10\lxml\html
copying src\lxml\html\soupparser.py -> build\lib.win-amd64-3.10\lxml\html
copying src\lxml\html\usedoctest.py -> build\lib.win-amd64-3.10\lxml\html
copying src\lxml\html\_diffcommand.py -> build\lib.win-amd64-3.10\lxml\html
copying src\lxml\html\_html5builder.py -> build\lib.win-amd64-3.10\lxml\html
copying src\lxml\html\_setmixin.py -> build\lib.win-amd64-3.10\lxml\html
copying src\lxml\html\__init__.py -> build\lib.win-amd64-3.10\lxml\html
creating build\lib.win-amd64-3.10\lxml\isoschematron
copying src\lxml\isoschematron\__init__.py -> build\lib.win-amd64-3.10\lxml\isoschematron
copying src\lxml\etree.h -> build\lib.win-amd64-3.10\lxml
copying src\lxml\etree_api.h -> build\lib.win-amd64-3.10\lxml
copying src\lxml\lxml.etree.h -> build\lib.win-amd64-3.10\lxml
copying src\lxml\lxml.etree_api.h -> build\lib.win-amd64-3.10\lxml
copying src\lxml\includes\c14n.pxd -> build\lib.win-amd64-3.10\lxml\includes
copying src\lxml\includes\config.pxd -> build\lib.win-amd64-3.10\lxml\includes
copying src\lxml\includes\dtdvalid.pxd -> build\lib.win-amd64-3.10\lxml\includes
copying src\lxml\includes\etreepublic.pxd -> build\lib.win-amd64-3.10\lxml\includes
copying src\lxml\includes\htmlparser.pxd -> build\lib.win-amd64-3.10\lxml\includes
copying src\lxml\includes\relaxng.pxd -> build\lib.win-amd64-3.10\lxml\includes
copying src\lxml\includes\schematron.pxd -> build\lib.win-amd64-3.10\lxml\includes
copying src\lxml\includes\tree.pxd -> build\lib.win-amd64-3.10\lxml\includes
copying src\lxml\includes\uri.pxd -> build\lib.win-amd64-3.10\lxml\includes
copying src\lxml\includes\xinclude.pxd -> build\lib.win-amd64-3.10\lxml\includes
copying src\lxml\includes\xmlerror.pxd -> build\lib.win-amd64-3.10\lxml\includes
copying src\lxml\includes\xmlparser.pxd -> build\lib.win-amd64-3.10\lxml\includes
copying src\lxml\includes\xmlschema.pxd -> build\lib.win-amd64-3.10\lxml\includes
copying src\lxml\includes\xpath.pxd -> build\lib.win-amd64-3.10\lxml\includes
copying src\lxml\includes\xslt.pxd -> build\lib.win-amd64-3.10\lxml\includes
copying src\lxml\includes\__init__.pxd -> build\lib.win-amd64-3.10\lxml\includes
copying src\lxml\includes\etree_defs.h -> build\lib.win-amd64-3.10\lxml\includes
copying src\lxml\includes\lxml-version.h -> build\lib.win-amd64-3.10\lxml\includes
creating build\lib.win-amd64-3.10\lxml\isoschematron\resources
creating build\lib.win-amd64-3.10\lxml\isoschematron\resources\rng
copying src\lxml\isoschematron\resources\rng\iso-schematron.rng -> build\lib.win-amd64-3.10\lxml\isoschematron\resources\rng
creating build\lib.win-amd64-3.10\lxml\isoschematron\resources\xsl
copying src\lxml\isoschematron\resources\xsl\RNG2Schtrn.xsl -> build\lib.win-amd64-3.10\lxml\isoschematron\resources\xsl
copying src\lxml\isoschematron\resources\xsl\XSD2Schtrn.xsl -> build\lib.win-amd64-3.10\lxml\isoschematron\resources\xsl
creating build\lib.win-amd64-3.10\lxml\isoschematron\resources\xsl\iso-schematron-xslt1
copying src\lxml\isoschematron\resources\xsl\iso-schematron-xslt1\iso_abstract_expand.xsl -> build\lib.win-amd64-3.10\lxml\isoschematron\resources\xsl\iso-schematron-xslt1
copying src\lxml\isoschematron\resources\xsl\iso-schematron-xslt1\iso_dsdl_include.xsl -> build\lib.win-amd64-3.10\lxml\isoschematron\resources\xsl\iso-schematron-xslt1
copying src\lxml\isoschematron\resources\xsl\iso-schematron-xslt1\iso_schematron_message.xsl -> build\lib.win-amd64-3.10\lxml\isoschematron\resources\xsl\iso-schematron-xslt1
copying src\lxml\isoschematron\resources\xsl\iso-schematron-xslt1\iso_schematron_skeleton_for_xslt1.xsl -> build\lib.win-amd64-3.10\lxml\isoschematron\resources\xsl\iso-schematron-xslt1
copying src\lxml\isoschematron\resources\xsl\iso-schematron-xslt1\iso_svrl_for_xslt1.xsl -> build\lib.win-amd64-3.10\lxml\isoschematron\resources\xsl\iso-schematron-xslt1
copying src\lxml\isoschematron\resources\xsl\iso-schematron-xslt1\readme.txt -> build\lib.win-amd64-3.10\lxml\isoschematron\resources\xsl\iso-schematron-xslt1
running build_ext
building 'lxml.etree' extension
error: Microsoft Visual C++ 14.0 or greater is required. Get it with "Microsoft C++ Build Tools": https://visualstudio.microsoft.com/visual-cpp-build-tools/
----------------------------------------
ERROR: Command errored out with exit status 1: 'C:\Users\cahez\AppData\Local\Microsoft\WindowsApps\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\python.exe' -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\cahez\\AppData\\Local\\Temp\\pip-install-8rz9vrlv\\lxml_69e9fa188fd042d6953641882e4b3a17\\setup.py'"'"'; __file__='"'"'C:\\Users\\cahez\\AppData\\Local\\Temp\\pip-install-8rz9vrlv\\lxml_69e9fa188fd042d6953641882e4b3a17\\setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record 'C:\Users\cahez\AppData\Local\Temp\pip-record-xpg_v_i_\install-record.txt' --single-version-externally-managed --user --prefix= --compile --install-headers 'C:\Users\cahez\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\Include\lxml' Check the logs for full command output.
ANSWER
Answered 2022-Feb-06 at 17:04One of the dependencies for python-docx
is lxml
. The latest stable version of lxml
is 4.6.3, released on March 21, 2021. On PyPI there is no lxml wheel for 3.10, yet. So it try to compile from source and for that Microsoft Visual C++ 14.0 or greater is required, as stated in the error.
However you can manually install lxml
, before install python-docx
. Download and install unofficial binary from Gohlke Alternatively you can use pipwin to install it from Gohlke. Note there may still be problems with dependencies for lxml
.
Of course, you can also downgrade to python3.9.
EDIT: As of 14 Dec 2021 the latest lxml version 4.7.1 supports python 3.10
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install Audio-Recording-Animation
You can use Audio-Recording-Animation like any standard Java library. Please include the the jar files in your classpath. You can also use any IDE and you can run and debug the Audio-Recording-Animation component as you would do with any other Java program. Best practice is to use a build tool that supports dependency management such as Maven or Gradle. For Maven installation, please refer maven.apache.org. For Gradle installation, please refer gradle.org .
Support
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesExplore Kits - Develop, implement, customize Projects, Custom Functions and Applications with kandi kits
Save this library and start creating your kit
Share this Page