Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] can't compile on Android #875

Closed
marcoberetta96 opened this issue Jan 9, 2022 · 14 comments
Closed

[BUG] can't compile on Android #875

marcoberetta96 opened this issue Jan 9, 2022 · 14 comments
Assignees
Labels
new issue New issue which has not been checked yet

Comments

@marcoberetta96
Copy link

History check
Done.

Describe the bug
When launching app on Android I get the following error.

.../android/app/src/main/java/io/flutter/plugins/GeneratedPluginRegistrant.java:24: error: package com.jhomlala.better_player does not exist
      flutterEngine.getPlugins().add(new com.jhomlala.better_player.BetterPlayerPlugin());

Flutter doctor

[✓] Flutter (Channel stable, 2.8.1)
[✓] Android toolchain - develop for Android devices (Android SDK version 31.0.0)
[✓] Xcode - develop for iOS and macOS (Xcode 13.2.1)
[✓] Chrome - develop for the web
[✓] Android Studio (version 2020.3)
[✓] VS Code (version 1.63.2)
[✓] Connected device (4 available)

Better Player version

  • Version: 0.0.81
@marcoberetta96 marcoberetta96 added the new issue New issue which has not been checked yet label Jan 9, 2022
@hussenIbrahim
Copy link

i faced same issue with another package
what is your target and compile android SDK?

@marcoberetta96
Copy link
Author

both 31

@shiyiya
Copy link

shiyiya commented Jan 11, 2022

created by flutter 1?

@marcoberetta96
Copy link
Author

Yes, initially created with flutter 1.
Now running with flutter 2.8.1.

@shiyiya
Copy link

shiyiya commented Jan 15, 2022

try migrate to flutter 2.

@marcoberetta96
Copy link
Author

@shiyiya what do you mean? I'm already on flutter 2.8.1

@shiyiya
Copy link

shiyiya commented Jan 15, 2022

Can you post the MainActivity.kt file?
flutter 1 and 2 are not the same.
are u upgrade it?

@marcoberetta96
Copy link
Author

Here my MainActivity.java. Am I missing something?

package com.marco...;

import android.content.Context;
import android.graphics.Color;
import android.os.Bundle;
import android.os.Handler;
import android.text.Spannable;
import android.text.SpannableString;
import android.text.style.ForegroundColorSpan;
import android.util.Log;
import androidx.annotation.NonNull;
import com.onesignal.OSMutableNotification;
import com.onesignal.OSNotification;
import com.onesignal.OSNotificationReceivedEvent;
import com.onesignal.OneSignal.OSRemoteNotificationReceivedHandler;
import io.flutter.embedding.android.FlutterActivity;
import io.flutter.embedding.engine.FlutterEngine;
import io.flutter.plugins.GeneratedPluginRegistrant;
import java.math.BigInteger;
import java.util.HashMap;
import java.util.Map;
import org.json.JSONObject;

public class MainActivity extends FlutterActivity {
    
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
    }

    @Override
    public void configureFlutterEngine(@NonNull FlutterEngine flutterEngine) {
        GeneratedPluginRegistrant.registerWith(flutterEngine);
    }
}

@shiyiya
Copy link

shiyiya commented Jan 15, 2022

@marcoberetta96
Copy link
Author

Done, but issue is still the same. It happens only with this package.

/.../android/app/src/main/java/io/flutter/plugins/GeneratedPluginRegistrant.java:24: error: package com.jhomlala.better_player does not exist
      flutterEngine.getPlugins().add(new com.jhomlala.better_player.BetterPlayerPlugin());
                                                                   ^
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
1 error

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:compileDebugJavaWithJavac'.
> Compilation failed; see the compiler error output for details.

@shiyiya
Copy link

shiyiya commented Jan 17, 2022

😕 i have not idea.

@marcoberetta96
Copy link
Author

marcoberetta96 commented Jan 18, 2022

Still debugging...
Everything works with better_player: 0.0.77
Issue comes with better_player: 0.0.78

From the changelog I see

  • Migrated android native code to Kotlin.
  • Updated ExoPlayer version to 2.15.1.

Maybe the cause is related to one of these...
@jhomlala do you have any idea?

@shiyiya
Copy link

shiyiya commented Jan 19, 2022

#882 (comment)

@marcoberetta96
Copy link
Author

@shiyiya solved! Thank you!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
new issue New issue which has not been checked yet
Projects
None yet
Development

No branches or pull requests

4 participants