Why the upgrade to Flutter v0.7.3 beta stopped my application from running? - crash

I have upgraded my Flutter version from 0.5.1 beta to 0.7.3 beta as few plugins were not working properly and I was suggested to upgrade to latest, both plugins and flutter itself. But, this has completely destroyed the application as it won't even start. Below is the Android Studio Run console output
Note: /Users/apple/development/flutter/.pub-cache/hosted/pub.dartlang.org/firebase_auth-0.5.20/android/src/main/java/io/flutter/plugins/firebaseauth/FirebaseAuthPlugin.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: /Users/apple/development/flutter/.pub-cache/hosted/pub.dartlang.org/firebase_auth-0.5.20/android/src/main/java/io/flutter/plugins/firebaseauth/FirebaseAuth.Plugin.java uses unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
Note: /Users/apple/development/flutter/.pub-cache/hosted/pub.dartlang.org/firebase_core-0.2.5/android/src/main/java/io/flutter/plugins/firebase/core/FirebaseCorePlugin.java uses unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
/Users/apple/development/flutter/.pub-cache/hosted/pub.dartlang.org/firebase_storage-1.0.2/android/src/main/java/io/flutter/plugins/firebase/storage/FirebaseStoragePlugin.java:293: warning: [unchecked] unchecked cast
Map<String, String> customMetadata = (Map<String, String>) map.get("customMetadata");
^
required: Map<String,String>
found: Object
1 warning
Note: /Users/apple/development/flutter/.pub-cache/hosted/pub.dartlang.org/image_picker_multiple-0.0.2/android/src/main/java/com/ruiyu/imagepickermultiple/TransparentActivity.java uses unchecked or unsafe operations.`
Note: Recompile with -Xlint:unchecked for details.
Note: /Users/apple/development/flutter/.pub-cache/hosted/pub.dartlang.org/video_player-0.6.5/android/src/main/java/io/flutter/plugins/videoplayer/VideoPlayerPlugin.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Built build/app/outputs/apk/debug/app-debug.apk.
Finished with error: NoSuchMethodError: The method 'allElements' was called on null.
Receiver: null
Tried calling: allElements("activity")
Below is the output from flutter doctor
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel beta, v0.7.3, on Mac OS X 10.13.6 17G65, locale en-US)
[!] Android toolchain - develop for Android devices (Android SDK 28.0.0)
! Some Android licenses not accepted. To resolve this, run: flutter doctor --android-licenses
[✓] iOS toolchain - develop for iOS devices (Xcode 9.4.1)
[✓] Android Studio (version 3.1)
[✓] Connected devices (1 available)
! Doctor found issues in 1 category.
Process finished with exit code 0
I am sure the allElements() is not dart or flutter code. It's an inside Java code, means a plugin or Flutter itself is broken.

I feel very embarrassed as it was my own doing which has brought this issue up. I finally fixed it by going to the Android manifest file and removed the offending
tools:replace="android:label"
which I had placed in the tag for whatever reason I don't know. Then I do..
flutter clean
Then Run the app works! Voila!

Related

How to modify Podfile in an Expo-Managed React Native project

I have implemented an app that uses react-native-branch and #config-plugins/react-native-branch with the expo-managed workflow but upon building with EAS in iOS (Expo Application Services), its throwing this error:
The Swift pod `ExpoAdapterBranch` depends upon `react-native-branch`, which does not define modules.
To opt into those targets generating module maps (which is necessary to import them from Swift when building as static libraries),
you may set `use_modular_headers!` globally in your Podfile, or specify `:modular_headers => true` for particular dependencies.
Is there a way to do this in expo-managed workflow?
Other details of our project:
Expo SDK: v44
react-native-branch: v5.0.0
#config-plugins/react-native-branch: v1.0.2
I finally get it to build in iOS without errors by updating my react-native-branch version from 5.0.0 to 5.4.0 without any other changes to the plugin. However, expo is now giving off a warning saying that
Some dependencies are incompatible with the installed expo package version:
- react-native-branch - expected version: 5.0.0 - actual version installed: 5.4.0
If anyone has a better solution to this, I would gladly hear it. Thanks!

Implicit PendingIntent Vulnerability error from Google Play Store

Problem Describe:
Recently, some developers have reported that they want to update their app(s) on Play Store,
However, it receives rejection from Google with the title Implicit PendingIntent Vulnerability, said that their app(s) contain an Implicit PendingIntent issue. And they need to fix this issue before the deadlines shown in their Play Console, or app(s) may be removed from Google Play.
Similar Question: Google denied update due Remediation for Implicit PendingIntent Vulnerability
As#tao mentioned, let me post the solution here.
Problem Reason:
HMS Core Push kit earlier than 5.3.0.304 version、Analytics Kit earlier than 6.0.0.301 version and Account kit earlier than 5.3.0.305 version contain the Implicit PendingIntent issue.
Solution:
Push Kit SDK version 5.3.0.304、Analytics Kit SDK version 6.0.0.301 and
Account kit SDK version 5.3.0.305 have been released and fixed the Implicit PendingIntent issue. They've been tested and verified by developers and can be approved by Google for release.
If you are currently using the plug-in(such as React Native, Cordova, Ionic,Flutter), Before the new version of those plug-in released, Huawei also provide a workaround solution(By manually changing the version number).
The following describes the modification method (based on the 5.x plug-in):
React Native:
After the HMS Core plug-in is installed in the RN, the plug-in package is stored in node_modules/#hmscore.
You need to modify the build.gradle file in the node_modules/#hmscore/react-native-hms-account/android directory (taking the Account Kit plug-in as an example):
Open the build.gradle file and change the SDK version in dependencies.
dependencies {
implementation fileTree(dir: "libs", include: ["*.jar"])
implementation 'com.facebook.react:react-native:+' // From node_modules
implementation 'com.huawei.hms:hwid:5.0.3.302'
}
After the update, run the following command to start compilation again. The plug-in downloads the new SDK:
react-native run-android
Cordova/Ionic
If you have installed the plugin as Huawei document describred, the plugin should be saved in node_modules/#hmscore folder.
You need to modify the plugin.xml file in the node_modules/#hmscore/cordova-plugin-hms-push directory. (The following uses the Push Kit plug-in as an example)
Open the Plugin.xml file, search for the keyword framework, and find the SDK to be modified.
<framework src="androidx.core:core:1.3.1"/>
<framework src="com.facebook.fresco:fresco:2.2.0"/>
<framework src="com.huawei.hms:push:5.0.2.301" />
<framework src="resources/plugin.gradle" custom="true" type="gradleReference"/>
Change the version number to the new one and save it.
Go back to the application root directory and delete the platforms/android and plugins/cordova-plugin-hms-push folder.
Run the following command in the root directory:
Cordova:
cordova platform add android
cordova run android --device
Ionic(Cordova):
ionic cordova platform add android
ionic build
ionic cordova run android --device
Ionic (Capacitor) operates in different ways:
①. Delete the capacitor-cordova-android-plugins folder from the android directory.
②. Modify the plugin.xml file according to the description in step 2.
③. Run the following command:
ionic build
npx cap sync
npx cap open android
④. Recompile in the Android Studio
Flutter
You may refer to this answer.
Summary
The plug-ins above are used in open source mode, so developers can modify them directly.
However, the Xamarin plug-in is published in Nuget Package mode. Therefore, you cannot modify the SDK version. If this problem occurs, please feel free to contact us.

How to use titanium inspector using titanium 5.2.2?

I am using Appcelerator titanium CLI to build ios app. I want to debug the app With Chrome DevTools but it seems like it's not compatible with the version which I have installed currently.
As per ti-inspector documentation, I have installed the node package by the below command.
npm install -g ti-inspector
So, When I tried this into my titanium project directory I am getting this response which is unexpected.
tn-inspector
Unexpected error: undefined
NOTE: titanium version - 5.2.2
Useful GitHub link: https://github.com/omorandi/TiInspector
Need help to understand or mitigate this issue. Thanks in advance!!!.
That repo is 5 years old and might not be compatible with the current SDK. You can use this instruction: https://docs.axway.com/bundle/Appcelerator_Studio_allOS_en/page/debugging_android_apps_with_3rd-party_tools.html to use the internal dev tools connection.

Build failure: React Native Android

I am setting up my environment to start developing react native apps. I keep getting the following error:
PS C:\map\development\learnreact\react-native\helloworld> react-native
run-android Starting JS server... Building and installing the app on
the device (cd android && gradlew.bat installDebug)...
Configure project :app Observed package id 'platform-tools' in inconsistent location
'C:\Users\bheka\AppData\Local\Android\Sdk\platform-tools' (Expected
'C:\Users\bheka\AppData\Local\Android\Sdk\platform-tools\platform-tools')
Checking the license for package Android SDK Build-Tools 27.0.3 in
C:\Users\bheka\AppData\Local\Android\Sdk\platform-tools\licenses
Warning: License for package Android SDK Build-Tools 27.0.3 not
accepted. Checking the license for package Android SDK Platform 26 in
C:\Users\bheka\AppData\Local\Android\Sdk\platform-tools\licenses
Warning: License for package Android SDK Platform 26 not accepted.
FAILURE: Build failed with an exception.
What went wrong: A problem occurred configuring project ':app'.
Failed to install the following Android SDK packages as some licences have not been accepted.
platforms;android-26 Android SDK Platform 26
build-tools;27.0.3 Android SDK Build-Tools 27.0.3 To build this project, accept the SDK license agreements and install the missing
components using the Android Studio SDK Manager. Alternatively, to
transfer the license agreements from one workstation to another, see
http://d.android.com/r/studio-ui/export-licenses.html Using Android
SDK: C:\Users\bheka\AppData\Local\Android\Sdk\platform-tools
Try: Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
Get more help at https://help.gradle.org
BUILD FAILED in 2s Could not install the app on the device, read the
error above for details. Make sure you have an Android emulator
running or a device connected and have set up your Android development
environment:
https://facebook.github.io/react-native/docs/getting-started.html
I have accepted licenses using .\sdkmanager --licenses but no luck. I have reinstalled the sdk using the sdk manager in android studio with no luck. Anyone know what I should do?
Make sure the sdkbuildtools used by Android Studio and your emulator are the same as the ones in your build.gradle file in your project folder. If they do not match then either change the build.gradle file to use the installed sdk version. What probably happened is you have sdk 27 used by your android studio and your rn project tried to build it using sdk 26. Accepting the license will not change anything because while it's accepted it is still not used by your emulator and you Android Studio.
Hope that helps!
I had similar issue and was resolved by fixing environment variable, ANDROID_SDK_ROOT. It was previously pointing to .../sdk/platform-tools/ and later worked by changing it to .../sdk

Dart SDK version error when getting dependencies

I'm trying to add the http and image Dart packages. After adding the dependencies in pubspec.yaml and attempt to "Get dependencies", I'm getting the version error.
I have attempted "Check for Update" in IntelliJ, reinstall Flutter and Dart plug in in IntelliJ, redownload Flutter, and ran "flutter upgrade" in Flutter Console, with no luck. It seems the Dart SDK that comes with Flutter has not been updated.
I was able to download later version of Dart SDK independently, but if I just drop the dart-sdk folder of a newer version into the Flutter folder, I get more error still.
How can I update the Dart SDK in the Flutter package, so I can add dependencies?
The reason was flutter console being in the beta channel, causing flutter to not upgrade to latest version. Fix was flutter channel dev then flutter upgrade in console.