Closed JarikH closed 5 years ago
What about
> Configure project :app
google-services plugin could not detect any version for com.google.android.gms or
com.google.firebase, default version: 11.4.2 will be used.
please apply google-services plugin at the bottom of the build file.
Could not find google-services.json while looking in [src/nullnull/debug, src/debug/nullnull,
src/nullnull, src/debug, src/nullnullDebug]
registerResGeneratingTask is deprecated, use registerGeneratedResFolders(FileCollection)
Could not find google-services.json while looking in [src/nullnull/dynamicProfile,
src/dynamicProfile/nullnull, src/nullnull, src/dynamicProfile, src/nullnullDynamicProfile]
registerResGeneratingTask is deprecated, use registerGeneratedResFolders(FileCollection)
Could not find google-services.json while looking in [src/nullnull/release, src/release/nullnull,
src/nullnull, src/release, src/nullnullRelease]
registerResGeneratingTask is deprecated, use registerGeneratedResFolders(FileCollection)
Could not find google-services.json while looking in [src/nullnull/profile, src/profile/nullnull,
src/nullnull, src/profile, src/nullnullProfile]
registerResGeneratingTask is deprecated, use registerGeneratedResFolders(FileCollection)
Could not find google-services.json while looking in [src/nullnull/dynamicRelease,
src/dynamicRelease/nullnull, src/nullnull, src/dynamicRelease, src/nullnullDynamicRelease]
registerResGeneratingTask is deprecated, use registerGeneratedResFolders(FileCollection)
?
@JarikH You said it crashed, please paste the full crash log from logcat(Android perspective).
Without additional information, we are unfortunately not sure how to resolve this issue. We are therefore reluctantly going to close this bug for now. Please don't hesitate to comment on the bug if you have any more information for us; we will reopen it right away! Thanks for your contribution.
Hello,
I have the very similar issue. Adding url_launcher
(I was testing with 5.0.2) makes application to crash on start. Splash screen just blinks and there is nothing more. On the flutter console there is only
[ ] Waiting for observatory port to be available...
forever - because the app was killed due to exception. Here are logs flutter_run_verbose.log
and logcat.log
of my application. psychox.aquariumcontroller_mobile
is the name of the app package.
There is most important fragment:
05-21 21:13:58.223 24431 24431 E AndroidRuntime: FATAL EXCEPTION: main
05-21 21:13:58.223 24431 24431 E AndroidRuntime: Process: psychox.aquariumcontroller_mobile, PID: 24431
05-21 21:13:58.223 24431 24431 E AndroidRuntime: java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{psychox.aquariumcontroller_mobile/psychox.aquariumcontroller_mobile.MainActivity}: java.lang.ClassNotFoundException: Didn't find class "psychox.aquariumcontroller_mobile.MainActivity" on path: DexPathList[[zip file "/data/app/psychox.aquariumcontroller_mobile-7UXAVbhyRYw-siG7WQKvUQ==/base.apk"],nativeLibraryDirectories=[/data/app/psychox.aquariumcontroller_mobile-7UXAVbhyRYw-siG7WQKvUQ==/lib/arm64, /data/app/psychox.aquariumcontroller_mobile-7UXAVbhyRYw-siG7WQKvUQ==/base.apk!/lib/arm64-v8a, /system/lib64, /vendor/lib64, /product/lib64]]
05-21 21:13:58.223 24431 24431 E AndroidRuntime: at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3201)
05-21 21:13:58.223 24431 24431 E AndroidRuntime: at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3411)
05-21 21:13:58.223 24431 24431 E AndroidRuntime: at android.app.ActivityThread.-wrap12(Unknown Source:0)
05-21 21:13:58.223 24431 24431 E AndroidRuntime: at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1994)
05-21 21:13:58.223 24431 24431 E AndroidRuntime: at android.os.Handler.dispatchMessage(Handler.java:108)
05-21 21:13:58.223 24431 24431 E AndroidRuntime: at android.os.Looper.loop(Looper.java:166)
05-21 21:13:58.223 24431 24431 E AndroidRuntime: at android.app.ActivityThread.main(ActivityThread.java:7529)
05-21 21:13:58.223 24431 24431 E AndroidRuntime: at java.lang.reflect.Method.invoke(Native Method)
05-21 21:13:58.223 24431 24431 E AndroidRuntime: at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:245)
05-21 21:13:58.223 24431 24431 E AndroidRuntime: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:921)
05-21 21:13:58.223 24431 24431 E AndroidRuntime: Caused by: java.lang.ClassNotFoundException: Didn't find class "psychox.aquariumcontroller_mobile.MainActivity" on path: DexPathList[[zip file "/data/app/psychox.aquariumcontroller_mobile-7UXAVbhyRYw-siG7WQKvUQ==/base.apk"],nativeLibraryDirectories=[/data/app/psychox.aquariumcontroller_mobile-7UXAVbhyRYw-siG7WQKvUQ==/lib/arm64, /data/app/psychox.aquariumcontroller_mobile-7UXAVbhyRYw-siG7WQKvUQ==/base.apk!/lib/arm64-v8a, /system/lib64, /vendor/lib64, /product/lib64]]
05-21 21:13:58.223 24431 24431 E AndroidRuntime: at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:93)
05-21 21:13:58.223 24431 24431 E AndroidRuntime: at java.lang.ClassLoader.loadClass(ClassLoader.java:379)
05-21 21:13:58.223 24431 24431 E AndroidRuntime: at java.lang.ClassLoader.loadClass(ClassLoader.java:312)
05-21 21:13:58.223 24431 24431 E AndroidRuntime: at android.app.Instrumentation.newActivity(Instrumentation.java:1178)
05-21 21:13:58.223 24431 24431 E AndroidRuntime: at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3191)
05-21 21:13:58.223 24431 24431 E AndroidRuntime: ... 9 more
05-21 21:13:58.229 1144 5711 W ActivityManager: Force finishing activity psychox.aquariumcontroller_mobile/.MainActivity
As you can see, it seems url_launcher
somehow manages to prevent the activity from loading.
If only I remove the url_launcher
from pubspec.yaml
file, the application runs successfully, and there is no such exception.
Here is also my flutter doctor
:
[√] Flutter (Channel dev, v1.6.0, on Microsoft Windows [Version
10.0.17763.437], locale pl-PL)
• Flutter version 1.6.0 at C:\Libraries\flutter
• Framework revision ed90d05596 (7 days ago), 2019-05-14 17:09:29
-0700
• Engine revision 832cdacc6f
• Dart version 2.3.1 (build 2.3.1-dev.0.0 a0290f823c)
[!] Android toolchain - develop for Android devices (Android SDK
version 28.0.3)
• Android SDK at C:\Program Files (x86)\Android\android-sdk
• Android NDK location not configured (optional; useful for native
profiling support)
• Platform android-28, build-tools 28.0.3
• ANDROID_HOME = C:\Program Files (x86)\Android\android-sdk
• Java binary at: C:\Program Files (x86)\Common
Files\Oracle\Java\javapath\java.exe
• Java version Java(TM) SE Runtime Environment (build s
1.8.0_212-b10) s
! Some Android licenses not accepted. To resolve this, run:
flutter doctor --android-licenses s
[!] Android Studio (not installed) s
• Android Studio not found; download from
https://developer.android.com/studio/index.html
(or visit https://flutter.dev/setup/#android-setup for detailed
instructions).
[√] VS Code (version 1.34.0) • VS Code at C:\Users\Standard\AppData\Local\Programs\Microsoft VS
Code
• Flutter extension version 3.0.2
[√] Connected device (1 available)
• RNE L21 • 192.168.1.101:5555 • android-arm64 • Android 8.0.0 (API 26)
I can prepare simple as possible (empty?) example project later, since I don't have no more time for now.
Interesting - I created some basic example project (the auto-generated one with clicks counter) then added the url_launcher
- it works. Even simple test as opening some URL works.
So what could be wrong with my actual project? Where should look for more information?
Well, the apk
generated has no MainActivity
class while using url_launcher
.
On the other hand, apk
looks like below if url_launcher
isn't used:
What is going on?
Okay, I found problem with my project:
After changing package name make sure to change it everywhere including folder names!
I renamed every com.example.
to psychox.
, but I didn't notice the ./android/src/com/example/[...]
folder name. After changing it properly, in my case from /com/example/
to /psychox/
plugin(s), such as url_launcher
could be built with MainActivity
class.
I don't quite see why it is necessary only in case of using plugin(s) such as url_launcher
but... It solved the issue for me.
OMG, I was puzzled by this issue for days, this changing the example to my domain fixed it, for me. Weirdly codemagic build for android and ios always worked . what the hell.
a flutter clean did it for me :)
a flutter clean did it for me :)
This works like a charm!
@JarikH
This issue has been moved to https://github.com/FirebaseExtended/flutterfire/issues/521. Any further collaboration will be done there.
Thanks @doxtitech
a flutter clean did it for me :)
Thank you very much @doxitech
This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of flutter doctor -v
and a minimal reproduction of the issue.
Steps to Reproduce
url_launcher
topubspec.yalm
dependencies: flutter: sdk: flutter url_launcher: ^4.0.3
Logs